{"name":"pypdf: A Powerful Pure-Python Library for PDF Manipulation","description":"pypdf is a free and open-source pure-Python library designed for comprehensive PDF manipulation. It allows users to split, merge, crop, and transform PDF pages, as well as add custom data, viewing options, and passwords. The library also supports extracting text and metadata from PDF files, making it a versatile tool for various PDF-related tasks.","github":"https://github.com/py-pdf/pypdf","url":"https://osrepos.com/repo/py-pdf-pypdf","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/py-pdf-pypdf","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/py-pdf-pypdf.md","json":"https://osrepos.com/repo/py-pdf-pypdf.json","topics":["Python","PDF","PDF Manipulation","PDF Parsing","Document Automation","pypdf","Library"],"keywords":["Python","PDF","PDF Manipulation","PDF Parsing","Document Automation","pypdf","Library"],"stars":null,"summary":"pypdf is a free and open-source pure-Python library designed for comprehensive PDF manipulation. It allows users to split, merge, crop, and transform PDF pages, as well as add custom data, viewing options, and passwords. The library also supports extracting text and metadata from PDF files, making it a versatile tool for various PDF-related tasks.","content":"## Introduction\n\npypdf is a robust, pure-Python PDF library that empowers developers to interact with PDF files programmatically. It offers a wide array of functionalities, including splitting, merging, cropping, and transforming pages. Beyond basic manipulation, pypdf can also add custom data, set viewing options, and apply password protection to your PDF documents. Furthermore, it provides capabilities to extract text and metadata, making it an essential tool for automating PDF workflows.\n\n## Installation\n\nGetting started with pypdf is straightforward using pip.\n\nbash\npip install pypdf\n\n\nFor advanced features like AES encryption or decryption, you can install additional dependencies:\n\nbash\npip install pypdf[crypto]\n\n\nNote that `pypdf` versions 3.1.0 and above include significant improvements. Please refer to the official [migration guide](https://pypdf.readthedocs.io/en/latest/user/migration-1-to-2.html){:target=\"_blank\"} for more details.\n\n## Examples\n\nHere's a quick example demonstrating how to read a PDF and extract text from its first page:\n\npython\nfrom pypdf import PdfReader\n\nreader = PdfReader(\"example.pdf\")\nnumber_of_pages = len(reader.pages)\npage = reader.pages[0]\ntext = page.extract_text()\nprint(f\"Number of pages: {number_of_pages}\")\nprint(f\"Text from first page: {text[:200]}...\") # Print first 200 chars\n\n\npypdf supports many other operations, such as splitting, merging, reading and creating annotations, and encryption/decryption. Check out the [documentation](https://pypdf.readthedocs.io/en/stable/){:target=\"_blank\"} for additional usage examples!\n\n## Why Use pypdf\n\npypdf stands out as a comprehensive solution for PDF handling in Python due to several key advantages. Its pure-Python implementation ensures broad compatibility and ease of integration into Python projects without external binaries. The library's extensive feature set covers everything from basic page manipulation to advanced tasks like metadata extraction and security. With an active development team and a supportive community, pypdf is continuously improved and well-maintained, offering reliable performance for your PDF processing needs.\n\n## Links\n\nFor more information and to dive deeper into pypdf:\n\n*   **GitHub Repository:** [https://github.com/py-pdf/pypdf](https://github.com/py-pdf/pypdf){:target=\"_blank\"}\n*   **Official Documentation:** [https://pypdf.readthedocs.io/en/stable/](https://pypdf.readthedocs.io/en/stable/){:target=\"_blank\"}\n*   **StackOverflow (Q&A):** [https://stackoverflow.com/questions/tagged/pypdf](https://stackoverflow.com/questions/tagged/pypdf){:target=\"_blank\"}","metrics":{"detailViews":4,"githubClicks":5},"dates":{"published":null,"modified":"2025-12-24T12:00:56.000Z"}}