pdfdancer-client-python 0.2.19__tar.gz → 0.2.20__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.
Files changed (69) hide show
  1. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/PKG-INFO +1 -1
  2. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/pyproject.toml +1 -1
  3. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/__init__.py +2 -0
  4. pdfdancer_client_python-0.2.20/src/pdfdancer/image_builder.py +60 -0
  5. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/models.py +446 -35
  6. pdfdancer_client_python-0.2.20/src/pdfdancer/page_builder.py +92 -0
  7. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/path_builder.py +252 -0
  8. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/pdfdancer_v1.py +49 -15
  9. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer_client_python.egg-info/PKG-INFO +1 -1
  10. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer_client_python.egg-info/SOURCES.txt +3 -0
  11. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_image.py +34 -0
  12. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_new_pdf.py +1 -1
  13. pdfdancer_client_python-0.2.20/tests/e2e/test_page.py +185 -0
  14. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_paragraph.py +122 -0
  15. pdfdancer_client_python-0.2.20/tests/e2e/test_path_builder_rectangle.py +568 -0
  16. pdfdancer_client_python-0.2.20/tests/e2e/test_rectangle_builder.py +504 -0
  17. pdfdancer_client_python-0.2.19/src/pdfdancer/image_builder.py +0 -30
  18. pdfdancer_client_python-0.2.19/tests/e2e/test_page.py +0 -66
  19. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/.claude/commands/discuss.md +0 -0
  20. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/.github/workflows/ci.yml +0 -0
  21. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/.gitignore +0 -0
  22. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/CLAUDE.md +0 -0
  23. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/LICENSE +0 -0
  24. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/NOTICE +0 -0
  25. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/README.md +0 -0
  26. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/TODO.md +0 -0
  27. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/docs/openapi.yml +0 -0
  28. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/release.py +0 -0
  29. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/setup.cfg +0 -0
  30. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/exceptions.py +0 -0
  31. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/fingerprint.py +0 -0
  32. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/paragraph_builder.py +0 -0
  33. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer/types.py +0 -0
  34. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer_client_python.egg-info/dependency_links.txt +0 -0
  35. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer_client_python.egg-info/requires.txt +0 -0
  36. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/src/pdfdancer_client_python.egg-info/top_level.txt +0 -0
  37. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/test.sh +0 -0
  38. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/__init__.py +0 -0
  39. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/conftest.py +0 -0
  40. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/__init__.py +0 -0
  41. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/pdf_assertions.py +0 -0
  42. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_acroform.py +0 -0
  43. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_bezier_builder.py +0 -0
  44. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_context_manager.py +0 -0
  45. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_form_x_objects.py +0 -0
  46. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_line.py +0 -0
  47. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_line_builder.py +0 -0
  48. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_path.py +0 -0
  49. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_path_builder.py +0 -0
  50. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_path_comprehensive.py +0 -0
  51. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_pdfdancer.py +0 -0
  52. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_positioning.py +0 -0
  53. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/e2e/test_snapshot.py +0 -0
  54. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/DancingScript-Regular.ttf +0 -0
  55. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/Empty.pdf +0 -0
  56. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/JetBrainsMono-Regular.ttf +0 -0
  57. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/ObviouslyAwesome.pdf +0 -0
  58. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/basic-paths.pdf +0 -0
  59. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/form-xobject-example.pdf +0 -0
  60. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/logo-80.png +0 -0
  61. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/fixtures/mixed-form-types.pdf +0 -0
  62. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/test_anonymous_token.py +0 -0
  63. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/test_fingerprint.py +0 -0
  64. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/test_models.py +0 -0
  65. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/test_openapi_compliance.py +0 -0
  66. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/test_path_models.py +0 -0
  67. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/test_pdf_object_equality.py +0 -0
  68. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/tests/test_standard_fonts.py +0 -0
  69. {pdfdancer_client_python-0.2.19 → pdfdancer_client_python-0.2.20}/update-api-spec.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdfdancer-client-python
3
- Version: 0.2.19
3
+ Version: 0.2.20
4
4
  Summary: Python client for PDFDancer API
5
5
  Author-email: "The Famous Cat Ltd." <hi@thefamouscat.com>
6
6
  License:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pdfdancer-client-python"
7
- version = "0.2.19"
7
+ version = "0.2.20"
8
8
  description = "Python client for PDFDancer API"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -16,12 +16,14 @@ from .models import (
16
16
  FontType, PathSegment, Line, Bezier, Path
17
17
  )
18
18
  from .paragraph_builder import ParagraphBuilder
19
+ from .page_builder import PageBuilder
19
20
  from .path_builder import PathBuilder, LineBuilder, BezierBuilder
20
21
 
21
22
  __version__ = "1.0.0"
22
23
  __all__ = [
23
24
  "PDFDancer",
24
25
  "ParagraphBuilder",
26
+ "PageBuilder",
25
27
  "PathBuilder",
26
28
  "LineBuilder",
27
29
  "BezierBuilder",
@@ -0,0 +1,60 @@
1
+ from pathlib import Path
2
+
3
+ from pdfdancer import ValidationException, Image, Position
4
+
5
+
6
+ class ImageBuilder:
7
+
8
+ def __init__(self, client: 'PDFDancer'):
9
+ """
10
+ Initialize the image builder with a client reference.
11
+
12
+ Args:
13
+ client: The PDFDancer instance for font registration
14
+ """
15
+ if client is None:
16
+ raise ValidationException("Client cannot be null")
17
+
18
+ self._client = client
19
+ self._image = Image()
20
+
21
+ def from_file(self, img_path: Path) -> 'ImageBuilder':
22
+ self._image.data = img_path.read_bytes()
23
+ return self
24
+
25
+ def at(self, page, x, y) -> 'ImageBuilder':
26
+ self._image.position = Position.at_page_coordinates(page, x, y)
27
+ return self
28
+
29
+ def add(self) -> bool:
30
+ # noinspection PyProtectedMember
31
+ return self._client._add_image(self._image, self._image.position)
32
+
33
+
34
+ class ImageOnPageBuilder:
35
+
36
+ def __init__(self, client: 'PDFDancer', page_index: int):
37
+ """
38
+ Initialize the image builder with a client reference.
39
+
40
+ Args:
41
+ client: The PDFDancer instance for font registration
42
+ """
43
+ if client is None:
44
+ raise ValidationException("Client cannot be null")
45
+
46
+ self._client = client
47
+ self._image = Image()
48
+ self._page_index = page_index
49
+
50
+ def from_file(self, img_path: Path) -> 'ImageOnPageBuilder':
51
+ self._image.data = img_path.read_bytes()
52
+ return self
53
+
54
+ def at(self, x, y) -> 'ImageOnPageBuilder':
55
+ self._image.position = Position.at_page_coordinates(self._page_index, x, y)
56
+ return self
57
+
58
+ def add(self) -> bool:
59
+ # noinspection PyProtectedMember
60
+ return self._client._add_image(self._image, self._image.position)