pdfdancer-client-python 0.2.20__tar.gz → 0.2.23__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 (80) hide show
  1. pdfdancer_client_python-0.2.23/.flake8 +4 -0
  2. pdfdancer_client_python-0.2.23/.github/workflows/ci.yml +129 -0
  3. pdfdancer_client_python-0.2.23/.github/workflows/daily-tests.yml +116 -0
  4. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/.gitignore +8 -0
  5. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/PKG-INFO +1 -1
  6. pdfdancer_client_python-0.2.23/check.py +4 -0
  7. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/docs/openapi.yml +224 -30
  8. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/pyproject.toml +8 -1
  9. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/__init__.py +36 -9
  10. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/exceptions.py +25 -1
  11. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/fingerprint.py +10 -10
  12. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/image_builder.py +13 -7
  13. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/models.py +254 -100
  14. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/page_builder.py +23 -16
  15. pdfdancer_client_python-0.2.23/src/pdfdancer/paragraph_builder.py +554 -0
  16. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/path_builder.py +82 -67
  17. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer/pdfdancer_v1.py +1389 -496
  18. pdfdancer_client_python-0.2.23/src/pdfdancer/types.py +420 -0
  19. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer_client_python.egg-info/PKG-INFO +1 -1
  20. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer_client_python.egg-info/SOURCES.txt +6 -1
  21. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/test.sh +230 -90
  22. pdfdancer_client_python-0.2.23/tests/__init__.py +1 -0
  23. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/conftest.py +1 -1
  24. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/__init__.py +14 -10
  25. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/pdf_assertions.py +277 -133
  26. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_acroform.py +1 -3
  27. pdfdancer_client_python-0.2.23/tests/e2e/test_bezier_builder.py +283 -0
  28. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_context_manager.py +155 -77
  29. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_form_x_objects.py +1 -4
  30. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_image.py +34 -48
  31. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_line.py +52 -54
  32. pdfdancer_client_python-0.2.23/tests/e2e/test_line_builder.py +255 -0
  33. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_new_pdf.py +31 -31
  34. pdfdancer_client_python-0.2.23/tests/e2e/test_page.py +166 -0
  35. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_paragraph.py +229 -157
  36. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_path.py +2 -9
  37. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_path_builder.py +118 -164
  38. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_path_builder_rectangle.py +123 -176
  39. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_path_comprehensive.py +77 -84
  40. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_pdfdancer.py +6 -4
  41. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_rectangle_builder.py +106 -161
  42. pdfdancer_client_python-0.2.23/tests/e2e/test_singular_selection.py +327 -0
  43. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_snapshot.py +96 -60
  44. pdfdancer_client_python-0.2.23/tests/fixtures/Showcase.pdf +0 -0
  45. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/test_anonymous_token.py +71 -61
  46. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/test_fingerprint.py +25 -19
  47. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/test_models.py +20 -5
  48. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/test_openapi_compliance.py +29 -8
  49. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/test_path_models.py +18 -37
  50. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/test_pdf_object_equality.py +70 -23
  51. pdfdancer_client_python-0.2.23/tests/test_rate_limit.py +82 -0
  52. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/test_standard_fonts.py +14 -4
  53. pdfdancer_client_python-0.2.20/.github/workflows/ci.yml +0 -41
  54. pdfdancer_client_python-0.2.20/src/pdfdancer/paragraph_builder.py +0 -287
  55. pdfdancer_client_python-0.2.20/src/pdfdancer/types.py +0 -360
  56. pdfdancer_client_python-0.2.20/tests/__init__.py +0 -1
  57. pdfdancer_client_python-0.2.20/tests/e2e/test_bezier_builder.py +0 -251
  58. pdfdancer_client_python-0.2.20/tests/e2e/test_line_builder.py +0 -255
  59. pdfdancer_client_python-0.2.20/tests/e2e/test_page.py +0 -185
  60. pdfdancer_client_python-0.2.20/tests/fixtures/ObviouslyAwesome.pdf +0 -0
  61. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/.claude/commands/discuss.md +0 -0
  62. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/CLAUDE.md +0 -0
  63. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/LICENSE +0 -0
  64. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/NOTICE +0 -0
  65. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/README.md +0 -0
  66. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/TODO.md +0 -0
  67. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/release.py +0 -0
  68. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/setup.cfg +0 -0
  69. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer_client_python.egg-info/dependency_links.txt +0 -0
  70. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer_client_python.egg-info/requires.txt +0 -0
  71. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/src/pdfdancer_client_python.egg-info/top_level.txt +0 -0
  72. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/e2e/test_positioning.py +0 -0
  73. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/fixtures/DancingScript-Regular.ttf +0 -0
  74. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/fixtures/Empty.pdf +0 -0
  75. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/fixtures/JetBrainsMono-Regular.ttf +0 -0
  76. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/fixtures/basic-paths.pdf +0 -0
  77. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/fixtures/form-xobject-example.pdf +0 -0
  78. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/fixtures/logo-80.png +0 -0
  79. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/tests/fixtures/mixed-form-types.pdf +0 -0
  80. {pdfdancer_client_python-0.2.20 → pdfdancer_client_python-0.2.23}/update-api-spec.sh +0 -0
@@ -0,0 +1,4 @@
1
+ [flake8]
2
+ max-line-length = 88
3
+ extend-ignore = E203, W503, E501
4
+ exclude = venv, build, dist, .git, __pycache__, *.egg-info
@@ -0,0 +1,129 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, staging, develop, development, dev ]
6
+ pull_request:
7
+ branches: [ main, staging, develop, development, dev ]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ test:
12
+ # Quick minimal test on non-main branches
13
+ if: github.ref != 'refs/heads/main'
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: [ '3.12' ]
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+
28
+ - name: Create virtual environment
29
+ run: python -m venv venv
30
+
31
+ - name: Install dependencies
32
+ run: |
33
+ venv/bin/pip install --upgrade pip
34
+ venv/bin/pip install -e ".[dev]"
35
+
36
+ - name: Run linter
37
+ run: |
38
+ venv/bin/python -m flake8 src/
39
+
40
+ - name: Run tests
41
+ run: |
42
+ PDFDANCER_BASE_URL=https://api-staging.pdfdancer.com \
43
+ PDFDANCER_TOKEN=42 \
44
+ venv/bin/python -m pytest tests/ -v --maxfail=3
45
+
46
+ - name: Build distribution packages
47
+ run: venv/bin/python -m build
48
+
49
+ - name: Validate packages
50
+ run: venv/bin/python -m twine check dist/*
51
+
52
+
53
+ test-full-matrix:
54
+ # Full matrix only on main
55
+ if: github.ref == 'refs/heads/main'
56
+ runs-on: ${{ matrix.os }}
57
+ strategy:
58
+ fail-fast: false
59
+ matrix:
60
+ os: [ ubuntu-latest, windows-latest ]
61
+ python-version: [ '3.10', '3.11', '3.12', '3.13' ]
62
+
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+
66
+ - name: Set up Python ${{ matrix.python-version }}
67
+ uses: actions/setup-python@v5
68
+ with:
69
+ python-version: ${{ matrix.python-version }}
70
+
71
+ - name: Create virtual environment (Unix)
72
+ if: runner.os != 'Windows'
73
+ run: python -m venv venv
74
+
75
+ - name: Install dependencies (Unix)
76
+ if: runner.os != 'Windows'
77
+ run: |
78
+ venv/bin/pip install --upgrade pip
79
+ venv/bin/pip install -e ".[dev]"
80
+
81
+ - name: Run linter (Unix)
82
+ if: runner.os != 'Windows'
83
+ run: |
84
+ venv/bin/python -m flake8 src/
85
+
86
+ - name: Run tests (Unix)
87
+ if: runner.os != 'Windows'
88
+ run: |
89
+ PDFDANCER_BASE_URL=https://api-staging.pdfdancer.com \
90
+ PDFDANCER_TOKEN=42 \
91
+ venv/bin/python -m pytest tests/ -v --maxfail=3
92
+
93
+ - name: Build & Validate (Unix)
94
+ if: runner.os != 'Windows'
95
+ run: |
96
+ venv/bin/python -m build
97
+ venv/bin/python -m twine check dist/*
98
+
99
+ - name: Create virtual environment (Windows)
100
+ if: runner.os == 'Windows'
101
+ shell: cmd
102
+ run: python -m venv venv
103
+
104
+ - name: Install dependencies (Windows)
105
+ if: runner.os == 'Windows'
106
+ shell: cmd
107
+ run: |
108
+ venv\Scripts\pip install --upgrade pip
109
+ venv\Scripts\pip install -e ".[dev]"
110
+
111
+ - name: Run linter (Windows)
112
+ if: runner.os == 'Windows'
113
+ run: |
114
+ venv\Scripts\python -m flake8 src/
115
+
116
+ - name: Run tests (Windows)
117
+ if: runner.os == 'Windows'
118
+ shell: cmd
119
+ run: |
120
+ set PDFDANCER_BASE_URL=https://api-staging.pdfdancer.com
121
+ set PDFDANCER_TOKEN=42
122
+ venv\Scripts\python -m pytest tests/ -v --maxfail=3
123
+
124
+ - name: Build & Validate (Windows)
125
+ if: runner.os == 'Windows'
126
+ shell: cmd
127
+ run: |
128
+ venv\Scripts\python -m build
129
+ venv\Scripts\python -m twine check dist/*
@@ -0,0 +1,116 @@
1
+ name: Daily Tests
2
+
3
+ on:
4
+ schedule:
5
+ # Run daily at 9:00 PM UTC
6
+ - cron: '0 21 * * *'
7
+ workflow_dispatch: # Allow manual triggering
8
+
9
+ jobs:
10
+ daily-test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ ubuntu-latest, windows-latest ]
16
+ python-version: [ '3.10', '3.11', '3.12', '3.13' ]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Create virtual environment (Unix)
27
+ if: runner.os != 'Windows'
28
+ run: python -m venv venv
29
+
30
+ - name: Install dependencies (Unix)
31
+ if: runner.os != 'Windows'
32
+ run: |
33
+ venv/bin/pip install --upgrade pip
34
+ venv/bin/pip install -e ".[dev]"
35
+
36
+ - name: Run linter (Unix)
37
+ if: runner.os != 'Windows'
38
+ run: |
39
+ venv/bin/python -m flake8 src/
40
+
41
+ - name: Run tests (Unix)
42
+ if: runner.os != 'Windows'
43
+ run: |
44
+ PDFDANCER_BASE_URL=https://api-staging.pdfdancer.com \
45
+ PDFDANCER_TOKEN=42 \
46
+ venv/bin/python -m pytest tests/ -v --maxfail=3
47
+
48
+ - name: Build & Validate (Unix)
49
+ if: runner.os != 'Windows'
50
+ run: |
51
+ venv/bin/python -m build
52
+ venv/bin/python -m twine check dist/*
53
+
54
+ - name: Create virtual environment (Windows)
55
+ if: runner.os == 'Windows'
56
+ shell: cmd
57
+ run: python -m venv venv
58
+
59
+ - name: Install dependencies (Windows)
60
+ if: runner.os == 'Windows'
61
+ shell: cmd
62
+ run: |
63
+ venv\Scripts\pip install --upgrade pip
64
+ venv\Scripts\pip install -e ".[dev]"
65
+
66
+ - name: Run linter (Windows)
67
+ if: runner.os == 'Windows'
68
+ run: |
69
+ venv\Scripts\python -m flake8 src/
70
+
71
+ - name: Run tests (Windows)
72
+ if: runner.os == 'Windows'
73
+ shell: cmd
74
+ run: |
75
+ set PDFDANCER_BASE_URL=https://api-staging.pdfdancer.com
76
+ set PDFDANCER_TOKEN=42
77
+ venv\Scripts\python -m pytest tests/ -v --maxfail=3
78
+
79
+ - name: Build & Validate (Windows)
80
+ if: runner.os == 'Windows'
81
+ shell: cmd
82
+ run: |
83
+ venv\Scripts\python -m build
84
+ venv\Scripts\python -m twine check dist/*
85
+
86
+ notify-on-failure:
87
+ needs: daily-test
88
+ runs-on: ubuntu-latest
89
+ if: failure()
90
+ steps:
91
+ - name: Create issue on failure
92
+ uses: actions/github-script@v7
93
+ with:
94
+ script: |
95
+ const title = `Daily Tests Failed - ${new Date().toISOString().split('T')[0]}`;
96
+ const body = `The daily test run has failed. Please check the workflow run for details.\n\n[Workflow Run](${context.payload.repository.html_url}/actions/runs/${context.runId})`;
97
+
98
+ // Check if an issue already exists
99
+ const issues = await github.rest.issues.listForRepo({
100
+ owner: context.repo.owner,
101
+ repo: context.repo.repo,
102
+ state: 'open',
103
+ labels: 'daily-test-failure'
104
+ });
105
+
106
+ const existingIssue = issues.data.find(issue => issue.title === title);
107
+
108
+ if (!existingIssue) {
109
+ await github.rest.issues.create({
110
+ owner: context.repo.owner,
111
+ repo: context.repo.repo,
112
+ title: title,
113
+ body: body,
114
+ labels: ['daily-test-failure', 'automated']
115
+ });
116
+ }
@@ -9,3 +9,11 @@ src/pdfdancer_client_python.egg-info
9
9
  /logs/
10
10
  /venv
11
11
  /venv-*
12
+
13
+ # Python cache
14
+ __pycache__/
15
+ *.py[cod]
16
+ *$py.class
17
+ *.so
18
+ .Python
19
+ /.run/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdfdancer-client-python
3
- Version: 0.2.20
3
+ Version: 0.2.23
4
4
  Summary: Python client for PDFDancer API
5
5
  Author-email: "The Famous Cat Ltd." <hi@thefamouscat.com>
6
6
  License:
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+
3
+
4
+ isort src/ tests/ && black src/ tests/ && flake8 src/