|
1 |
| -[](https://badge.fury.io/py/PyPDF2) |
2 |
| -[](https://pypi.org/project/PyPDF2/) |
3 |
| -[](https://pypdf2.readthedocs.io/en/stable/) |
4 |
| -[](https://github.com/py-pdf/PyPDF2) |
5 |
| -[](https://codecov.io/gh/py-pdf/PyPDF2) |
| 1 | +[](https://badge.fury.io/py/pypdf) |
| 2 | +[](https://pypi.org/project/pypdf/) |
| 3 | +[](https://pypdf.readthedocs.io/en/stable/) |
| 4 | +[](https://github.com/py-pdf/pypdf) |
| 5 | +[](https://codecov.io/gh/py-pdf/pypdf) |
6 | 6 |
|
7 |
| -# PyPDF2 |
| 7 | +# pypdf |
8 | 8 |
|
9 |
| -> **NOTE**: The PyPDF2 project is going back to its roots. PyPDF2==3.0.X will be |
10 |
| -> the last version of PyPDF2. Patches for this version will still be applied, but |
11 |
| -> development will continue with [`pypdf==3.0.0`](https://pypi.org/project/pyPdf/). |
12 |
| -
|
13 |
| -PyPDF2 is a free and open-source pure-python PDF library capable of splitting, |
14 |
| -[merging](https://pypdf2.readthedocs.io/en/stable/user/merging-pdfs.html), |
15 |
| -[cropping, and transforming](https://pypdf2.readthedocs.io/en/stable/user/cropping-and-transforming.html) |
| 9 | +pypdf is a free and open-source pure-python PDF library capable of splitting, |
| 10 | +[merging](https://pypdf.readthedocs.io/en/stable/user/merging-pdfs.html), |
| 11 | +[cropping, and transforming](https://pypdf.readthedocs.io/en/stable/user/cropping-and-transforming.html) |
16 | 12 | the pages of PDF files. It can also add
|
17 | 13 | custom data, viewing options, and
|
18 |
| -[passwords](https://pypdf2.readthedocs.io/en/stable/user/encryption-decryption.html) |
19 |
| -to PDF files. PyPDF2 can |
20 |
| -[retrieve text](https://pypdf2.readthedocs.io/en/stable/user/extract-text.html) |
| 14 | +[passwords](https://pypdf.readthedocs.io/en/stable/user/encryption-decryption.html) |
| 15 | +to PDF files. pypdf can |
| 16 | +[retrieve text](https://pypdf.readthedocs.io/en/stable/user/extract-text.html) |
21 | 17 | and
|
22 |
| -[metadata](https://pypdf2.readthedocs.io/en/stable/user/metadata.html) |
| 18 | +[metadata](https://pypdf.readthedocs.io/en/stable/user/metadata.html) |
23 | 19 | from PDFs as well.
|
24 | 20 |
|
25 | 21 |
|
26 | 22 | ## Installation
|
27 | 23 |
|
28 |
| -You can install PyPDF2 via pip: |
| 24 | +You can install pypdf via pip: |
29 | 25 |
|
30 | 26 | ```
|
31 |
| -pip install PyPDF2 |
| 27 | +pip install pypdf |
32 | 28 | ```
|
33 | 29 |
|
34 |
| -If you plan to use PyPDF2 for encrypting or decrypting PDFs that use AES, you |
| 30 | +If you plan to use pypdf for encrypting or decrypting PDFs that use AES, you |
35 | 31 | will need to install some extra dependencies. Encryption using RC4 is supported
|
36 | 32 | using the regular installation.
|
37 | 33 |
|
38 | 34 | ```
|
39 |
| -pip install PyPDF2[crypto] |
| 35 | +pip install pypdf[crypto] |
40 | 36 | ```
|
41 | 37 |
|
42 | 38 | ## Usage
|
43 | 39 |
|
44 | 40 | ```python
|
45 |
| -from PyPDF2 import PdfReader |
| 41 | +from pypdf import PdfReader |
46 | 42 |
|
47 | 43 | reader = PdfReader("example.pdf")
|
48 | 44 | number_of_pages = len(reader.pages)
|
49 | 45 | page = reader.pages[0]
|
50 | 46 | text = page.extract_text()
|
51 | 47 | ```
|
52 | 48 |
|
53 |
| -PyPDF2 can do a lot more, e.g. splitting, merging, reading and creating |
| 49 | +pypdf can do a lot more, e.g. splitting, merging, reading and creating |
54 | 50 | annotations, decrypting and encrypting, and more.
|
55 | 51 |
|
56 |
| -Please see [the documentation](https://pypdf2.readthedocs.io/en/stable/) |
| 52 | +Please see [the documentation](https://pypdf.readthedocs.io/en/stable/) |
57 | 53 | for more usage examples!
|
58 | 54 |
|
59 | 55 | A lot of questions are asked and answered
|
60 |
| -[on StackOverflow](https://stackoverflow.com/questions/tagged/pypdf2). |
| 56 | +[on StackOverflow](https://stackoverflow.com/questions/tagged/pypdf) |
| 57 | +(formerly tagged with [PyPDF2](https://stackoverflow.com/questions/tagged/pypdf2)). |
61 | 58 |
|
62 | 59 | ## Contributions
|
63 | 60 |
|
64 |
| -Maintaining PyPDF2 is a collaborative effort. You can support PyPDF2 by writing |
| 61 | +Maintaining pypdf is a collaborative effort. You can support pypdf by writing |
65 | 62 | documentation, helping to narrow down issues, and adding code.
|
66 | 63 |
|
67 | 64 | ### Q&A
|
68 | 65 |
|
69 |
| -The experience PyPDF2 users have covers the whole range from beginners who |
| 66 | +The experience pypdf users have covers the whole range from beginners who |
70 | 67 | want to make their live easier to experts who developed software before PDF
|
71 |
| -existed. You can contribute to the PyPDF2 community by answering questions |
72 |
| -on [StackOverflow](https://stackoverflow.com/questions/tagged/pypdf2), |
73 |
| -helping in [discussions](https://github.com/py-pdf/PyPDF2/discussions), |
| 68 | +existed. You can contribute to the pypdf community by answering questions |
| 69 | +on [StackOverflow](https://stackoverflow.com/questions/tagged/pypdf), |
| 70 | +helping in [discussions](https://github.com/py-pdf/pypdf/discussions), |
74 | 71 | and asking users who report issues for [MCVE](https://stackoverflow.com/help/minimal-reproducible-example)'s (Code + example PDF!).
|
75 | 72 |
|
76 | 73 |
|
77 | 74 | ### Issues
|
78 | 75 |
|
79 | 76 | A good bug ticket includes a MCVE - a minimal complete verifiable example.
|
80 |
| -For PyPDF2, this means that you must upload a PDF that causes the bug to occur |
| 77 | +For pypdf, this means that you must upload a PDF that causes the bug to occur |
81 | 78 | as well as the code you're executing with all of the output. Use
|
82 |
| -`print(PyPDF2.__version__)` to tell us which version you're using. |
| 79 | +`print(pypdf.__version__)` to tell us which version you're using. |
83 | 80 |
|
84 | 81 | ### Code
|
85 | 82 |
|
86 | 83 | All code contributions are welcome, but smaller ones have a better chance to
|
87 | 84 | get included in a timely manner. Adding unit tests for new features or test
|
88 | 85 | cases for bugs you've fixed help us to ensure that the Pull Request (PR) is fine.
|
89 | 86 |
|
90 |
| -PyPDF2 includes a test suite which can be executed with `pytest`: |
| 87 | +pypdf includes a test suite which can be executed with `pytest`: |
91 | 88 |
|
92 | 89 | ```bash
|
93 | 90 | $ pytest
|
94 | 91 | ===================== test session starts =====================
|
95 | 92 | platform linux -- Python 3.6.15, pytest-7.0.1, pluggy-1.0.0
|
96 |
| -rootdir: /home/moose/GitHub/Martin/PyPDF2 |
| 93 | +rootdir: /home/moose/GitHub/Martin/pypdf |
97 | 94 | plugins: cov-3.0.0
|
98 | 95 | collected 233 items
|
99 | 96 |
|
|
0 commit comments