Skip to content

Commit 3825c7b

Browse files
authored
MAINT: Move PyPDF2 to pypdf (py-pdf#1513)
All lowercase, no number. See py-pdf#1488
1 parent 3214dde commit 3825c7b

File tree

105 files changed

+515
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+515
-503
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Which environment were you using when you encountered the problem?
1717
$ python -m platform
1818
# TODO: Your output goes here
1919

20-
$ python -c "import PyPDF2;print(PyPDF2.__version__)"
20+
$ python -c "import pypdf;print(pypdf.__version__)"
2121
# TODO: Your output goes here
2222
```
2323

.github/ISSUE_TEMPLATE/feature-request.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Request a Feature
3-
about: What do you think is missing in PyPDF2?
3+
about: What do you think is missing in pypdf?
44
title: ''
55
labels: Feature Request
66
assignees: MartinThoma
@@ -16,7 +16,7 @@ Explain briefly what you want to achive.
1616
How would your feature be used? (Remove this if it is not applicable.)
1717

1818
```python
19-
from PyPDF2 import PdfReader, PdfWriter
19+
from pypdf import PdfReader, PdfWriter
2020

2121
... # your new feature in action!
2222
```

.github/SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you find a potential security issue, please report it to info@martin-thoma.de
1111

1212
We will try to find a fix in a timely manner and will then issue a security
1313
advisory together with the update via GitHub
14-
([example](https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79)).
14+
([example](https://github.com/py-pdf/pypdf/security/advisories/GHSA-xcjx-m2pj-8g79)).
1515

1616
If you don't get a reaction within 30 days, please open a public issue on
1717
GitHub.

.github/workflows/benchmark.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Benchmarking PyPDF2
1+
name: Benchmarking pypdf
22
on:
33
push:
44
branches:
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install requirements (Python 3)
2828
run: |
2929
pip install -r requirements/ci.txt
30-
- name: Install PyPDF2
30+
- name: Install pypdf
3131
run: |
3232
pip install .
3333
- name: Run benchmark

.github/workflows/github-ci.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: |
6767
pip uninstall pycryptodome -y
6868
if: matrix.use-cryptodome == 'false'
69-
- name: Install PyPDF2
69+
- name: Install pypdf
7070
run: |
7171
pip install .
7272
- name: Test with flake8
@@ -77,7 +77,7 @@ jobs:
7777
python -m coverage run --parallel-mode -m pytest tests -vv
7878
- name: Test with mypy
7979
run : |
80-
mypy PyPDF2 --show-error-codes --disallow-untyped-defs --disallow-incomplete-defs
80+
mypy pypdf --show-error-codes --disallow-untyped-defs --disallow-incomplete-defs
8181
- name: Upload coverage data
8282
uses: actions/upload-artifact@v3
8383
with:
@@ -105,7 +105,7 @@ jobs:
105105

106106
- name: Test running installed package
107107
working-directory: /tmp
108-
run: python -c "import PyPDF2;print(PyPDF2.__version__)"
108+
run: python -c "import pypdf;print(pypdf.__version__)"
109109

110110
# - name: Release to pypi if tagged.
111111
# if: startsWith(github.ref, 'refs/tags')

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ docs/_build/
2828

2929
# Files generated by some of the scripts
3030
dont_commit_*.pdf
31-
PyPDF2-output.pdf
31+
pypdf-output.pdf
3232
annotated-pdf-link.pdf
3333
Image9.png
34-
PyPDF2_pdfLocation.txt
34+
pypdf_pdfLocation.txt
3535

3636
.python-version
3737
tests/pdf_cache/

CONTRIBUTORS.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Contributors
22

3-
PyPDF2 had a lot of contributors since it started with pyPdf in 2005. We are
3+
pypdf had a lot of contributors since it started with pyPdf in 2005. We are
44
a free software project without any company affiliation. We cannot pay
55
contributors, but we do value their contributions. A lot of time, effort, and
66
expertise went into this project. With this list, we recognize those awesome
77
people 🤗
88

99
The list is definitely not complete. You can find more contributors via the git
10-
history and [GitHubs 'Contributors' feature](https://github.com/py-pdf/PyPDF2/graphs/contributors).
10+
history and [GitHubs 'Contributors' feature](https://github.com/py-pdf/pypdf/graphs/contributors).
1111

12-
## Contributors to the pyPdf / PyPDF2 project
12+
## Contributors to the pypdf (formerly pyPdf / PyPDF2) project
1313

1414
* [DL6ER](https://github.com/DL6ER)
1515
* [ediamondscience](https://github.com/ediamondscience)
@@ -27,7 +27,7 @@ history and [GitHubs 'Contributors' feature](https://github.com/py-pdf/PyPDF2/gr
2727
* [Rogmann, Sascha](https://github.com/srogmann)
2828
* [sietzeberends](https://github.com/sietzeberends)
2929
* [Stüber, Timo](https://github.com/omit66)
30-
* [Thoma, Martin](https://github.com/MartinThoma): Maintainer of PyPDF2 since April 2022. I hope to build a great community with many awesome contributors. [LinkedIn](https://www.linkedin.com/in/martin-thoma/) | [StackOverflow](https://stackoverflow.com/users/562769/martin-thoma) | [Blog](https://martin-thoma.com/)
30+
* [Thoma, Martin](https://github.com/MartinThoma): Maintainer of pypdf since April 2022. I hope to build a great community with many awesome contributors. [LinkedIn](https://www.linkedin.com/in/martin-thoma/) | [StackOverflow](https://stackoverflow.com/users/562769/martin-thoma) | [Blog](https://martin-thoma.com/)
3131
* [WevertonGomes](https://github.com/WevertonGomesCosta)
3232
* ztravis
3333

@@ -40,10 +40,10 @@ Contributors are:
4040
(1) Bugs: with complete MCVE
4141
(2) Well-described feature requests
4242
(3) Potentially some more.
43-
The maintainers of PyPDF2 have the last call on that one.
44-
* Community work: This is exceptional. If the maintainers of PyPDF2 see people
43+
The maintainers of pypdf have the last call on that one.
44+
* Community work: This is exceptional. If the maintainers of pypdf see people
4545
being super helpful in answering issues / discussions or being very active on
46-
Stackoverflow, we also consider them being contributors to PyPDF2.
46+
Stackoverflow, we also consider them being contributors to pypdf.
4747

4848
Contributors can add themselves or ask via an Github Issue to be added.
4949

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ upload:
1616

1717
clean:
1818
pyclean .
19-
rm -rf tests/__pycache__ PyPDF2/__pycache__ Image9.png htmlcov docs/_build dist dont_commit_merged.pdf dont_commit_writer.pdf PyPDF2.egg-info PyPDF2_pdfLocation.txt .pytest_cache .mypy_cache .benchmarks
19+
rm -rf tests/__pycache__ pypdf/__pycache__ Image9.png htmlcov docs/_build dist dont_commit_merged.pdf dont_commit_writer.pdf pypdf.egg-info pypdf_pdfLocation.txt .pytest_cache .mypy_cache .benchmarks
2020

2121
test:
22-
pytest tests --cov --cov-report term-missing -vv --cov-report html --durations=3 --timeout=60 PyPDF2
22+
pytest tests --cov --cov-report term-missing -vv --cov-report html --durations=3 --timeout=60 pypdf
2323

2424
testtype:
25-
pytest tests --cov --cov-report term-missing -vv --cov-report html --durations=3 --timeout=30 --typeguard-packages=PyPDF2
25+
pytest tests --cov --cov-report term-missing -vv --cov-report html --durations=3 --timeout=30 --typeguard-packages=pypdf
2626

2727
mutation-test:
2828
mutmut run
@@ -35,7 +35,7 @@ benchmark:
3535
pytest tests/bench.py
3636

3737
mypy:
38-
mypy PyPDF2 --ignore-missing-imports --check-untyped --strict
38+
mypy pypdf --ignore-missing-imports --check-untyped --strict
3939

4040
pylint:
41-
pylint PyPDF2
41+
pylint pypdf

README.md

+31-34
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,96 @@
1-
[![PyPI version](https://badge.fury.io/py/PyPDF2.svg)](https://badge.fury.io/py/PyPDF2)
2-
[![Python Support](https://img.shields.io/pypi/pyversions/PyPDF2.svg)](https://pypi.org/project/PyPDF2/)
3-
[![](https://img.shields.io/badge/-documentation-green)](https://pypdf2.readthedocs.io/en/stable/)
4-
[![GitHub last commit](https://img.shields.io/github/last-commit/py-pdf/PyPDF2)](https://github.com/py-pdf/PyPDF2)
5-
[![codecov](https://codecov.io/gh/py-pdf/PyPDF2/branch/main/graph/badge.svg?token=id42cGNZ5Z)](https://codecov.io/gh/py-pdf/PyPDF2)
1+
[![PyPI version](https://badge.fury.io/py/pypdf.svg)](https://badge.fury.io/py/pypdf)
2+
[![Python Support](https://img.shields.io/pypi/pyversions/pypdf.svg)](https://pypi.org/project/pypdf/)
3+
[![](https://img.shields.io/badge/-documentation-green)](https://pypdf.readthedocs.io/en/stable/)
4+
[![GitHub last commit](https://img.shields.io/github/last-commit/py-pdf/pypdf)](https://github.com/py-pdf/pypdf)
5+
[![codecov](https://codecov.io/gh/py-pdf/pypdf/branch/main/graph/badge.svg?token=id42cGNZ5Z)](https://codecov.io/gh/py-pdf/pypdf)
66

7-
# PyPDF2
7+
# pypdf
88

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)
1612
the pages of PDF files. It can also add
1713
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)
2117
and
22-
[metadata](https://pypdf2.readthedocs.io/en/stable/user/metadata.html)
18+
[metadata](https://pypdf.readthedocs.io/en/stable/user/metadata.html)
2319
from PDFs as well.
2420

2521

2622
## Installation
2723

28-
You can install PyPDF2 via pip:
24+
You can install pypdf via pip:
2925

3026
```
31-
pip install PyPDF2
27+
pip install pypdf
3228
```
3329

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
3531
will need to install some extra dependencies. Encryption using RC4 is supported
3632
using the regular installation.
3733

3834
```
39-
pip install PyPDF2[crypto]
35+
pip install pypdf[crypto]
4036
```
4137

4238
## Usage
4339

4440
```python
45-
from PyPDF2 import PdfReader
41+
from pypdf import PdfReader
4642

4743
reader = PdfReader("example.pdf")
4844
number_of_pages = len(reader.pages)
4945
page = reader.pages[0]
5046
text = page.extract_text()
5147
```
5248

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
5450
annotations, decrypting and encrypting, and more.
5551

56-
Please see [the documentation](https://pypdf2.readthedocs.io/en/stable/)
52+
Please see [the documentation](https://pypdf.readthedocs.io/en/stable/)
5753
for more usage examples!
5854

5955
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)).
6158

6259
## Contributions
6360

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
6562
documentation, helping to narrow down issues, and adding code.
6663

6764
### Q&A
6865

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
7067
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),
7471
and asking users who report issues for [MCVE](https://stackoverflow.com/help/minimal-reproducible-example)'s (Code + example PDF!).
7572

7673

7774
### Issues
7875

7976
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
8178
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.
8380

8481
### Code
8582

8683
All code contributions are welcome, but smaller ones have a better chance to
8784
get included in a timely manner. Adding unit tests for new features or test
8885
cases for bugs you've fixed help us to ensure that the Pull Request (PR) is fine.
8986

90-
PyPDF2 includes a test suite which can be executed with `pytest`:
87+
pypdf includes a test suite which can be executed with `pytest`:
9188

9289
```bash
9390
$ pytest
9491
===================== test session starts =====================
9592
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
9794
plugins: cov-3.0.0
9895
collected 233 items
9996

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# -- Project information -----------------------------------------------------
2323

24-
project = "PyPDF2"
24+
project = "pypdf"
2525
copyright = "2006 - 2008, Mathieu Fenniak"
2626
author = "Mathieu Fenniak"
2727

docs/dev/deprecations.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The Deprecation Process
22

3-
PyPDF2 strives to be an excellent library for its current users and for new
3+
pypdf strives to be an excellent library for its current users and for new
44
ones. We are careful with introducing potentially breaking changes, but we
55
will do them if they provide value for the community on the long run.
66

@@ -9,7 +9,7 @@ users can rely on the following procedure.
99

1010
## Semantic Versioning
1111

12-
PyPDF2 uses [semantic versioning](https://semver.org/). If you want to avoid
12+
pypdf uses [semantic versioning](https://semver.org/). If you want to avoid
1313
breaking changes, please use dependency pinning (also known as version pinning).
1414
In Python, this is done by specifying the exact version you want to use in a
1515
`requirements.txt` file. A tool that can support you is `pip-compile` from
@@ -18,9 +18,9 @@ In Python, this is done by specifying the exact version you want to use in a
1818
If you are using [Poetry](https://pypi.org/project/poetry/) it is done with the
1919
`poetry.lock` file.
2020

21-
## How PyPDF2 deprecates features
21+
## How pypdf deprecates features
2222

23-
Assume the current version of PyPDF2 is `x.y.z`. After a discussion (e.g. via
23+
Assume the current version of pypdf is `x.y.z`. After a discussion (e.g. via
2424
GitHub issues) we decided to remove a class / function / method. This is how
2525
we do it:
2626

docs/dev/intro.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Developer Intro
22

3-
PyPDF2 is a library and hence its users are developers. This document is not for
4-
the users, but for people who want to work on PyPDF2 itself.
3+
pypdf is a library and hence its users are developers. This document is not for
4+
the users, but for people who want to work on pypdf itself.
55

66
## Installing Requirements
77

@@ -11,11 +11,11 @@ pip install -r requirements/dev.txt
1111

1212
## Running Tests
1313

14-
See [testing PyPDF2 with pytest](testing.md)
14+
See [testing pypdf with pytest](testing.md)
1515

1616
## The sample-files git submodule
1717
The reason for having the submodule `sample-files` is that we want to keep
18-
the size of the PyPDF2 repository small while we also want to have an extensive
18+
the size of the pypdf repository small while we also want to have an extensive
1919
test suite. Those two goals contradict each other.
2020

2121
The `resources` folder should contain a select set of core examples that cover
@@ -34,21 +34,21 @@ git submodule update --init
3434
Git is a command line application for version control. If you don't know it,
3535
you can [play ohmygit](https://ohmygit.org/) to learn it.
3636

37-
GitHub is the service where the PyPDF2 project is hosted. While git is free and
37+
GitHub is the service where the pypdf project is hosted. While git is free and
3838
open source, GitHub is a paid service by Microsoft - but for free in lot of
3939
cases.
4040

4141
[pre-commit](https://pypi.org/project/pre-commit/) is a command line application
4242
that uses git hooks to automatically execute code. This allows you to avoid
4343
style issues and other code quality issues. After you entered `pre-commit install`
44-
once in your local copy of PyPDF2, it will automatically be executed when
44+
once in your local copy of pypdf, it will automatically be executed when
4545
you `git commit`.
4646

4747
## Commit Messages
4848

4949
Having a clean commit message helps people to quickly understand what the commit
5050
was about, without actually looking at the changes. The first line of the
51-
commit message is used to [auto-generate the CHANGELOG](https://github.com/py-pdf/PyPDF2/blob/main/make_changelog.py). For this reason, the format should be:
51+
commit message is used to [auto-generate the CHANGELOG](https://github.com/py-pdf/pypdf/blob/main/make_changelog.py). For this reason, the format should be:
5252

5353
```
5454
PREFIX: DESCRIPTION
@@ -66,18 +66,18 @@ The `PREFIX` can be:
6666
* `DEP`: A deprecation - either marking something as "this is going to be removed"
6767
or actually removing it.
6868
* `PI`: A performance improvement. This could also be a reduction in the
69-
file size of PDF files generated by PyPDF2.
69+
file size of PDF files generated by pypdf.
7070
* `ROB`: A robustness change. Dealing better with broken PDF files.
7171
* `DOC`: A documentation change.
7272
* `TST`: Adding / adjusting tests.
7373
* `DEV`: Developer experience improvements - e.g. pre-commit or setting up CI
7474
* `MAINT`: Quite a lot of different stuff. Performance improvements are for sure
7575
the most interesting changes in here. Refactorings as well.
76-
* `STY`: A style change. Something that makes PyPDF2 code more consistent.
76+
* `STY`: A style change. Something that makes pypdf code more consistent.
7777
Typically a small change.
7878

7979
## Benchmarks
8080

8181
We need to keep an eye on performance and thus we have a few benchmarks.
8282

83-
See [py-pdf.github.io/PyPDF2/dev/bench](https://py-pdf.github.io/PyPDF2/dev/bench/)
83+
See [py-pdf.github.io/pypdf/dev/bench](https://py-pdf.github.io/PyPDF2/dev/bench/)

0 commit comments

Comments
 (0)