Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: py-pdf/pypdf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.26.0
Choose a base ref
...
head repository: py-pdf/pypdf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.27.0
Choose a head ref
Loading
23 changes: 23 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[run]
source = PyPDF2
branch = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
@overload

# Don't complain about missing debug-only code:
def __repr__
def __str__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
36 changes: 36 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Unit Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/ci.txt
pip install .
- name: Test with flake8
run: |
flake8 . --ignore E,F,I,SIM,C,PT,N,ASS,A,P,R,W
- name: Test with pytest
run: |
pytest Tests/tests.py Tests --cov --cov-report term-missing -vv
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
*.pyc
*.swp
.DS_Store
.tox
build
.idea/*
.coverage
*.egg-info/
dist/*

# Files generated by some of the scripts
dont_commit_merged.pdf
PyPDF2-output.pdf
Image9.png
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# pre-commit run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-ast
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-added-large-files
args: ['--maxkb=1000']
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
args: ["--ignore", "E,W,F"]
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.942
# hooks:
# - id: mypy
# - repo: https://github.com/psf/black
# rev: 22.3.0
# hooks:
# - id: black
# - repo: https://github.com/asottile/pyupgrade
# rev: v2.31.1
# hooks:
# - id: pyupgrade
# args: [--py36-plus]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.1.0]
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
sudo: false

language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "pypy"
- "pypy3"

install:
- pip install tox-travis

script:
- tox

matrix:
fast_finish: true
72 changes: 56 additions & 16 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
Version 1.26.0, 2016-05-18
Version 1.27.0, 2022-04-07
--------------------------

Features:

- Add alpha channel support for png files in Script (#614)

Bug fixes (BUG):

- Fix formatWarning for filename without slash (#612)
- Add whitespace between words for extractText() (#569, #334)
- "invalid escape sequence" SyntaxError (#522)
- Avoid error when printing warning in pythonw (#486)
- Stream operations can be List or Dict (#665)

Documentation (DOC):

- Added Scripts/pdf-image-extractor.py
- Documentation improvements (#550, #538, #324, #426, #394)

Tests and Test setup (TST):

- Add Github Action which automatically run unit tests via pytest and
static code analysis with Flake8 (#660)
- Add several unit tests (#661, #663)
- Add .coveragerc to create coverage reports

Developer Experience Improvements (DEV):

- Pre commit: Developers can now `pre-commit install` to avoid tiny issues
like trailing whitespaces

Miscallenious:

- Add the LICENSE file to the distributed packages (#288)
- Use setuptools instead of distutils (#599)
- Improvements for the PyPI page (#644)
- Python 3 changes (#504, #366)

You can see the full changelog at: https://github.com/mstamy2/PyPDF2/compare/1.26.0...1.27.0

Version 1.26.0, 2016-05-18
--------------------------

- NOTE: Active maintenance on PyPDF2 is resuming after a hiatus
@@ -168,7 +209,7 @@ Version 1.23, 2014-08-11
- Annotations (links, comment windows, etc.) are now preserved when
pages are merged together

- Used the Destination class in addLink() and addBookmark() so that
- Used the Destination class in addLink() and addBookmark() so that
the page fit option could be properly customized


@@ -188,7 +229,7 @@ Version 1.22, 2014-05-29
- Fixed bug where an exception was thrown upon reading a NULL string
(by speedplane)

- Allow string literals (non-unicode strings in Python 2) to be passed
- Allow string literals (non-unicode strings in Python 2) to be passed
to PdfFileReader

- Allow ConvertFunctionsToVirtualList to be indexed with slices and
@@ -199,7 +240,7 @@ Version 1.22, 2014-05-29

- General code clean-up and improvements (with Steve Witham and Henry Keiter)

- Fixed bug that caused crash when comments are present at end of
- Fixed bug that caused crash when comments are present at end of
dictionary


@@ -318,7 +359,7 @@ OTHER:
UPCOMING:
- More bugfixes (We have received many problematic PDFs via email, we
will work with them)

- Documentation - It's time for PyPDF2 to get its own documentation
since it has grown much since the original pyPdf

@@ -328,11 +369,11 @@ UPCOMING:
Version 1.18, 2013-08-19
------------------------

- Fixed a bug where older verions of objects were incorrectly added to the
- Fixed a bug where older verions of objects were incorrectly added to the
cache, resulting in outdated or missing pages, images, and other objects
(from speedplane)

- Fixed a bug in parsing the xref table where new xref values were
- Fixed a bug in parsing the xref table where new xref values were
overwritten; also cleaned up code (from speedplane)

- New method mergeRotatedAroundPointPage which merges a page while rotating
@@ -355,8 +396,8 @@ Other Changes:
Version 1.17, 2013-07-25
------------------------

- Removed one (from pdf.py) of the two Destination classes. Both
classes had the same name, but were slightly different in content,
- Removed one (from pdf.py) of the two Destination classes. Both
classes had the same name, but were slightly different in content,
causing some errors. (from Janne Vanhala)

- Corrected and Expanded README file to demonstrate PdfFileMerger
@@ -373,9 +414,9 @@ Versions -1.16, -2013-06-30
- Note: This ChangeLog has not been kept up-to-date for a while.
Hopefully we can keep better track of it from now on. Some of the
changes listed here come from previous versions 1.14 and 1.15; they
were only vaguely defined. With the new _version.py file we should
were only vaguely defined. With the new _version.py file we should
have more structured and better documented versioning from now on.

- Defined PyPDF2.__version__

- Fixed encrypt() method (from Martijn The)
@@ -388,14 +429,14 @@ Versions -1.16, -2013-06-30

- Fixed an bug caused by DecimalError Exception (from Adam Morris)

- Many other bug fixes and features by:
- Many other bug fixes and features by:

jeansch
Anton Vlasenko
Joseph Walton
Jan Oliver Oelerich
Fabian Henze
And any others I missed.
And any others I missed.
Thanks for contributing!


@@ -535,7 +576,7 @@ Version 1.6, 2006-06-06
stream filters more easily, including compressed streams.

- Add a graphics state push/pop around page merges. Improves quality of
page merges when one page's content stream leaves the graphics
page merges when one page's content stream leaves the graphics
in an abnormal state.

- Add PageObject.compressContentStreams function, which filters all content
@@ -628,4 +669,3 @@ Version 1.0, 2006-01-17

- Does not support some PDF 1.5 features, such as object streams,
cross-reference streams.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include CHANGELOG
include LICENSE
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
maint:
pre-commit autoupdate
pip-compile -U requirements/ci.in
pip-compile -U requirements/dev.in

upload:
make clean
python setup.py sdist bdist_wheel && twine upload -s dist/*

clean:
python setup.py clean --all
pyclean .

test:
pytest Tests/tests.py Tests --cov --cov-report term-missing -vv --cov-report html
Binary file added PDF_Samples/GeoBase_NHNC1_Data_Model_UML_EN.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions PDF_Samples/README.txt
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ we won't add PDFs without expressed permission.
(This folder is available through GitHub only)


Feel free to add any type of PDF file or sample code,
Feel free to add any type of PDF file or sample code,
either by

1) sending it via email to PyPDF2@phaseit.net
2) including it in a pull request on GitHub
2) including it in a pull request on GitHub
Binary file added PDF_Samples/Seige_of_Vicksburg_Sample_OCR.pdf
Binary file not shown.
Binary file added PDF_Samples/jpeg.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion PyPDF2/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.26.0'
__version__ = '1.27.0'
Loading