tpdf-client 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Timo Stein
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: tpdf-client
3
+ Version: 0.1.0
4
+ Summary: Python client for the tpdf command-line API
5
+ Author: Timo Stein
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/tstone-1/tpdf
8
+ Project-URL: Documentation, https://github.com/tstone-1/tpdf#command-line-tool
9
+ Project-URL: Issues, https://github.com/tstone-1/tpdf/issues
10
+ Keywords: pdf,redaction,signature,forms
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: MacOS
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Office/Business
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Dynamic: license-file
21
+
22
+ # tpdf-client
23
+
24
+ A Python client for the [tpdf](https://github.com/tstone-1/tpdf) command-line tool: read,
25
+ edit, fill, redact, sign and verify PDF documents from a script.
26
+
27
+ **This package alone does not read a PDF.** The client starts the `tpdf` command-line tool
28
+ and returns its JSON reports as dictionaries. The tool comes with the tpdf application for
29
+ macOS and Windows, which has to be installed separately; see the
30
+ [installation notes](https://github.com/tstone-1/tpdf#command-line-tool). There is no tool
31
+ for Linux, so the client finds nothing to start there. It has no dependencies of its own.
32
+
33
+ ```
34
+ pip install tpdf-client
35
+ ```
36
+
37
+ The import name is `tpdf_client`, not `tpdf`: another project on PyPI has that name.
38
+
39
+ ```python
40
+ from tpdf_client import Tpdf
41
+
42
+ pdf = Tpdf() # or Tpdf("/path/to/tpdf-cli", timeout=60)
43
+
44
+ print(pdf.info("report.pdf")["files"][0]["document"]["pages"])
45
+
46
+ report = pdf.redact("letter.pdf", "letter-redacted.pdf", texts=["Jane Doe"])
47
+ assert report["written"] and report["verified"]
48
+
49
+ pdf.merge(["cover.pdf", "report.pdf"], "combined.pdf")
50
+
51
+ # Highlights every match in a copy. Returns None, and writes nothing, when nothing matched.
52
+ pdf.mark_matches("report.pdf", "report-marked.pdf", texts=["North Pier"])
53
+
54
+ for file in pdf.search("a.pdf", "b.pdf", texts=["North Pier"])["files"]:
55
+ for match in file["matches"]:
56
+ print(file["path"], match["page"], match["hit"])
57
+ ```
58
+
59
+ `pdf.run(command, *arguments)` reaches every command and returns a `Result`; its `typed`
60
+ property is the report, which the methods above return under the shape `tpdf_client.reports` names.
61
+
62
+ Every method is described in the
63
+ [tpdf README](https://github.com/tstone-1/tpdf#command-line-tool). Requires Python 3.10 or
64
+ newer. MIT licence.
@@ -0,0 +1,43 @@
1
+ # tpdf-client
2
+
3
+ A Python client for the [tpdf](https://github.com/tstone-1/tpdf) command-line tool: read,
4
+ edit, fill, redact, sign and verify PDF documents from a script.
5
+
6
+ **This package alone does not read a PDF.** The client starts the `tpdf` command-line tool
7
+ and returns its JSON reports as dictionaries. The tool comes with the tpdf application for
8
+ macOS and Windows, which has to be installed separately; see the
9
+ [installation notes](https://github.com/tstone-1/tpdf#command-line-tool). There is no tool
10
+ for Linux, so the client finds nothing to start there. It has no dependencies of its own.
11
+
12
+ ```
13
+ pip install tpdf-client
14
+ ```
15
+
16
+ The import name is `tpdf_client`, not `tpdf`: another project on PyPI has that name.
17
+
18
+ ```python
19
+ from tpdf_client import Tpdf
20
+
21
+ pdf = Tpdf() # or Tpdf("/path/to/tpdf-cli", timeout=60)
22
+
23
+ print(pdf.info("report.pdf")["files"][0]["document"]["pages"])
24
+
25
+ report = pdf.redact("letter.pdf", "letter-redacted.pdf", texts=["Jane Doe"])
26
+ assert report["written"] and report["verified"]
27
+
28
+ pdf.merge(["cover.pdf", "report.pdf"], "combined.pdf")
29
+
30
+ # Highlights every match in a copy. Returns None, and writes nothing, when nothing matched.
31
+ pdf.mark_matches("report.pdf", "report-marked.pdf", texts=["North Pier"])
32
+
33
+ for file in pdf.search("a.pdf", "b.pdf", texts=["North Pier"])["files"]:
34
+ for match in file["matches"]:
35
+ print(file["path"], match["page"], match["hit"])
36
+ ```
37
+
38
+ `pdf.run(command, *arguments)` reaches every command and returns a `Result`; its `typed`
39
+ property is the report, which the methods above return under the shape `tpdf_client.reports` names.
40
+
41
+ Every method is described in the
42
+ [tpdf README](https://github.com/tstone-1/tpdf#command-line-tool). Requires Python 3.10 or
43
+ newer. MIT licence.
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.3"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tpdf-client"
7
+ version = "0.1.0"
8
+ description = "Python client for the tpdf command-line API"
9
+ readme = "README.md"
10
+ authors = [{ name = "Timo Stein" }]
11
+ keywords = ["pdf", "redaction", "signature", "forms"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Intended Audience :: Developers",
15
+ "Operating System :: MacOS",
16
+ "Operating System :: Microsoft :: Windows",
17
+ "Programming Language :: Python :: 3",
18
+ "Topic :: Office/Business",
19
+ ]
20
+ requires-python = ">=3.10"
21
+ license = "MIT"
22
+ license-files = ["LICENSE"]
23
+
24
+ [project.urls]
25
+ Homepage = "https://github.com/tstone-1/tpdf"
26
+ Documentation = "https://github.com/tstone-1/tpdf#command-line-tool"
27
+ Issues = "https://github.com/tstone-1/tpdf/issues"
28
+
29
+ [tool.setuptools.packages.find]
30
+ include = ["tpdf_client"]
31
+
32
+ [tool.setuptools.package-data]
33
+ tpdf_client = ["py.typed"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+