Commit Graph

15 Commits

Author SHA1 Message Date
Jeremy Singer-Vine c915a00d09 Merge pull request #520 from jsvine/core/undecimalize
Remove decimalizing (but let CLI adjust precision)
2021-11-02 23:03:02 -04:00
Jeremy Singer-Vine 87b947f8f6 Remove decimalizing (but let CLI adjust precision)
Per discussion at https://github.com/jsvine/pdfplumber/discussions/346
and input from @ramcdona, this commit changes pdfplumber's behavior
regarding floating point numbers. Specifically, it removes all
conversion of floats to Decimal objects. This brings several advantages:

- Increased precision (where applicable)
- Decreased code complexity
- Increased performance (~10% speedup on test suite)
- Increased fidelity to `pdfminer.six` output

These seem to outweigh the disadvantages:

- Some tests break (but have been easily fixed) due to increased
  precision and/or floating point arithmetic artifacts
- Some users' scripts may also break, if they depend on strict equality
  testing, though these *should* also be easily fixable

Because some form of automatic rounding may still be desirable for the
pdfplumber CLI utility, the conversion methods (.to_csv, .to_json) have
been adjusted to accept a `precision` argument.
2021-10-19 21:51:33 -04:00
Jeremy Singer-Vine df98f9cf44 Handle utf-16-encoded annotations (#463)
Thanks to @tungph for the fix proposal.
2021-10-15 09:34:39 -04:00
Jeremy Singer-Vine 4b61c38d3c Upgrade pdfminer.six from 20200517 to 20211012
See pdfminer.six's changelog for details:
https://github.com/pdfminer/pdfminer.six/blob/develop/CHANGELOG.md

... but a key difference is an improvement in how it assigns `line`,
`rect`, and `curve` objects. (Diagonal two-point lines, for instance,
are now `line` objects instead of `curve` objects.)

As a result, this commit also adjusts some of the tests, where the
pre-20211012 versions had been incorrectly assigning lines as `LTCurve`
objects.
2021-10-15 08:53:39 -04:00
Alexander Regueiro cbfb60640a Added test for issue #381 2021-03-19 18:48:25 +00:00
Jeremy Singer-Vine b4b0282730 Make tests flake8-compatible 2020-12-16 22:29:51 -05:00
Jeremy Singer-Vine 5c62be2e16 Format all tests with psf/black 2020-12-16 22:19:17 -05:00
Samkit Jain 4ccf8cff67 Resolve lint issues and remove unused imports 2020-11-29 16:29:14 +05:30
Samkit Jain 2d9415cdd0 Recursively parse metadata values to handle nested PDFObjRef objects
Fixes #316
2020-11-29 15:41:01 +05:30
Samkit Jain 9f0a1ad7cd Treat invalid/unparseable metadata values as warnings
Certain invalid values if parseable don't throw a warning and only unparseable (always invalid) throw
2020-11-26 21:58:49 +05:30
Samkit Jain 3030765036 Add test for issue #297
h/t @prgx-csmith01 for providing the PDF
2020-10-30 12:47:27 +05:30
Jeremy Singer-Vine 917467a10c Remove test_issues.py:test_pr_77 to speed up tests
The test, responding to PR #77, was particularly slow and the
accompanying PDF somewhat large. Now that the fixes to the issues
identified in the PR are fairly tightly integrated into pdfplumber, we
can remove the tests with reasonable confidence, speeding up development
time.
2020-08-29 13:31:42 -04:00
Jeremy Singer-Vine a5e7d7fa52 Remove pandas from dev requirements and tests
Results in needing one more # pragma: nocover statement, but on a
simple line of code. See PR #253 for details and motivation.
2020-08-15 12:03:34 -04:00
Jeremy Singer-Vine 00e789bf42 Shift to making pdfplumber.open the sole loader
- .from_path is now removed
- .load is marked as deprecated, to be removed in 0.6.0
2020-07-26 15:27:51 -04:00
Jeremy Singer-Vine 1ac16dd369 Change testing framework from nosetests to pytest 2020-07-25 08:45:17 -04:00