{"id":15633974,"url":"https://github.com/revolunet/pypdftk","last_synced_at":"2025-04-04T10:02:41.916Z","repository":{"id":7444105,"uuid":"8785453","full_name":"revolunet/pypdftk","owner":"revolunet","description":"Python module to drive the awesome pdftk binary.","archived":false,"fork":false,"pushed_at":"2023-04-06T09:14:42.000Z","size":823,"stargazers_count":148,"open_issues_count":19,"forks_count":62,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T09:01:46.336Z","etag":null,"topics":["forms","pdf","pdftk","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/revolunet.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-14T21:08:49.000Z","updated_at":"2024-12-23T08:37:38.000Z","dependencies_parsed_at":"2024-06-18T20:04:07.065Z","dependency_job_id":"6af2facd-b00e-444e-938c-25b8d4e6e04e","html_url":"https://github.com/revolunet/pypdftk","commit_stats":{"total_commits":100,"total_committers":23,"mean_commits":"4.3478260869565215","dds":0.8,"last_synced_commit":"cec246855b02fcbb9af5f95a39d6656ef2d110d3"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fpypdftk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fpypdftk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fpypdftk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fpypdftk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revolunet","download_url":"https://codeload.github.com/revolunet/pypdftk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149508,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forms","pdf","pdftk","python"],"created_at":"2024-10-03T10:50:51.343Z","updated_at":"2025-04-04T10:02:41.883Z","avatar_url":"https://github.com/revolunet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pypdftk |pypi| |travis| |githubactions|\n===========================================\n\nPython module to drive the awesome `pdftk`_ binary.\n\nProudly brought to you by many `awesome contributors`_\n\nFeatures\n--------\n\n``fill_form``\n~~~~~~~~~~~~~\n\nFill a PDF with given data and returns the output PDF path\n\n-  ``pdf_path`` : input PDF\n-  ``datas`` : dictionnary of fielf names / values\n-  ``out_file`` (default=auto) : output PDF path. will use tempfile if\n   not provided\n-  ``flatten`` (default=True) : flatten the final PDF\n-  ``drop_xfa`` (default=False) : omit XFA data from the output PDF\n\n``concat``\n~~~~~~~~~~\n\nMerge multiple PDFs into one single file and returns the output PDF path\n\n-  ``files`` : list of PDF files to concatenate\n-  ``out_file`` (default=auto) : output PDF path. will use tempfile if\n   not provided\n\n``get_pages``\n~~~~~~~~~~~~~\n\nConcatenate a list of page ranges into one single file and returns the\noutput PDF path\n\n-  ``pdf_path`` : input PDF\n-  ``ranges`` (default=\\ ``[]``) : ``[]`` for clone, ``[[2]]`` for\n   extracting 2nd page, ``[[1],[2,5],[3]]`` for concatenating pages 1,\n   2-5, 3\n-  ``out_file`` (default=auto) : output PDF path. will use tempfile if\n   not provided\n\n``split``\n~~~~~~~~~\n\nSplit a single PDF in many pages and return a list of pages paths\n\n-  ``pdf_path`` : input PDF\n-  ``out_dir`` (default=auto) : output PDFs dir. will use tempfile if\n   not provided\n\n**warning** if you give a out_dir parameter, ensure its empty, or the\nsplit function may destroy your files and return incorrect results.\n\n``gen_xfdf``\n~~~~~~~~~~~~\n\nGenerate a XFDF file suited for filling PDF forms and return the\ngenerated XFDF file path\n\n-  ``datas`` : dictionnary of datas\n\n``get_num_pages``\n~~~~~~~~~~~~~~~~~\n\nReturn the number of pages for a given PDF\n\n-  ``pdf_path`` : input PDF file\n\n``replace_page``\n~~~~~~~~~~~~~~~~\n\nReplace a page in a PDF (pdf_path) by the PDF pointed by\npdf_to_insert_path.\n\n-  ``pdf_path`` is the PDF that will have its page replaced.\n-  ``page_number`` is the number of the page in pdf_path to be replaced.\n   It is 1-based.\n-  ``pdf_to_insert_path`` is the PDF that will be inserted at the old\n   page.\n\n``stamp``\n~~~~~~~~~\n\nApplies a stamp (from ``stamp_pdf_path``) to the PDF file in\n``pdf_path``. If no ``output_pdf_path`` is provided, it returns a\ntemporary file with the result PDF.\n\n``[compress | uncompress]``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n   These are only useful when you want to edit PDF code in a text\n   editor like vim or emacs.  Remove PDF page stream compression by\n   applying the uncompress filter. Use the compress filter to\n   restore compression.\n\n-  ``pdf_path`` : input PDF file\n-  ``out_file`` (default=auto) : output PDF path. will use tempfile if\n   not provided\n-  ``flatten`` (default=True) : flatten the final PDF\n\n``dump_data_fields``\n~~~~~~~~~~~~~~~~~~~~\n\nRead PDF and output form field statistics.\n\n-  ``pdf_path`` : input PDF file\n\n\nExample\n-------\n\nFill a PDF model and add a cover page :\n\n.. code:: python\n\n   import pypdftk\n\n   datas = {\n       'firstname': 'Julien',\n       'company': 'revolunet',\n       'price': 42\n   }\n   generated_pdf = pypdftk.fill_form('/path/to/model.pdf', datas)\n   out_pdf = pypdftk.concat(['/path/to/cover.pdf', generated_pdf])\n\npdftk path\n----------\n\nBy default, path is ``/usr/bin/pdftk``, but you can override it with the\n``PDFTK_PATH`` environment variable\n\nLicence\n-------\n\nThis module is released under the permissive `MIT license`_. Your\ncontributions are always welcome.\n\n.. _pdftk: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/\n.. _revolunet: http://revolunet.com\n.. _awesome contributors: https://github.com/revolunet/pypdftk/graphs/contributors\n.. _MIT license: http://revolunet.mit-license.org\n\n.. |pypi| image:: https://img.shields.io/pypi/v/pypdftk\n   :target: https://pypi.org/project/pypdftk/\n.. |travis| image:: https://travis-ci.org/yguarata/pypdftk.svg?branch=master\n   :target: https://travis-ci.org/yguarata/pypdftk\n.. |githubactions| image:: https://github.com/revolunet/pypdftk/actions/workflows/quality.yml/badge.svg\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevolunet%2Fpypdftk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevolunet%2Fpypdftk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevolunet%2Fpypdftk/lists"}