Saravanan666/pypi-org huggingface dataset:
Package: pdf-shuffle
pdf-shuffleA PDF page/image randomizer, or flashcard quiz from a PDF. Or randomize files from a folder.Installation$ pip install pdf-shuffleUsagepdf-shuffle comes with 2 CLI applications:$ pdf-shuffle --help
Usage: pdf-shuffle [OPTIONS] FILENAME

Options:
  --start INTEGER
  --end TEXT
  --step INTEGER
  --random / --no-random
  --host TEXT
  --port INTEGER
  --help                  Show this message and exit.
$ pdf-shuffle test.pdfAnd,$ pdf-quiz --help
Usage: pdf-quiz [OPTIONS] FILENAME

Options:
  --start INTEGER
  --end TEXT
  --step INTEGER
  --random / --no-random
  --host TEXT
  --port INTEGER
  --help                  Show this message and exit.
$ pdf-quiz quiz.pdfOf course, you can invoke the app from a Python script as well.frompdf_shuffleimportinitinit('test.pdf')Or,frompdf_shuffleimportinit_quizinit_quiz('quiz.pdf')You can also random files in a folder:frompdf_shuffleimportinitinit('test/')Advanced usageBy default,quiz.pdfmeans, excluding the first slide, every first and second slides are front of the card and back of the card, respectively. You can change that, with:importos,jsonos.environ['PAGE_RANDOM']=json.dumps([2,3,5,9,12])Spaced-repetition system (SRS)If you are looking into extending the app with SRS, you might try,srs-sqlite, which I currently use.
Package: pdfsimple
pdfsimpleEsse pacote usado para fazer adição de texto e imagens de forma simplificada a um arquivo pdf criado no momento da execuçãoImagem adicionada a um exemplo:Imagem depois de adicionada a um pdf:instalação:pip install pdfsimpleUSO:from pdfsimple import PDF

pdf = PDF("local_do_arquivo/nome_do_arquivo.formato")
c.addText('texto', 'center', 'titulo')
c.addimage('imagem', 'center')
pdf.salvar()
Package: pdf-slashannots
pdf-slashannots – Redact PDF Annotation MetadataBy annotating PDFs you leave metadataalong with the annotation content like
yourname and the date and timewhen you created and last modified each
annotation.
This metadata can beseen and exploited by anyonewith access to the annotated
PDF file.That way, others could for instanceinfer how long you took to readthrough and
comment on a document and even individual pages,
or infer when you made breaks or did something else.pdf-slashannots aims at redacting that annotation metadata from PDFs so that
you can pass them along without revealing your habits.Installationpdf-slashannots is available on PyPI:python3 -m pip install pdf-slashannotsUsageSimply runpdf-slashannots input.pdf redacted.pdfand you are done.Okay, there is more. If you run the command without any options then all
annotations are equally redacted and the dates set tononeprecision (January
1st, 1970).
Check outpdf-slashannots --helpfor the more advanced
features likespecify a subset of annotation authors to redactspecify the precision to which the dates are reducedredact also the authors' nameOr, if you prefer a graphical interface, there is alsopdf-slashannots-guibased on Python Tkinter.
Package: pdfslim
PDF-SlimPDF-Slimv1.1.0 byFederico StraSummarypdfslimtakes a number of PDF files and tries to optimize them through a suitable call toghostscript. It is specifically fitted to reduce teh size of scanned papers, containing images with humongous resolution.InstallationTo installpdfslimfor the first time or upgrade it to the latest version, run the following command at your shell:pipinstall--upgradepdfslim
Package: pdfsplit
Pdfsplit(formally namedpdfslice) is a Python command-line tool
and module for splitting and rearranging pages of a PDF document.
Using it you can pick single pages or ranges of pages from a PDF document
and store them in a new PDF document. To do this you describe these pages
with the simple Python slice notation, e.g.0:10for the first ten
pages,-10:0for the last ten pages,0::2for all even pages,-1::-1for all pages in reversed order, etc.Basically,pdfsplitwrappspyPdf,
a package written by Mathieu Fenniak which contains the needed
functionality in its core, but does not provide a simple method of
using it easily from the command-line or from a Python module.Featuressave arbitrary slices of a given PDF document in a new PDF documentinstall a Python module namedpdfsplit.pyinstall a Python command-line script namedpdfsplitspecify arbitrary slices using Python notation, e.g.0:10:2specify pages using normal page numbers (starting at 1), e.g.-p1-5allow patterns for output filesprovide a Unittest test suiteExamplesYou can usepdfsplitas a Python module e.g. like in the following
interactive Python session:>>> from pdfsplit import splitPages
>>>
>>> splitPages("file.pdf", [slice(0, 1, None)])    # i.e. [0]
written: file-split.pdf
>>> splitPages("file.pdf", [slice(None, None, 2)]) # i.e. [::2]
written: file-split.pdfIn addition there is a script namedpdfsplit, which can be used
more easily from the system command-line like this (you can see many
more examples when typingpdfsplit-hon the command-line):$ pdfsplit 0 file.pdf
written: file-split.pdf
$ pdfsplit ::2 file.pdf
written: file-split.pdf
$ pdfsplit -p -o "%(dirname)s/%(base)s-p%(indices)s%(ext)s" 3-5 file.pdf
written: file-p3-5.pdf
Package: pdf-splitter
PDF SplitterSplit a PDF file by page ranges or extract all PDF pages to multiple PDF filesFree software: MIT licenseDocumentation:https://pdf-splitter.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2019-01-19)First release on PyPI.
Package: pdf-split-tool
MAINTAINER NEEDED: this project is complete but won’t be updated until further notice. If you have interest in improving it, please contact me by creating anissue here.FeaturesCross-platform: Windows, Mac, and Linux are officially supported.Works with Python 3.8 and 3.9.Splits documents by max size.Checks for high-resolution PDFs before splitting.RequirementsYou need Python 3.8 or above (3.9 recommended) installed on your machine.Windows users should downloadWindows x86-64 executable installerand in the installer screen be ensure the optionAdd Python 3.8 to PATHis checked:InstallationYou can installPdf Split ToolviapipfromPyPI:pip install pdf-split-toolNote: on Windows you can copy the above command in thecmdprogram.UsageEnter the terminal of your operating system eg.cmdprogram on Windows or shell on Linux and MacOS.Choose the one option and execute the command on the terminal:For splits with the default value (20mb) of a specific PDFpdf-split-tool C:\Users\John\myfile.pdfFor splits with the default value (20mb) of all PDFs in a folderpdf-split-toolYou can choose the max size in megabytes with the option-mor–max-sizepdf-split-tool --max-size 50 # for 50 megabytesNote: you can also use –max-size after the path of a specific PDF and fractional numbers such as “50.5”.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMITlicense,Pdf Split Toolis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz’sHypermodern Python Cookiecuttertemplate.
Package: pdfsquash
pdfsquashTool(s) to transform PDFs for printing multiple pages on a sheet.Usagepdfsquash-o<output-pdf><input-pdf-1><input-pdf-2>...For more options, seepdfsquash-hExamplesFollowing PDF files are used as sample inputs:1.pdf2.pdf3.pdf4.pdfDefault optionspdfsquash-osamples/1-4-default.pdf\samples/1.pdfsamples/2.pdfsamples/3.pdfsamples/4.pdfHere is how result will look:1-4-default.pdfChange spacing between minipagesDefault spacing is 0. To chang it to 10pt use this command:pdfsquash-osamples/1-4-spacing.pdf\-s10\samples/1.pdfsamples/2.pdfsamples/3.pdfsamples/4.pdfHere is how result will look:1-4-default.pdfChange page marginDefault page margin is 20pt. To change it to 0pt use this command:pdfsquash-osamples/1-4-margin.pdf\-m0\samples/1.pdfsamples/2.pdfsamples/3.pdfsamples/4.pdfHere is how result will look:1-4-default.pdfKeep aspect ratio of the originalBy default, original mini-pages will be shrinked and stretched to fit the target sheet location,independently in X and Y direction*.
If you want to preserve original aspect, do this:pdfsquash-osamples/1-4-keep-aspect.pdf\-m0\-k\samples/1.pdfsamples/2.pdfsamples/3.pdfsamples/4.pdfHere is how result will look:1-4-keep-aspect.pdfTODOSupport other paper sizes (currently hardcoded to US Letter)Support other number of mini-pages per paper sheet (2, 6, 8). Currently do only 4 mini-pages per paper sheet.Support page re-ordering. Currently mini-pages are placed in a fixed order (left-to-right, top-to-bottom).LicenseMIT
Package: pdfstitcher
PDFStitcherPDFSticher is a utility for stitching together many PDF pages from one document into a single page. This is also called "N-Up" or page imposition. This program was created in order to convert sewing patterns into a convenient format for projecting, though it could be used to stitch together any PDF.Since version 0.4, it is also possible to select layers for inclusion/exclusion in the final output. Additionally, line properties can be modified for each layer if the input PDF is compatible.For up-to-date information, also check outhttps://www.pdfstitcher.org.Download the latest releaseWindows (7 or 10, 64-bit)macOS - Intel ProcessormacOS - M1/M2 ProcessorUsing pip:pip install pdfstitcherNote: Requires Python <= 3.11. As of November 2022, there is no wheel available for wxPython for 3.11+.Translations:PDFStitcher will detect system language settings and change localisation if supported.Previous versions can be found by clicking on the "releases" link to the right.Want to contribute a translation? PDFStitcher is now onweblate!.FeaturesStitch together pages in any order with specified number of rows/columnsRotate pages for stitchingAdd a margin around the final outputTrim or overlap the edges of each page by a specified amountAdd blank pages by including zeros in the page list (e.g. 1-5,0,6-10)Layers are automatically preserved if present in the source documentExclude layers (either deactivate or remove)Modify line properties (colour, thickness, style (solid, dashed, dotted))Development InstallationMost people probably want to just use the executable links above. However, to edit the code, clone this repo and install in editable mode using the command:$pipinstall-e".[dev]"Help!Found a bug, or have an idea for a great new feature? Check out theIssuestab to see if it's an open issue, or submit a new one if it's not on the list.
Package: pdf-table2json
pdf-table2jsonExtract tables data from pdf files To JSONLocate the table with oepncv and read the contents with a text reader (Your table should be blocked by a border)(If you don't have a border, add a border through adjustment)The pdf must be readable by a text reader. Drag on pdf to see if the text is captured.Check version before install1.0.1: Only the basic table is supported2.0.1: Handling tables with separate headers or cells(example)Current Status(Change the values ​​if adjustments are needed)Finds a table with a horizontal length greater than 1000 and a height greater than 100.Cells are excluded if their width or height is equal to the width or height of the table, or if the width or height of the cell is less than 10.Adding border lines to areas with a color of (230, 230, 230) and a width of 1000 or more to recognize them as table regions.Removing watermark images with a color of (213, 213, 213 == #D5D5D5).The specific string list is removed from the PDF text for the purpose of removing text watermarks (Currently empty).InstallationRquired Python >= 3.8install with pippipinstallpdf-table2jsonExampleimportimportpdf_table2json.converterasconverterpath="PATH/PDF_NAME.pdf"result=converter.main(path,json_file_out=True,image_file_out=True)print(result)CLIpythonconverter.py-i"pdf_path/pdf_name.pdf"[-j][-o]"-i", "--input", required=True, help="[Required] Input PDF file path""-j", "--json_file", action="store_true", help="[Optional] Create JSON Data file""-o", "--image_file", action="store_true", help="[Optional] Save Image Data file"version-1.0.1Only the basic table is supported. (Supports only tables with horizontal headers).The number of headers and the number of cells must be the sameExample TableHeader 1Header 2Header 3cel1cel2cel3cel1cel2cel3cel1cel2cel3Exampleconverter.pyimportpdf_table2json.converterasconverterpath="PATH/PDF_NAME.pdf"result=converter.main(path,json_file_out=True,image_file_out=True)print(result)version-2.0.1 or HigherTables in general format that can be processed in version 1.0.1 can be processed.Example TableHeader 1Header 2Header 3cel1cel2cel3cel1cel2cel3cel1cel2cel3Table with separated header and subheaderExample TableHeader 1Header 2Sub Header 1Sub Header 2cel1cel2cel3cel1cel2cel3cel1cel2cel3OutputDelete separated parent header, use child headerHeader 1 : cel1
Sub Header 1 : cel2
Sub Header 2 : cel3Tables with columns separated, except for the first cellExample TableHeader 1Header 2Header 3cel1cel2cel3cel1cel2-1cel3-1cel2-2cel3-2OutputAdd to data in the top row (with "@")Header 1 : cel1
Header 2 : cel2
Header 3 : cel3
Header 1 : cel1
Header 2 : cel2-1@cel2-2
Header 3 : cel3-1@cel3-2Use Exampleconverter_2.pyimportpdf_table2json.converter_2asconverter_2path="PATH/PDF_NAME.pdf"result=converter_2.main(path,json_file_out=True,image_file_out=True)print(result)LicenseGPL-3.0 licenseContactReporting a bug@yousojeongRead Text From PDF libraryPyMuPDFGitHub
Package: pdf_table_extractor
PDF Table ExtractorExtract table data from PDFsFree software: MIT licenseDocumentation:https://pdf-table-extractor.readthedocs.io.Featuresthis software should be able to automaticall extract tabular data from PDF files,tables must have some visual bounds in form of horizontal and vertical lines.See AlsoTabula- similar goal, much more advanced project - extract table data from PDFs in Ruby, including GUICreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2017-04-30)First release on PyPI.
Package: pdfTableJson
pdfTableJsonThis is a package created to parse specific documents.Use the following libraries to parse tables in a typical pdf.Pypipdf-table2jsonGitHubpdf-table2jsonInstallationRquired Python >= 3.8install with pippip install pdfTableJsonExampleexampleimportpdfTableJson.converterasconverterpath="PATH/PDF_NAME.pdf"exclude_list=[]# if you want remove textresult=converter.main(path,exclude_list)print(result)LicenseGPL-3.0 licenseContact@yousojeongRead Text From PDF libraryPyMuPDFGitHub
Package: pdftablr
This is a Python 3 module and command line utility that analyzes XML output from theprogram `pdftohtml` in order to extract tables from PDF files and output the data as CSV.For example:pdftohtml -xml -stdout file.pdf | pdftable -f file%d.csvSee also `pdftable -h` and http://sourceforge.net/projects/pdftableOriginal author: (c) 2009 Kyle Cronan <kyle@pbx.org>This Python 3 implementation: (c) 2017 Phil GoochAs per Kyle's code, this version is licensed under GPLv3. See LICENSE file.# InstallationInstall `pdftohtml` via `poppler-utils` (Linux) or `poppler` (Mac OSX)Then install the modulepython setup.py installorpip install pdftablr## Command line usagepdftohtml -xml -stdout file.pdf | pdftable -f file%d.csv## Module usagefrom pdftablr.table_extractor import Extractor# XML file created from pdftohtmlinput_path = '/path/to/file.xml'# Output CSV fileoutput_path = '/path/to/output.csv'with open(output_path, 'w') as output_file:table_extractor = Extractor(output_file=output_file)with open(input_path) as f:table_extractor.read_file(f)tables = table_extractor.extract()for table in tables:table.output(writer=None)
Package: pdf-template
pdf_templateSmall wrapper around pdftk for filling and signing PDFsExample:frompdf_templateimportPDFTemplate,PDFTemplateSection,SignatureBoundingBoxfromPILimportImageinput_data={"is_18_or_over":True,"title_mr":False,"title_ms":True,"first_name":"Foo","last_name":"Bar","address1":"None","zipcode":None,"mailto_line_1":"some address!",}template=PDFTemplate([PDFTemplateSection(path="tests/test-input-page-1.pdf",is_form=True),PDFTemplateSection(path="tests/test-input-page-2-3.pdf",is_form=True,signature_locations={1:SignatureBoundingBox(x=300,y=490,width=200,height=37)},),PDFTemplateSection(path="tests/test-input-page-4.pdf",signature_locations={1:SignatureBoundingBox(x=188,y=50,width=200,height=28)},),])withtemplate.fill(input_data,signature=Image.open("tests/sig.jpeg"))asoutput_pdf:withopen("output.pdf","wb")asout_file:out_file.write(output_pdf.read())
Package: pdftextract
PdfTextractA very fast and efficient python PDF text & images extractor that uses the xpdf c++ library.FeaturesSeveral times fatser then any python based pdf text extractorvery easy and simple to useExtract text while maintaining original document layoutTrys to automaticaly extract tables if they exist (still in beta)No local server setup requiredNo dependencies neededInstalationInstall via PyPi:pipinstallpdftextractor via github:first clone the repo:gitclonehttps://github.com/Bnilss/pdftextract.gitthen runpythonsetup.pyUsageImporting the packagefrompdftextractimportXPdffile_path="examples/pubmed_example.pdf"pdf=XPdf(file_path)Get the PDF meta-dataprint(pdf.info)# this will return a dict of pdf metadata (author, size, pages..)# to get the number of pages for exampleprint(pdf.info['Pages'])Extracting text from all pages in a PDF and return it as stringtxt=pdf.to_text()print(txt)Extracting a single page only, to get the 3rd page for example# we can extrat using the previous method (start_index=1)txt=pdf.to_text(just_one=3)# or use the bracket notation (start_index=0)txt=pdf[2]Extracting text from a single page (page 7) and saving it to .txt filepdf.to_text("page7.txt",just_one=7)Extracting text from page 1 to 5txt=pdf.to_text(start=1,end=5)# ortxt=pdf[:5]Extract tablespdf=XPdf("examples/table_sample.pdf")txt=pdf.to_text(table=True)# the use a regex or something to parse the text ..# or try automatic paring (still in beta)tables=pdf.table[:]print(len(tables))# 3print(tables[0])# print formated content of table 1#Number of Coils | Number of Paperclips#______________________________________#       5        |       3, 5, 4#      10        |       7, 8, 6#      15        |      11, 10, 12#      20        |      15, 13, 14table1_data=tables[0].data# will return all rows in table except headersOS supportby default the package support windows.to use it in linux or mac:download xpdf files forlinuxormacextract the files in got to os version (32/64 bit)copy these files: pdftotext, pdfinfo, pdfimagesGot to the packages-directory/pdftextract/xpdfpast the file in that directoryCreditsxpdf c++by Derek NoonburgLicensepdftextractis licensed under the GNU General Public License (GPL), version 3.
Package: pdftext-to-speech
Text To SpeechThe TextToSpeech project is a Python-based application that enables users to convert PDF and TXT files into audio files in the WAV format. With this project, users can easily transform written text into spoken words, making it convenient for individuals who prefer listening over reading. The project utilizes the PyPDF2 library to extract text from PDF files and supports direct text input from TXT files. Users can specify the desired language and pass the text to a Text-to-Speech API, which generates the corresponding audio data. The final output is saved as an audio file in WAV format, providing a seamless experience for anyone looking to convert written content into an audio format.InstallationYou can install TicTacToeEnhanced using pip:pipinstallpdftext-to-speechUsagefromtextToSpeech.textToSpeechimportAudio,AudioRequest,File# you can use any other API, I am using text to speech from rapidapiurl="https://text-to-speech27.p.rapidapi.com/speech"# define your filename and working directory# define working directory (the directory where the file resides). Keep empty to get the file from the same working directorymy_file=File('sample.pdf',working_dir='speeches')# text response is a dict with the text inside txttext=my_file.read_file()["txt"]# make sure to define your language# for a full list check languages.txt in the git repoquerystring={"text":text,"lang":"en-us"}# particular for this API. Use your ownheaders={"X-RapidAPI-Key":"YOUR API KEY","X-RapidAPI-Host":"text-to-speech27.p.rapidapi.com"}audio_request=AudioRequest(url=url,querystring=querystring,headers=headers)response=audio_request.request_audio_data()# name your file what you want, my api return bytes convertable to wav# you can change your output directory or keep it empty so the file is saved same as your working directoryaudio=Audio(audio_filename="speech.wav",output_directory="speeches")result=audio.save_audio_file(response)print(result["message"])Enjoy :)ContributingContributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request onGitHub.LicenseThis project is licensed under theMIT LicenseYou can now copy this code and use it as your README.md file.
Package: pdftk-wrapper
Welcome to pdftk-wrapperInstallationpython3 -m pip install pdftk-wrapperHas been tested withpython>=3.8.UsageThis is a Python wrapper over pdftk.  At present it supports only removing
pages from a pdf.  Example of a run:pdftk-remove-pages ./sample_1.pdf 1,3-195 ./gitignore_sample_1.pdfAssuming the filesample_1.pdfhas 195 pages.  The above would remove the first page and pages 3 up to 195 and output the resulting pdf togitignore_sample_1.pdfSo the resulting filegitignore_sample_1.pdfwould just contain one page which was the second page insample_1.pdf$  pdftk-remove-pages --help
usage: pdftk-remove-pages [-h] input_file page_string output_file

A wrapper over pdftk to remove pages from a pdf.

positional arguments:
  input_file   Path to the pdf file to remove pages from.
  page_string  Remove specific pages from the pdf. Example: 1-10,13,15-20,32
  output_file  Path of the output file.

options:
  -h, --help   show this help message and exit
Package: pdfToAudioBookConverter
PDF TO AUDIOBOOK CONVERTERThis is a simple package that helps you in creating audiobooks (in the form of .mp3) from a pdf file.The import statementUse this import statement to import all the functions of the library:from pdftoAudiobook import *Function use example:pdftoAudiobook.pdf_to_audiobook(pdfFileName)PDF TO AUDIOBOOK converter functionsThere are two functions in this package:pdf_to_audiobook:This function parses through the entire pdf document, converts it into speech and creates a single .mp3 file. This function takes one string argument, the path of the pdf file that is to be converted.pdf_to_audiobook_per_page:This function parses through the entire pdf document and creates a one .mp3 file per page. This function also takes one string argument, the path of the pdf file that is to be converted.Future scopesCreate a function that parses through a text file and converts that into an audiobookProvide another alternatives for converting text-to-speech. Currently, it uses gTTS library for this purpose.LimitationsSince gTTS library is used for text-to-speech conversion, it requires internet connection while running the scriptsThe pdf file is converted to speech as-is, no modifications are made to the original format. Due to this, improperly
formatted file may give bad output. However with a standard text format, this will work properly.Since API is used to convert the text to speech, it takes a long time to convert if the number of pages
is more