Saravanan666/pypi-org huggingface dataset:
Package: pdf2textlib
pdf2textlibpip install pdf2textlibSimple Multilingual PDF text extraction, Also extracts from imagesimportpdf2textlibprint(pdf2textlib.getText("Demo.pdf","eng+tel+urd"))# parameter 1 : Path to the PDF file# parameter 2 : string of language codes separated by '+' signOS DependenciesDebian, Ubuntu, and friendssudo apt-get install build-essential libpoppler-cpp-dev pkg-config python-devFedora, Red Hat, and friendssudo yum install gcc-c++ pkgconfig poppler-cpp-devel python-devel redhat-rpm-configmacOSbrew install pkg-config popplerConda users may also needlibgcc:conda install -c anaconda libgccWindowsCurrently tested only when using conda:Install the Microsoft Visual C++ Build ToolsInstall poppler through conda:conda install -c conda-forge popplerInstallpip install pdf2textlib
Package: pdf2up
pdf2upA small utility to generate preview images of research papers (e.g. arXiv)
suitable for social media (e.g. Twitter)InstallationTo install as a command line toolpdf2uprun:pipinstallpdf2upUsageRun on the command line aspdf2up input.pdf, optionally with the following flags:usage: pdf2up [-h] [-b BOX [BOX ...]] [--all] [-s SKIP] [-n N_UP] [-c CORES]
              input

positional arguments:
  input

optional arguments:
  -h, --help            show this help message and exit
  -b BOX [BOX ...], --box BOX [BOX ...]
                        to specify a crop box for each pre-cropped 2-up page
                        image, either as 1 side, 2 sides (L/R, T/B), or 4
                        sides (L, T, R, B)
  --all                 override the default of only producing 4 images (which
                        for default 2-up gives 8 pages as 4 PNGs)
  -s SKIP, --skip SKIP  How many pages to skip forward from the original PDF
  -n N_UP, --n-up N_UP  How many pages to 'paste' alongside onto a single page
                        (default: 2)
  -c CORES, --cores CORES
                        Maximum CPU cores to run multicore execution (default:
                        all available cores)To run as a library using thepdf2up.conversionmodule:Thepdf2png()function gives the same interface as the CLITheConvertPdf2Pngclass gives access to values configured by this interfaceDevelopmentmypy: progressive (does not pass completely)flake8: passing (flake8 . --max-line-length=88 --extend-ignore=E203,)
Package: pdf2zip
pdf2zippdf2zip is a small utility to batch convert PDFs that are image based (like
many online distributions of magazines are) into a zipfile full of images.
Various options are available, including options on the quality of the
resulting images, options to scale or resize the images to a bounding box,
and the ability to specify pages in the PDF to skip.This was primarily developed for personal use, but is made available in the
hopes that it might be useful for someone.To install, just:pip install pdf2zipusageUsage: ./pdf2zip [options] file.pdfOptions:--versionshow program’s version number and exit-h,--helpshow this help message and exit--skip=SKIPcomma separated pages to skip (0 is first)--skip-file=SKIP_FILEsupply a file with a number per line of pages to skip--scale=SCALEscale pages to certain size (ex. 50%)-dDIMENSIONS,--dimensions=DIMENSIONSresize images to fit within box-qQUALITY,--quality=QUALITYquality of jpeg compression (default 90)--ipadresize images to a good size for ipad
Package: pdf417as-str
Create pdf417 barcode by special font without using images.Python version3.3+LicenseLGPLv3PyPIhttps://pypi.python.org/pypi/pdf417as_str/How it worksInstall fontpdf417.ttfinto your OS.Encode your data string into special encoded strings.pdf417_encoded_text=pdf417as_str.encode417('https://github.com',columns=5)Paste encoded text into any text editor.+*xfs*prA*kuk*iDo*ixA*sxn*xdw*-
+*yog*slv*Arv*Fyg*tgE*fwg*zew*-
+*uny*BCj*iaw*jcE*AxD*ykx*pDw*-
+*ftw*sgf*AoC*dAc*ajb*ofA*yrx*-Choose “Code PDF417” font for text and adjust line spacing. You will receive pdf417 barcode.NOTE: Small empty space between rows not affects to reading barcode. Anyway you can find suited size.Also you can make .png barcode using pdf417as_str.convert.to_png, but this function for tests and not efficient.Installation$ pip install pdf417as-strAuthorsOriginal codeon VisualBasic and “Code PDF417” font:Bazin Jean-MariePorting to python, writing tests:I’mThanks topennersr
Package: pdf417decoder
pdf417decoderpdf417decoder is a pure Python library for decodingPDF417 barcodes.Reader is capable of Error Detection and Correction according to the standards for PDF417 which you can read about hereISO/IEC 15438:2006or download an older version of the PDFthis website.InstallationUse the package managerpipto install pdf417decoder.pipinstallpdf417decoderUsagefromPILimportImageasPILfrompdf417decoderimportPDF417Decoderimage=PIL.open("barcode.png")decoder=PDF417Decoder(image)if(decoder.decode()>0):decoded=decoder.barcode_data_index_to_string(0)Testing ResultsThis library was tested usingpdf417gento create random barcodes and blurred withOpenCVto test error correction. PyTest is used with several test images to show the libraries capability to decode barcodes in the following test cases.Binary dataMultiple barcodesUpside down barcodeRotated barcodeError Corrections: Corrupted data due to blurred barcodeError Corrections: Missing data due marks concealing barcodeCharacter type transitions (Upper, Lower, Mixed and Punctuation)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseCPOLThis project is a derivative of code licensed under the Code Project Open License (CPOL). The Code Project Open License (CPOL) is intended to provide developers who choose to share their code with a license that protects them and provides users of their code with a clear statement regarding how the code can be used.CreditsSource code is a port of a C# Library created and maintained byUzi Granot.PDF417 Barcode Decoder .NET Class Library and Two Demo Apps
Package: pdf417decoder-with-opencv-python-headless
pdf417decoder-with-opencv-headlesspdf417decoder-with-opencv-headless is a python package that is forked frompdf417decoderWhat difference between pdf417decoder and pdf417decoder-with-opencv-headlesspdf417decoder-with-opencv-headless has no dependancy on opencv-python but depends instead on opencv-python-headless.(opencv-python-headless is a lighter version of opencv for server deployement.)LicenseCPOLThis project is a derivative of code licensed under the Code Project Open License (CPOL). The Code Project Open License (CPOL) is intended to provide developers who choose to share their code with a license that protects them and provides users of their code with a clear statement regarding how the code can be used.CreditsSource code is a port of a C# Library created and maintained byUzi Granot.PDF417 Barcode Decoder .NET Class Library and Two Demo Apps
Package: pdf4me
The Pdf4me Client API is a python package which connects to its highly scalable SaaS cloud service with many functionalities to solve your document and PDF requirements. The SaaS API provides expert functionality to convert, optimize, compress, produce, merge, split, ocr, enrich, archive, print documents and PDF's.FeatureDescriptionOptimizePDF's can often be optimized by removing structural redundancy. This leads to much smaller PDF's.MergeMultiple PDF's can be merged into single optimized PDFs.SplitA PDF can be splitted into multiple PDF's.ExtractFrom a PDF extract multiple pages into a new document.ImagesExtract images from your document, can be any type of document.Create Pdf/ACreate a archive conform PDF/A including xmp Metadata.Convert to PDFConvert your documents from any format to a proper PDF document.StampStamp your document with text or images.RotateRotates pages in your document.ProtectProtects or Unlocks your document with given password.ValidationValidate your document for PDF/A compliance.RepairRepairs your document.BarcodeReads all types of barcode embedded in document or creates themGetting StartedTo get started get a Token by dropping us anemailor registering in ourportal.The Token is required for Authentication. The Pdf4me Client Api provides you already with the necessary implementation. You need only to get an instance for the Pdf4meClient as shown in the sample below."""Either you store them in the config.properties file with tokenDo not use any quotes:Correct: token=sample-not-working-key-aaaaaaaIncorrect: token="sample-not-working-key-aaaaaaa"In case the location of your config.properties differs from the default location ('../config.properties'), provide the optional argument path_to_config_file."""pdf4me_client=Pdf4meClient(path_to_config_file='path_to_my_config.properties')""" or you pass them as arguments when constructing the Pdf4meClient object """pdf4me_client=Pdf4meClient(token=token)# The pdf4meClient object delivers the necessary authentication when instantiating the different pdf4meClients such as for instance Mergemerge_client=MergeClient(pdf4me_client)merged_pdf=merge_client.merge_2_pdfs(file1=FileReader().get_file_handler(path='my_first_pdf.pdf'),file2=FileReader().get_file_handler(path='my_second_pdf.pdf'))DocumentationPlease visit ourdocumentationfor more information about all the functionalities provided and on how to use pdf4me.RecommendationIt's recommended to create an instance ofPdf4meClientper thread in a multithreaded environment to avoid any potential issues.
Package: pdf-add-outline
pdf-add-outlineAdd an outline to a PDF file. What it says on the tin.InstallationInstall throughpip:pip install pdf-add-outlineUsage$ pdf-add-outline --help
usage: pdf-add-outline [-h] -o OUTPUT [-d] [--increment INCREMENT] <pdf_file> <toc_file>

Add an outline to a PDF.

positional arguments:
  <pdf_file>            Input PDF
  <toc_file>            JSON- or TXT-encoded ToC file (file type suffix required)

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Resultant filename (required)
  -d, --dry             Output the parsed OutlineItem structure; don't touch the PDF
  --increment INCREMENT
                        Increase all entries by <increment> amountExample$ pdf-add-outline tests/fixtures/Situated_Learning.pdf tests/fixtures/situated_learning.txt -o situated_with_outline.pdfToC File Formats$ head tests/fixtures/situated_learning.json
[
    ["Series Foreword", 11, []],
    ["Foreword by William F. Hanks", 13, []],
    ["Acknowledgments", 25, []],
    ["1. Legitimate Peripheral Participation", 27, [
        ["From apprenticeship to situated learning", 32, []],
        ["From situated learning to legitimate peripheral participation", 34, []],
        ["An analytic perspective on learning", 37, []],
        ["With legitimate peripheral participation", 39, []],
        ["The organization of this monograph", 42, []]$ head tests/fixtures/situated_learning.txt
Series Foreword, 11
Foreword by William F. Hanks, 13
Acknowledgments, 25
1. Legitimate Peripheral Participation, 27
    From apprenticeship to situated learning, 32
    From situated learning to legitimate peripheral participation, 34
    An analytic perspective on learning, 37
    With legitimate peripheral participation, 39
    The organization of this monograph, 42
2. Practice, Person, Social World, 45DevelopmentPrerequisites: Clone the repository. InstallPoetry.Runpoetry installin the root of the directory.Run the tests.$ poetry run pytest tests
collected 4 items

tests/test_parsing.py ....        [100%]

========== 4 passed in 0.03s ===========Runmypy.$ poetry run mypy pdf_add_outline tests
Success: no issues found in 4 source filesRunblack.$ poetry run black pdf_add_outline tests
All done! ✨ 🍰 ✨
4 files left unchanged.AcknowledgementsThe excellentPikePDFpackage, which wraps theQPDFlibrary. Jean Lave and Etienne Wenger'sSituated Learningfor the example (and test) table of contents.
Package: pdf-aggregator
PDF aggregatorAggregate account PDF statements into JSON and visualize aggregated financial data as timeline.Works offline and relies ontikafor PDF parsing andmatplotlibfor plotting.
It relies on regular expressions stored in simple configuration files to extract bank statements balance, date, account number...Installationpip install -r requirements.txtUsageAggregateScan PDF files and aggregate financial data into an accounts.json summary file:python aggregate.py path/to/folder/with/PDForpython aggregate.py path/to/file.pdf--helpfor more options.Add a new configpython aggregate.py path/to/PDF/file --testIt should print out the content of the pdf. Then test regular expression:python aggregate.py path/to/PDF/file --test 'Ending balance on (\d+)/(\d+)/(\d+)You can then create conf file and test detection with -vvv:python aggregate.py path/to/PDF/file -vvvPlotPlot aggregated data:python plot.py path/to/folder/with/multiple/accounts.jsonorpython plot.py path/to/accounts.json--helpfor more options.Example:python.exe .\plot.py .\accounts\ --subtotals --no_real_estate_appreciation
Package: pdfannot
pdfannotThis package aims to create a two-way link between annotated pdf and excel data frame.It allows you to :create an DataFrame containing each string annotated of the pdf in a column 'annot_text', along with its annotation in a column 'label' and information such as coordinates, page etc.annotate a pdf given an DataFrame of the form described above.It can be really useful for generating automatically annotated pdf documents with NLP models capable to
infer annotations from raw texts in a data frame.Prerequisitespandasfitz(pip install pymupdf)Installingpip install pdfannotExamplesYour DataFrame must contains info on what to annotate on the pdf :import pdfannot
import pandas as pd

# adf stands for annotation dataframe
adf = pd.DataFrame([
{'x': 40, 'y': 60, 'w': 300, 'h': 50}, 
{'text': 'APPEAL relating to Cancellation Proceedings No 399', 'type': 'Highlight'},
{'text': 'ication for a declaration of i', 'type': 'Highlight', 'label': 'label 1'},
{'x': 100, 'y': 600, 'w': 300, 'h': 50, 'page': 1, 'label': 'label 2'}, 
 ])

# pdfannot.exple_pdf is a test pdf shipped with pdf annot package / debug is set to True for some verbose
pdfannot.annotate_pdf(adf, pdfannot.exple_pdf, '/tmp/test.pdf', debug=True)Your annotation dataframe should have already columns 'x','y','h','w' (coordinate to make a square) or 'text' (texts to annotate).annotate_pdf(DataFrame, orig_pdfpath, dest_pdfpath)will use your DataFrame and the directory of your pdf passed in argument to annotate it and store it at dest_pdfpath.The function also considers optional columns 'label' to label your annotations and 'type' to specify whether you want
a 'Square' or a 'Highlight'.Defaults are label : '' and type : 'Square'.Finally, specifying the annotation's page with a column 'page' speeds up the algorithm. "page" is optional for 1 page pdfs.InternalsHowever if your DataFrame has one text column per label of annotation (WARNING : each of them must be named annot_{label_name}) then you can transform it with :annot_utils.dlf2adf(DataFrame)to make it acceptable by annotate_pdf. After this execute :annotate_pdf(DataFrame, orig_pdfpath, dest_pdfpath)to annotate your pdf (this method allows only highlights).AuthorsArthur Renaud, Antoine Marullaz --> StackadocAny recommendation/question ? -->contact@stackadoc.com
Package: pdf-annot
pdf_annotUtilities to extract and merge PDF annotationsInstallationpythonsetup.pyinstall# or pip install pdf_annotUsageextract annotations from PDF and save as JSONpython-mpdf_annot.extract--pdf"path/to/pdf"cmd usagepython -m pdf_annot.extract -h
usage: extract annotations from PDF and save as JSON in the same folder
       [-h] -p PDF

optional arguments:
  -h, --help         show this help message and exit
  -p PDF, --pdf PDFattach JSON annotations to an exsiting PDFpython-mpdf_annot.attach-p"path/to/pdf"-a"path/to/first/annot/json"["path/to/second/annot/json"]...cmd usagepython -m pdf_annot.attach -h
usage: attach JSON annotations to a PDF and save a new PDF in the same folder (with '- annotated' appended)
       [-h] -p PDF [-a ANNOTS [ANNOTS ...]] [--prune]

optional arguments:
  -h, --help            show this help message and exit
  -p PDF, --pdf PDF
  -a ANNOTS [ANNOTS ...], --annots ANNOTS [ANNOTS ...]
                        annotation jsons, one annotation per line
  --prune               prune old annotations from the pdfNotesAt the moment, only textual kind of annotations are supported. For more information, please viewannotation.py.
Package: pdf-annotations-diff
pdf-annotations-diffI frequently need to compare my annotations on multiple versions of a PDF file. If you are amongst the three other people who need to do the same, this Python script would be useful to you.This script compares annotations across two PDF files (which are assumed to be two versions of the same base PDF file). It outputs annotations that are unique to each of the two files.Installationpipinstallpdf-annotations-diffUsageTo compare annotations in two PDF files, you can use the following command:pdf-annotations-difffile1.pdffile2.pdfDependenciesThis script depends on thePyMuPDFlibrary.LicenseLicensed under the MIT License. See the LICENSE file for more details.ContributingContributions are welcome! Please feel free to submit a Pull Request.ExampleThis is an example of how to use pdf-annotations-diff to compare two PDF files:pdf-annotations-diffMen\Without\Women\-\Haruki\Murakami.pdfMen\Without\Women\-\Haruki\Murakami.sync-conflict.pdfAnd the resulting output would look something like this:Unique Annotations in Men Without Women - Haruki Murakami.pdf:

Underline at page 207
Text: paperback. Whenever he got tired of reading (at least, Kino guessed that he was tired), he looked up from the page and studied the bottles of liquor lined up on the shelves in front of him, as if examining a series of unusual taxidermied animals from faraway lands.
Info:
  title: NovaPro

Underline at page 248
Text: Teddy Wilson, Vic Dickenson, Buck Clayton— sometimes he longed desperately to listen to their old-time jazz, with its steady, dependable technique and its straightforward chords. He wanted to feel the pure joy they had in performing, their wonderful optimism. That was the kind of music Kino sought,
Info:
  title: NovaPro

Underline at page 180
Text: stapler, his calendar—the most mundane objects became somehow radiant by being his.
Info:
  title: NovaPro

--------------------------------------------------------------------------------

Unique Annotations in Men Without Women - Haruki Murakami.sync-conflict.pdf:

Highlight at page 207
Text: paperback. Whenever he got tired of reading (at least, Kino guessed that he was tired), he looked up from the page and studied the bottles of liquor lined up on the shelves in front of him, as if examining a series of unusual taxidermied animals from faraway lands.
Info:
  title: Sameer A5
  creationDate: D:20230423214101Z00'00
  modDate: D:20230423214101Z00'00
Package: pdfathom
pdfathomis a command-line utility that lets you query PDF documents with
natural language.InstallationYou can install it via the pip package manager:$pipinstallpdfathomUsageBelow is the output ofpdfathom --help:usage: pdfathom [-h] [--config CONFIG] [--openai_api_key OPENAI_API_KEY]
                [--chunk_size CHUNK_SIZE] [--chunk_overlap CHUNK_OVERLAP]
                pdfs [pdfs ...]

positional arguments:
  pdfs                  Path to the pdf file(s) or URL(s)

options:
  -h, --help            show this help message and exit
  --config CONFIG, -c CONFIG
                        Path to the configuration file
  --openai_api_key OPENAI_API_KEY, -k OPENAI_API_KEY
                        OpenAI API key
  --chunk_size CHUNK_SIZE, -s CHUNK_SIZE
                        Chunk size
  --chunk_overlap CHUNK_OVERLAP, -o CHUNK_OVERLAP
                        Chunk overlapConfigurationpdfathomlooks for a configuration file called.pdfathom.jsonlocated in
your home directory, and it looks like:{"openai_api_key": "<OPENAI-API-KEY>"}You will be prompted for an OpenAI API key upon running the program if it's not
already present in the configuration file, this will also handle creating the
configuration file for you.
Package: pdfautonup
Check out my other PDF tools:pdfimpose|dummypdf.Fit as much pages as possible, from some PDF files to a ‘n-up’ PDF file of a given page size, guessing the layout.ExamplesWith the default paper size being A4,pdfautonupon:trigo.pdfgivestrigo-nup.pdfpcb.pdfgivespcb-nup.pdfthree-pages.pdfgivesthree-pages-nup.pdfSee the documentation for the full command lines used to generate those examples.What’s new?Seechangelog.Download and installSee the end of list for a (quick and dirty) Debian package.From sources:Download:https://pypi.python.org/pypi/pdfautonupInstall (in avirtualenv, if you do not want to mess with your distribution installation system):python3 setup.py installFrom pip:pip install pdfautonupNote: IfPyMuPDFcan be installed, you can use:pip install pdfautonup[pymupdf]This will change the python library used to read and write PDF files (PyMuPDFinstead ofPyPDF), to make pdfautonup faster.Quick and dirty Debian (and Ubuntu?) packageThis requiresstdeb(andsetuptools-scm) to be installed:python3 setup.py --command-packages=stdeb.command bdist_deb
sudo dpkg -i deb_dist/pdfautonup-<VERSION>_all.debDocumentationThe compiled documentation is available onreadthedocsTo compile it from source, download and run:cd doc && make html
Package: pdf-binder
ContentsTerminologyPageSheetPaperSignatureText BlockPapers Per SignatureStitchingThis is a very simple tool for converting any in-order, on-page-per-sheet PDF into signatures for the purpose of book binding. The output pdf (bound_book.pdf by default) can be printed using default printer settings (printing on both sides).TerminologyPageA page is used to refer to a single page of an input PDF fileExample: A 10-page input PDF file has 10 pages.SheetIn the output PDF file, each output page has 2 pages on it. These output pages are called sheets, as in "2 pages per sheet"Example: If we have a 12-page input PDF, the output PDF would have 6 sheetsPaperDefinition: A paper is the physical medium on which the content is printed. It has two sheets, one front and back.Example: If we have a 12-page input PDF, the output PDF would have 6 sheets printed on 3 papers.SignatureDefinition: A signature is a group of papers that are printed in such a way that when folded, they form a small booklet. Signatures are crucial in bookbinding because they allow the binding to be more durable and enable the book to open more flatly and easily.Example: If you have a 40-page document, you could create signatures of 5 papers each (10 sheets, or 20 pages). You would end up with 2 signatures, each containing 20 pages.Text BlockDefinition: A text block is the complete collection of signatures that are bound together to form the main body of the book. The text block does not include the cover of the book.Example: Using the example above, the 2 signatures (each with 20 pages) would be bound together to form a single text block of 40 pages.Papers Per SignatureOne of the key arguments to change based on your application is the number of papers per signature. Typically, you would choose 4-7 papers (default 4), but you might do more for very thin paper.StitchingTo aid with aligning stitches between signatures, marks are added to the front of the first paper and the back of the last paper in ever signature. This is where you would thread the needle when stitching the signatures together. You can choose how many stitches you want to add by altering the num_stitches argument (default 7).