pdfminer.six icon indicating copy to clipboard operation
pdfminer.six copied to clipboard

Add import statements to tutorials

Open jugmac00 opened this issue 4 years ago • 1 comments

Feature request

  • A description of the feature you would like to have

I suggest to add the import statements to the tutorial sections.

  • If relevant, the context that you are in. What are you trying to achieve?

I am a new user of pdfminer.six (wohoo) and I tried to follow the tutorial, but had a hard time as the import statements are missing.

eg here https://pdfminersix.readthedocs.io/en/latest/tutorial/highlevel.html

I certainly have found the excellent API documentation later, but it took some time.

Also, when I had a look in the source code of the docs, I saw that there is a test setup directive included in order to make the doc tests pass.

.. testsetup::

    import sys
    from pdfminer.high_level import extract_text_to_fp, extract_text

So, doc tests need import statements, humans (at least beginners) need import statements, why not include them in the tutorial sections?

I'd like to create a PR if you are ok with my suggestion.

jugmac00 avatar Feb 23 '21 15:02 jugmac00

Thanks for the tip! :+1:

pietermarsman avatar Aug 07 '22 13:08 pietermarsman