PyPDFForm 1.4.27__py3-none-any.whl → 1.4.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of PyPDFForm might be problematic. Click here for more details.
- PyPDFForm/__init__.py +2 -2
- PyPDFForm/filler.py +0 -1
- PyPDFForm/wrapper.py +1 -51
- {PyPDFForm-1.4.27.dist-info → PyPDFForm-1.4.28.dist-info}/METADATA +1 -17
- {PyPDFForm-1.4.27.dist-info → PyPDFForm-1.4.28.dist-info}/RECORD +8 -8
- {PyPDFForm-1.4.27.dist-info → PyPDFForm-1.4.28.dist-info}/LICENSE +0 -0
- {PyPDFForm-1.4.27.dist-info → PyPDFForm-1.4.28.dist-info}/WHEEL +0 -0
- {PyPDFForm-1.4.27.dist-info → PyPDFForm-1.4.28.dist-info}/top_level.txt +0 -0
PyPDFForm/__init__.py
CHANGED
PyPDFForm/filler.py
CHANGED
PyPDFForm/wrapper.py
CHANGED
|
@@ -5,12 +5,10 @@ from __future__ import annotations
|
|
|
5
5
|
|
|
6
6
|
from functools import cached_property
|
|
7
7
|
from typing import BinaryIO, Dict, List, Tuple, Union
|
|
8
|
-
from warnings import warn
|
|
9
8
|
|
|
10
9
|
from .adapter import fp_or_f_obj_or_stream_to_stream
|
|
11
10
|
from .constants import (DEFAULT_FONT, DEFAULT_FONT_COLOR, DEFAULT_FONT_SIZE,
|
|
12
|
-
|
|
13
|
-
VERSION_IDENTIFIERS)
|
|
11
|
+
VERSION_IDENTIFIER_PREFIX, VERSION_IDENTIFIERS)
|
|
14
12
|
from .coordinate import generate_coordinate_grid
|
|
15
13
|
from .filler import fill, simple_fill
|
|
16
14
|
from .font import register_font
|
|
@@ -90,21 +88,6 @@ class PdfWrapper(FormWrapper):
|
|
|
90
88
|
each.font_size = self.global_font_size
|
|
91
89
|
each.font_color = self.global_font_color
|
|
92
90
|
|
|
93
|
-
@property
|
|
94
|
-
def elements(self) -> dict:
|
|
95
|
-
"""ToDo: deprecate this."""
|
|
96
|
-
|
|
97
|
-
warn(
|
|
98
|
-
DEPRECATION_NOTICE.format(
|
|
99
|
-
f"{self.__class__.__name__}.elements",
|
|
100
|
-
f"{self.__class__.__name__}.widgets",
|
|
101
|
-
),
|
|
102
|
-
DeprecationWarning,
|
|
103
|
-
stacklevel=2,
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
return self.widgets
|
|
107
|
-
|
|
108
91
|
@property
|
|
109
92
|
def sample_data(self) -> dict:
|
|
110
93
|
"""Returns a valid sample data that can be filled into the PDF form."""
|
|
@@ -314,20 +297,6 @@ class PdfWrapper(FormWrapper):
|
|
|
314
297
|
|
|
315
298
|
return result
|
|
316
299
|
|
|
317
|
-
def generate_schema(self) -> dict:
|
|
318
|
-
"""ToDo: deprecate this."""
|
|
319
|
-
|
|
320
|
-
warn(
|
|
321
|
-
DEPRECATION_NOTICE.format(
|
|
322
|
-
f"{self.__class__.__name__}.generate_schema()",
|
|
323
|
-
f"{self.__class__.__name__}.schema",
|
|
324
|
-
),
|
|
325
|
-
DeprecationWarning,
|
|
326
|
-
stacklevel=2,
|
|
327
|
-
)
|
|
328
|
-
|
|
329
|
-
return self.schema
|
|
330
|
-
|
|
331
300
|
@classmethod
|
|
332
301
|
def register_font(
|
|
333
302
|
cls, font_name: str, ttf_file: Union[bytes, str, BinaryIO]
|
|
@@ -337,22 +306,3 @@ class PdfWrapper(FormWrapper):
|
|
|
337
306
|
ttf_file = fp_or_f_obj_or_stream_to_stream(ttf_file)
|
|
338
307
|
|
|
339
308
|
return register_font(font_name, ttf_file) if ttf_file is not None else False
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
class PyPDFForm(PdfWrapper):
|
|
343
|
-
"""ToDo: deprecate this."""
|
|
344
|
-
|
|
345
|
-
def __init__(
|
|
346
|
-
self,
|
|
347
|
-
template: Union[bytes, str, BinaryIO] = b"",
|
|
348
|
-
**kwargs,
|
|
349
|
-
):
|
|
350
|
-
"""Only extra thing is the deprecation notice."""
|
|
351
|
-
|
|
352
|
-
warn(
|
|
353
|
-
DEPRECATION_NOTICE.format("PyPDFForm.PyPDFForm", "PyPDFForm.PdfWrapper"),
|
|
354
|
-
DeprecationWarning,
|
|
355
|
-
stacklevel=2,
|
|
356
|
-
)
|
|
357
|
-
|
|
358
|
-
super().__init__(template, **kwargs)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyPDFForm
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.28
|
|
4
4
|
Summary: The Python library for PDF forms.
|
|
5
5
|
Home-page: https://github.com/chinapandaman/PyPDFForm
|
|
6
6
|
Author: Jinge Li
|
|
@@ -34,22 +34,6 @@ Requires-Dist: reportlab
|
|
|
34
34
|
<a href="https://pypistats.org/packages/pypdfform"><img src="https://img.shields.io/pypi/dm/pypdfform?logo=pypi&logoColor=white&label=downloads&labelColor=black&color=blue&style=for-the-badge"></a>
|
|
35
35
|
</p>
|
|
36
36
|
|
|
37
|
-
## Important API Changes
|
|
38
|
-
|
|
39
|
-
Happy new year fellow developers! We start the year 2024 with a new release of v1.4.0 and
|
|
40
|
-
there are some important changes I'm making to the APIs of the library.
|
|
41
|
-
|
|
42
|
-
* The PDF object that gets instantiated is now `PyPDFForm.PdfWrapper`, changed from `PyPDFForm.PyPDFForm`.
|
|
43
|
-
* Form widgets are now accessed via the `PdfWrapper.widgets` attribute, changed from `PdfWrapper.elements`.
|
|
44
|
-
* The JSON schema of the form data is now accessed via a new attribute called `PdfWrapper.schema`,
|
|
45
|
-
changed from the old method of `PdfWrapper.generate_schema()`.
|
|
46
|
-
|
|
47
|
-
All the old APIs will be persisted for half a year and then fully deprecated. Each of them
|
|
48
|
-
will emit a `DeprecationWarning` when invoked, so it is advised that you make the switch before they are
|
|
49
|
-
removed and start breaking your code.
|
|
50
|
-
|
|
51
|
-
Happy hacking!
|
|
52
|
-
|
|
53
37
|
## Introduction
|
|
54
38
|
|
|
55
39
|
PyPDFForm is a free and open source pure-Python 3 library for PDF form processing. It contains the essential
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
PyPDFForm/__init__.py,sha256=
|
|
1
|
+
PyPDFForm/__init__.py,sha256=H6MRHsCVm10TtfWclcdHhQBIu6mEnn4nM6NtxEchKCw,138
|
|
2
2
|
PyPDFForm/adapter.py,sha256=OgAIwcmukpBqHFBLymd3I7wA7wIdipRqgURZA2Y0Hgo,885
|
|
3
3
|
PyPDFForm/constants.py,sha256=Y-WINNe5GoOPfBFQroWuzzLELhAl-Fj_d7_3b1QodW0,1767
|
|
4
4
|
PyPDFForm/coordinate.py,sha256=V_ZZQ1pXtVPAyfMJCX7fKoEimK7XwX6bU3VQ0nKOhQA,7314
|
|
5
|
-
PyPDFForm/filler.py,sha256=
|
|
5
|
+
PyPDFForm/filler.py,sha256=pgMA7EC8axKUganmbk7X1uDdsb4OQQFoiI85td3pOO4,7486
|
|
6
6
|
PyPDFForm/font.py,sha256=DCaKN6WIfNeMpP6ud17q1FOVRQXqrdevLycIQ9kItXQ,5711
|
|
7
7
|
PyPDFForm/image.py,sha256=0GV8PFgY5oLJFHmhPD1fG-_5SBEO7jVLLtxCc_Uodfo,1143
|
|
8
8
|
PyPDFForm/patterns.py,sha256=Ylfe6s9UV2X7cRAFQjaGoEa4nVSpEn-MLrH7IROp_aY,4332
|
|
9
9
|
PyPDFForm/template.py,sha256=u3QxYdsT8HhoUBlhmChYaTJeFWI-SSrhICtUYsTTrow,13141
|
|
10
10
|
PyPDFForm/utils.py,sha256=gDeRDszZ5Q59RjZjJYnikS2pQ_hc78osQH2Oy1TuLsY,4269
|
|
11
11
|
PyPDFForm/watermark.py,sha256=clYdRqCuWEE25IL-BUHnSo4HgLkHPSOl7FUJLhbAfGg,4755
|
|
12
|
-
PyPDFForm/wrapper.py,sha256=
|
|
12
|
+
PyPDFForm/wrapper.py,sha256=nUEPRmdqPk2JlmDaLFxZ5M8p_xZDv2Z-_OULuTuVD8I,9354
|
|
13
13
|
PyPDFForm/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
PyPDFForm/middleware/base.py,sha256=TmoO8XpjFa5NerAumrAGm_kUt2eFP3DyyF-Vx0uXloM,724
|
|
15
15
|
PyPDFForm/middleware/checkbox.py,sha256=Z92awlKjceMd_ryb9Fhrtyd4fLkU84Ii6fSum60rHcA,1305
|
|
@@ -23,8 +23,8 @@ PyPDFForm/widgets/base.py,sha256=Stq-oQt-cfwQ6nilQ4NqpO5udFSKDNb1mAwryrWggZA,207
|
|
|
23
23
|
PyPDFForm/widgets/checkbox.py,sha256=MGB6NGI-XMBz4j2erykgYOCd1pswvthuQ6UFowQOd4o,503
|
|
24
24
|
PyPDFForm/widgets/dropdown.py,sha256=2_R5xcLUWAL0G4raVgWWtE7TJdiWJITay-Gtl8YI2QI,705
|
|
25
25
|
PyPDFForm/widgets/text.py,sha256=x8EglZLYoI9osN9wORLRYoR7lebrpj-wx38QiRH7H1A,629
|
|
26
|
-
PyPDFForm-1.4.
|
|
27
|
-
PyPDFForm-1.4.
|
|
28
|
-
PyPDFForm-1.4.
|
|
29
|
-
PyPDFForm-1.4.
|
|
30
|
-
PyPDFForm-1.4.
|
|
26
|
+
PyPDFForm-1.4.28.dist-info/LICENSE,sha256=43awmYkI6opyTpg19me731iO1WfXZwViqb67oWtCsFY,1065
|
|
27
|
+
PyPDFForm-1.4.28.dist-info/METADATA,sha256=_fih08FglbeDCjbqcD3hZ0vC4A41xds-Uv3nMI38Ey0,4545
|
|
28
|
+
PyPDFForm-1.4.28.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
29
|
+
PyPDFForm-1.4.28.dist-info/top_level.txt,sha256=GQQKuWqPUjT9YZqwK95NlAQzxjwoQrsxQ8ureM8lWOY,10
|
|
30
|
+
PyPDFForm-1.4.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|