pdfrender 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.
- pdfrender-0.1.0/.github/workflows/ci.yml +74 -0
- pdfrender-0.1.0/.github/workflows/release.yml +68 -0
- pdfrender-0.1.0/.gitignore +257 -0
- pdfrender-0.1.0/LICENSE +21 -0
- pdfrender-0.1.0/PKG-INFO +96 -0
- pdfrender-0.1.0/README.md +48 -0
- pdfrender-0.1.0/extras/docs/docs/api/data.md +7 -0
- pdfrender-0.1.0/extras/docs/docs/api/markdown.md +15 -0
- pdfrender-0.1.0/extras/docs/docs/api/pdf.md +7 -0
- pdfrender-0.1.0/extras/docs/docs/api/templates.md +15 -0
- pdfrender-0.1.0/extras/docs/docs/api/user-input.md +3 -0
- pdfrender-0.1.0/extras/docs/docs/guide/data-importer.md +97 -0
- pdfrender-0.1.0/extras/docs/docs/guide/db-accessor.md +75 -0
- pdfrender-0.1.0/extras/docs/docs/guide/markdown-extensions.md +69 -0
- pdfrender-0.1.0/extras/docs/docs/guide/pdf-rendering.md +31 -0
- pdfrender-0.1.0/extras/docs/docs/guide/templates.md +71 -0
- pdfrender-0.1.0/extras/docs/docs/index.md +30 -0
- pdfrender-0.1.0/extras/docs/docs/quickstart.md +70 -0
- pdfrender-0.1.0/extras/docs/mkdocs.yml +64 -0
- pdfrender-0.1.0/extras/examples/README.md +20 -0
- pdfrender-0.1.0/extras/examples/data/client.yml +3 -0
- pdfrender-0.1.0/extras/examples/data/invoice.yml +11 -0
- pdfrender-0.1.0/extras/examples/models.py +26 -0
- pdfrender-0.1.0/extras/examples/run.py +74 -0
- pdfrender-0.1.0/extras/examples/style.css +35 -0
- pdfrender-0.1.0/extras/examples/templates/invoice.md.jinja2 +17 -0
- pdfrender-0.1.0/pdf_render/__init__.py +25 -0
- pdfrender-0.1.0/pdf_render/data/__init__.py +5 -0
- pdfrender-0.1.0/pdf_render/data/accessor.py +161 -0
- pdfrender-0.1.0/pdf_render/data/importer.py +209 -0
- pdfrender-0.1.0/pdf_render/data/model_field_typing.py +159 -0
- pdfrender-0.1.0/pdf_render/import_functions.py +43 -0
- pdfrender-0.1.0/pdf_render/md/__init__.py +3 -0
- pdfrender-0.1.0/pdf_render/md/extensions/__init__.py +13 -0
- pdfrender-0.1.0/pdf_render/md/extensions/columns.py +47 -0
- pdfrender-0.1.0/pdf_render/md/extensions/flex_wrap.py +52 -0
- pdfrender-0.1.0/pdf_render/md/extensions/muted_text.py +42 -0
- pdfrender-0.1.0/pdf_render/md/extensions/nerdfont_glyph.py +37 -0
- pdfrender-0.1.0/pdf_render/md/extensions/page_break.py +39 -0
- pdfrender-0.1.0/pdf_render/md/rendering.py +29 -0
- pdfrender-0.1.0/pdf_render/pdf/__init__.py +5 -0
- pdfrender-0.1.0/pdf_render/pdf/document_template.py +45 -0
- pdfrender-0.1.0/pdf_render/pdf/metadata.py +38 -0
- pdfrender-0.1.0/pdf_render/pdf/options.py +64 -0
- pdfrender-0.1.0/pdf_render/pdf/rendering.py +40 -0
- pdfrender-0.1.0/pdf_render/templates/__init__.py +4 -0
- pdfrender-0.1.0/pdf_render/templates/environment.py +158 -0
- pdfrender-0.1.0/pdf_render/templates/filters/__init__.py +9 -0
- pdfrender-0.1.0/pdf_render/templates/filters/format_filters.py +34 -0
- pdfrender-0.1.0/pdf_render/templates/filters/getter_filters.py +45 -0
- pdfrender-0.1.0/pdf_render/templates/rendering.py +75 -0
- pdfrender-0.1.0/pdf_render/templates/tests/__init__.py +0 -0
- pdfrender-0.1.0/pdf_render/user_input/__init__.py +3 -0
- pdfrender-0.1.0/pdf_render/user_input/undefined_variable_form.py +321 -0
- pdfrender-0.1.0/pdfrender.egg-info/PKG-INFO +96 -0
- pdfrender-0.1.0/pdfrender.egg-info/SOURCES.txt +70 -0
- pdfrender-0.1.0/pdfrender.egg-info/dependency_links.txt +1 -0
- pdfrender-0.1.0/pdfrender.egg-info/entry_points.txt +2 -0
- pdfrender-0.1.0/pdfrender.egg-info/requires.txt +28 -0
- pdfrender-0.1.0/pdfrender.egg-info/scm_file_list.json +66 -0
- pdfrender-0.1.0/pdfrender.egg-info/scm_version.json +8 -0
- pdfrender-0.1.0/pdfrender.egg-info/top_level.txt +1 -0
- pdfrender-0.1.0/pyproject.toml +119 -0
- pdfrender-0.1.0/setup.cfg +4 -0
- pdfrender-0.1.0/tests/fixtures/data/address.yml +9 -0
- pdfrender-0.1.0/tests/fixtures/data/user.yml +12 -0
- pdfrender-0.1.0/tests/fixtures/data/user_address.yml +15 -0
- pdfrender-0.1.0/tests/fixtures/sqlalchemy_model.py +35 -0
- pdfrender-0.1.0/tests/fixtures/sqlmodel_model.py +28 -0
- pdfrender-0.1.0/tests/test_data_importer.py +193 -0
- pdfrender-0.1.0/tests/test_db_accessor.py +225 -0
- pdfrender-0.1.0/tests/test_model_field_typing.py +170 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
21
|
+
defaults:
|
|
22
|
+
run:
|
|
23
|
+
shell: bash
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
# setuptools-scm needs the full history (incl. tags) to compute a version
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
|
|
30
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: |
|
|
37
|
+
python -m pip install --upgrade pip
|
|
38
|
+
python -m pip install -e ".[development]"
|
|
39
|
+
|
|
40
|
+
- name: Run tests
|
|
41
|
+
run: pytest
|
|
42
|
+
|
|
43
|
+
lint-and-docs:
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
defaults:
|
|
46
|
+
run:
|
|
47
|
+
shell: bash
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
with:
|
|
51
|
+
# setuptools-scm needs the full history (incl. tags) to compute a version
|
|
52
|
+
fetch-depth: 0
|
|
53
|
+
|
|
54
|
+
- name: Set up Python
|
|
55
|
+
uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: "3.12"
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: |
|
|
61
|
+
python -m pip install --upgrade pip
|
|
62
|
+
python -m pip install -e ".[development,docs]"
|
|
63
|
+
|
|
64
|
+
- name: isort --check-only
|
|
65
|
+
run: isort --check-only --diff pdf_render tests extras/examples
|
|
66
|
+
|
|
67
|
+
- name: ruff check
|
|
68
|
+
run: ruff check pdf_render tests extras/examples
|
|
69
|
+
|
|
70
|
+
- name: ruff format --check
|
|
71
|
+
run: ruff format --check pdf_render tests extras/examples
|
|
72
|
+
|
|
73
|
+
- name: Build docs (check only, no deploy)
|
|
74
|
+
run: mkdocs build -f extras/docs/mkdocs.yml
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish-package:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment:
|
|
12
|
+
name: pypi
|
|
13
|
+
url: https://pypi.org/p/pdfrender
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write # for PyPI trusted publishing (OIDC) - no stored token needed
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
# setuptools-scm needs the full history (incl. tags) to compute a version
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
- name: Install build tool
|
|
28
|
+
run: python -m pip install --upgrade pip build
|
|
29
|
+
|
|
30
|
+
- name: Build the distribution package
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Publish to PyPI
|
|
34
|
+
uses: pypa/gh-action-pypi-publish@v1.13.0
|
|
35
|
+
|
|
36
|
+
deploy-docs:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
permissions:
|
|
39
|
+
contents: read
|
|
40
|
+
pages: write
|
|
41
|
+
id-token: write # for deploying to GitHub Pages
|
|
42
|
+
environment:
|
|
43
|
+
name: github-pages
|
|
44
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- name: Set up Python
|
|
49
|
+
uses: actions/setup-python@v5
|
|
50
|
+
with:
|
|
51
|
+
python-version: "3.12"
|
|
52
|
+
|
|
53
|
+
- name: Install docs dependencies
|
|
54
|
+
run: |
|
|
55
|
+
python -m pip install --upgrade pip
|
|
56
|
+
python -m pip install -e ".[docs]"
|
|
57
|
+
|
|
58
|
+
- name: Build docs
|
|
59
|
+
run: mkdocs build -f extras/docs/mkdocs.yml
|
|
60
|
+
|
|
61
|
+
- name: Upload Pages artifact
|
|
62
|
+
uses: actions/upload-pages-artifact@v3
|
|
63
|
+
with:
|
|
64
|
+
path: extras/docs/site
|
|
65
|
+
|
|
66
|
+
- name: Deploy to GitHub Pages
|
|
67
|
+
id: deployment
|
|
68
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/init.sh
|
|
2
|
+
*.tmp
|
|
3
|
+
.idea
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
sdist/
|
|
7
|
+
/tests/fixtures/output/
|
|
8
|
+
/extras/docs/site/
|
|
9
|
+
/extras/examples/output/
|
|
10
|
+
|
|
11
|
+
# Source: https://github.com/github/gitignor
|
|
12
|
+
|
|
13
|
+
# Byte-compiled / optimized / DLL files
|
|
14
|
+
__pycache__/
|
|
15
|
+
*.py[cod]
|
|
16
|
+
*$py.class
|
|
17
|
+
|
|
18
|
+
# C extensions
|
|
19
|
+
*.so
|
|
20
|
+
|
|
21
|
+
# Distribution / packaging
|
|
22
|
+
.Python
|
|
23
|
+
develop-eggs/
|
|
24
|
+
downloads/
|
|
25
|
+
eggs/
|
|
26
|
+
.eggs/
|
|
27
|
+
lib/
|
|
28
|
+
bin/
|
|
29
|
+
lib64/
|
|
30
|
+
parts/
|
|
31
|
+
var/
|
|
32
|
+
wheels/
|
|
33
|
+
share/python-wheels/
|
|
34
|
+
*.egg-info/
|
|
35
|
+
.installed.cfg
|
|
36
|
+
*.egg
|
|
37
|
+
MANIFEST
|
|
38
|
+
|
|
39
|
+
# PyInstaller
|
|
40
|
+
# Usually these files are written by a python script from a template
|
|
41
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
42
|
+
*.manifest
|
|
43
|
+
*.spec
|
|
44
|
+
|
|
45
|
+
# Installer logs
|
|
46
|
+
pip-log.txt
|
|
47
|
+
pip-delete-this-directory.txt
|
|
48
|
+
|
|
49
|
+
# Unit test / coverage reports
|
|
50
|
+
htmlcov/
|
|
51
|
+
.tox/
|
|
52
|
+
.nox/
|
|
53
|
+
.coverage
|
|
54
|
+
.coverage.*
|
|
55
|
+
.cache
|
|
56
|
+
nosetests.xml
|
|
57
|
+
coverage.xml
|
|
58
|
+
*.cover
|
|
59
|
+
*.py,cover
|
|
60
|
+
.hypothesis/
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
cover/
|
|
63
|
+
|
|
64
|
+
# Translations
|
|
65
|
+
*.mo
|
|
66
|
+
*.pot
|
|
67
|
+
|
|
68
|
+
# Django stuff:
|
|
69
|
+
*.log
|
|
70
|
+
local_settings.py
|
|
71
|
+
db.sqlite3
|
|
72
|
+
db.sqlite3-journal
|
|
73
|
+
|
|
74
|
+
# Flask stuff:
|
|
75
|
+
instance/
|
|
76
|
+
.webassets-cache
|
|
77
|
+
|
|
78
|
+
# Scrapy stuff:
|
|
79
|
+
.scrapy
|
|
80
|
+
|
|
81
|
+
# Sphinx documentation
|
|
82
|
+
extras/docs/_build/
|
|
83
|
+
|
|
84
|
+
# PyBuilder
|
|
85
|
+
.pybuilder/
|
|
86
|
+
target/
|
|
87
|
+
|
|
88
|
+
# Jupyter Notebook
|
|
89
|
+
.ipynb_checkpoints
|
|
90
|
+
|
|
91
|
+
# IPython
|
|
92
|
+
profile_default/
|
|
93
|
+
ipython_config.py
|
|
94
|
+
|
|
95
|
+
# pyenv
|
|
96
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
97
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
98
|
+
.python-version
|
|
99
|
+
|
|
100
|
+
# pipenv
|
|
101
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
102
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
103
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
104
|
+
# install all needed dependencies.
|
|
105
|
+
Pipfile.lock
|
|
106
|
+
|
|
107
|
+
# poetry
|
|
108
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
109
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
110
|
+
# commonly ignored for libraries.
|
|
111
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
112
|
+
poetry.lock
|
|
113
|
+
|
|
114
|
+
# pdm
|
|
115
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
116
|
+
pdm.lock
|
|
117
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
118
|
+
# in version control.
|
|
119
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
120
|
+
.pdm.toml
|
|
121
|
+
|
|
122
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
123
|
+
__pypackages__/
|
|
124
|
+
|
|
125
|
+
# Celery stuff
|
|
126
|
+
celerybeat-schedule
|
|
127
|
+
celerybeat.pid
|
|
128
|
+
|
|
129
|
+
# SageMath parsed files
|
|
130
|
+
*.sage.py
|
|
131
|
+
|
|
132
|
+
# Environments
|
|
133
|
+
.env
|
|
134
|
+
.venv
|
|
135
|
+
env/
|
|
136
|
+
venv/
|
|
137
|
+
ENV/
|
|
138
|
+
env.bak/
|
|
139
|
+
venv.bak/
|
|
140
|
+
|
|
141
|
+
# Spyder project settings
|
|
142
|
+
.spyderproject
|
|
143
|
+
.spyproject
|
|
144
|
+
|
|
145
|
+
# Rope project settings
|
|
146
|
+
.ropeproject
|
|
147
|
+
|
|
148
|
+
# mkdocs documentation
|
|
149
|
+
/site
|
|
150
|
+
|
|
151
|
+
# mypy
|
|
152
|
+
.mypy_cache/
|
|
153
|
+
.dmypy.json
|
|
154
|
+
dmypy.json
|
|
155
|
+
|
|
156
|
+
# Pyre type checker
|
|
157
|
+
.pyre/
|
|
158
|
+
|
|
159
|
+
# pytype static type analyzer
|
|
160
|
+
.pytype/
|
|
161
|
+
|
|
162
|
+
# Cython debug symbols
|
|
163
|
+
cython_debug/
|
|
164
|
+
|
|
165
|
+
# PyCharm
|
|
166
|
+
.idea/
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
## MacOS
|
|
170
|
+
# General
|
|
171
|
+
.DS_Store
|
|
172
|
+
.AppleDouble
|
|
173
|
+
.LSOverride
|
|
174
|
+
|
|
175
|
+
# Icon must end with two \r
|
|
176
|
+
Icon
|
|
177
|
+
|
|
178
|
+
# Thumbnails
|
|
179
|
+
._*
|
|
180
|
+
|
|
181
|
+
# Files that might appear in the root of a volume
|
|
182
|
+
.DocumentRevisions-V100
|
|
183
|
+
.fseventsd
|
|
184
|
+
.Spotlight-V100
|
|
185
|
+
.TemporaryItems
|
|
186
|
+
.Trashes
|
|
187
|
+
.VolumeIcon.icns
|
|
188
|
+
.com.apple.timemachine.donotpresent
|
|
189
|
+
|
|
190
|
+
# Directories potentially created on remote AFP share
|
|
191
|
+
.AppleDB
|
|
192
|
+
.AppleDesktop
|
|
193
|
+
Network Trash Folder
|
|
194
|
+
Temporary Items
|
|
195
|
+
.apdisk
|
|
196
|
+
|
|
197
|
+
## Windows
|
|
198
|
+
# Windows thumbnail cache files
|
|
199
|
+
Thumbs.db
|
|
200
|
+
Thumbs.db:encryptable
|
|
201
|
+
ehthumbs.db
|
|
202
|
+
ehthumbs_vista.db
|
|
203
|
+
|
|
204
|
+
# Dump file
|
|
205
|
+
*.stackdump
|
|
206
|
+
|
|
207
|
+
# Folder config file
|
|
208
|
+
[Dd]esktop.ini
|
|
209
|
+
|
|
210
|
+
# Recycle Bin used on file shares
|
|
211
|
+
$RECYCLE.BIN/
|
|
212
|
+
|
|
213
|
+
# Windows Installer files
|
|
214
|
+
*.cab
|
|
215
|
+
*.msi
|
|
216
|
+
*.msix
|
|
217
|
+
*.msm
|
|
218
|
+
*.msp
|
|
219
|
+
|
|
220
|
+
# Windows shortcuts
|
|
221
|
+
*.lnk
|
|
222
|
+
|
|
223
|
+
## Linux
|
|
224
|
+
*~
|
|
225
|
+
|
|
226
|
+
# temporary files which can be created if a process still has a handle open of a deleted file
|
|
227
|
+
.fuse_hidden*
|
|
228
|
+
|
|
229
|
+
# KDE directory preferences
|
|
230
|
+
.directory
|
|
231
|
+
|
|
232
|
+
# Linux trash folder which might appear on any partition or disk
|
|
233
|
+
.Trash-*
|
|
234
|
+
|
|
235
|
+
# .nfs files are created when an open file is removed but is still being accessed
|
|
236
|
+
.nfs*
|
|
237
|
+
|
|
238
|
+
## Vim
|
|
239
|
+
# Swap
|
|
240
|
+
[._]*.s[a-v][a-z]
|
|
241
|
+
!*.svg # comment out if you don't need vector files
|
|
242
|
+
[._]*.sw[a-p]
|
|
243
|
+
[._]s[a-rt-v][a-z]
|
|
244
|
+
[._]ss[a-gi-z]
|
|
245
|
+
[._]sw[a-p]
|
|
246
|
+
|
|
247
|
+
# Session
|
|
248
|
+
Session.vim
|
|
249
|
+
Sessionx.vim
|
|
250
|
+
|
|
251
|
+
# Temporary
|
|
252
|
+
.netrwhist
|
|
253
|
+
# Auto-generated tag files
|
|
254
|
+
tags
|
|
255
|
+
# Persistent undo
|
|
256
|
+
[._]*.un~
|
|
257
|
+
/documentation_todos.md
|
pdfrender-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cameron Ratchford
|
|
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.
|
pdfrender-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pdfrender
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Using DB models and Jinja2 to generate templated PDF documents
|
|
5
|
+
Author-email: Cam Ratchford <camratchford@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/camratchford/pdfrender
|
|
7
|
+
Project-URL: Source, https://github.com/camratchford/pdfrender
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Natural Language :: English
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Operating System :: MacOS
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: byoconfig
|
|
22
|
+
Requires-Dist: typer
|
|
23
|
+
Requires-Dist: jinja2
|
|
24
|
+
Requires-Dist: click
|
|
25
|
+
Requires-Dist: textual
|
|
26
|
+
Requires-Dist: pyyaml
|
|
27
|
+
Requires-Dist: sqlmodel
|
|
28
|
+
Requires-Dist: pydantic
|
|
29
|
+
Requires-Dist: markdown
|
|
30
|
+
Requires-Dist: pymdown-extensions
|
|
31
|
+
Requires-Dist: pygments
|
|
32
|
+
Requires-Dist: weasyprint
|
|
33
|
+
Provides-Extra: development
|
|
34
|
+
Requires-Dist: pytest; extra == "development"
|
|
35
|
+
Requires-Dist: pytest-cov; extra == "development"
|
|
36
|
+
Requires-Dist: isort; extra == "development"
|
|
37
|
+
Requires-Dist: ruff; extra == "development"
|
|
38
|
+
Requires-Dist: build; extra == "development"
|
|
39
|
+
Provides-Extra: docs
|
|
40
|
+
Requires-Dist: mkdocs~=1.6; extra == "docs"
|
|
41
|
+
Requires-Dist: mkdocs-autorefs~=1.4; extra == "docs"
|
|
42
|
+
Requires-Dist: mkdocs-get-deps~=0.2.2; extra == "docs"
|
|
43
|
+
Requires-Dist: mkdocs-material~=9.7; extra == "docs"
|
|
44
|
+
Requires-Dist: mkdocs-material-extensions~=1.3; extra == "docs"
|
|
45
|
+
Requires-Dist: mkdocstrings~=1.0; extra == "docs"
|
|
46
|
+
Requires-Dist: mkdocstrings-python~=2.0; extra == "docs"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
# pdfrender
|
|
50
|
+
|
|
51
|
+
A database relationship and template-driven Markdown to PDF toolkit.
|
|
52
|
+
|
|
53
|
+
Bring your own SQLAlchemy/SQLModel models, YAML data, and Jinja2 templates.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
- Type-aware model importing DB data from YAML. Supports nested instance data for dynamically assigning relationships.
|
|
57
|
+
- Facilities to perform DB queries inside the Jinja2 template context
|
|
58
|
+
- Custom Jinja2 Environment object:
|
|
59
|
+
- Pre-processes templates to support typed variables, allowing template authors to specify variable types
|
|
60
|
+
using PEP 484 annotation syntax.
|
|
61
|
+
- Stores undefined variables, allowing for run-time user variable prompts
|
|
62
|
+
- Dynamically composed Textual CLI form, to capture run-time user variable inputs
|
|
63
|
+
|
|
64
|
+
## Documentation
|
|
65
|
+
|
|
66
|
+
Published at https://camratchford.github.io/pdfrender/ (deployed on release,
|
|
67
|
+
see below). To view locally instead:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install -e ".[docs]"
|
|
71
|
+
mkdocs serve -f extras/docs/mkdocs.yml
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Then open http://127.0.0.1:8000.
|
|
75
|
+
|
|
76
|
+
## Releasing
|
|
77
|
+
|
|
78
|
+
The package version comes from git tags via `setuptools-scm` - there's
|
|
79
|
+
nothing to bump by hand in `pyproject.toml`. To cut a release:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git tag v0.1.0
|
|
83
|
+
git push --tags
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Pushing a `v*` tag triggers `.github/workflows/release.yml`, which builds
|
|
87
|
+
the package and publishes it to PyPI (via
|
|
88
|
+
[trusted publishing](https://docs.pypi.org/trusted-publishers/), no stored
|
|
89
|
+
token needed), and deploys `extras/docs` to GitHub Pages.
|
|
90
|
+
|
|
91
|
+
One-time setup this repo needs before that works:
|
|
92
|
+
|
|
93
|
+
- **PyPI**: add a trusted publisher on the
|
|
94
|
+
[pdfrender PyPI project](https://pypi.org/manage/project/pdfrender/publishing/)
|
|
95
|
+
pointing at this repo and the `release.yml` workflow.
|
|
96
|
+
- **GitHub Pages**: under Settings -> Pages, set Source to "GitHub Actions".
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# pdfrender
|
|
2
|
+
|
|
3
|
+
A database relationship and template-driven Markdown to PDF toolkit.
|
|
4
|
+
|
|
5
|
+
Bring your own SQLAlchemy/SQLModel models, YAML data, and Jinja2 templates.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- Type-aware model importing DB data from YAML. Supports nested instance data for dynamically assigning relationships.
|
|
9
|
+
- Facilities to perform DB queries inside the Jinja2 template context
|
|
10
|
+
- Custom Jinja2 Environment object:
|
|
11
|
+
- Pre-processes templates to support typed variables, allowing template authors to specify variable types
|
|
12
|
+
using PEP 484 annotation syntax.
|
|
13
|
+
- Stores undefined variables, allowing for run-time user variable prompts
|
|
14
|
+
- Dynamically composed Textual CLI form, to capture run-time user variable inputs
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
Published at https://camratchford.github.io/pdfrender/ (deployed on release,
|
|
19
|
+
see below). To view locally instead:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install -e ".[docs]"
|
|
23
|
+
mkdocs serve -f extras/docs/mkdocs.yml
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then open http://127.0.0.1:8000.
|
|
27
|
+
|
|
28
|
+
## Releasing
|
|
29
|
+
|
|
30
|
+
The package version comes from git tags via `setuptools-scm` - there's
|
|
31
|
+
nothing to bump by hand in `pyproject.toml`. To cut a release:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git tag v0.1.0
|
|
35
|
+
git push --tags
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Pushing a `v*` tag triggers `.github/workflows/release.yml`, which builds
|
|
39
|
+
the package and publishes it to PyPI (via
|
|
40
|
+
[trusted publishing](https://docs.pypi.org/trusted-publishers/), no stored
|
|
41
|
+
token needed), and deploys `extras/docs` to GitHub Pages.
|
|
42
|
+
|
|
43
|
+
One-time setup this repo needs before that works:
|
|
44
|
+
|
|
45
|
+
- **PyPI**: add a trusted publisher on the
|
|
46
|
+
[pdfrender PyPI project](https://pypi.org/manage/project/pdfrender/publishing/)
|
|
47
|
+
pointing at this repo and the `release.yml` workflow.
|
|
48
|
+
- **GitHub Pages**: under Settings -> Pages, set Source to "GitHub Actions".
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# pdf_render.md
|
|
2
|
+
|
|
3
|
+
::: pdf_render.md.create_markdown_renderer
|
|
4
|
+
|
|
5
|
+
## Extensions
|
|
6
|
+
|
|
7
|
+
::: pdf_render.md.extensions.FlexColumnsExtension
|
|
8
|
+
|
|
9
|
+
::: pdf_render.md.extensions.FlexWrapExtension
|
|
10
|
+
|
|
11
|
+
::: pdf_render.md.extensions.MutedTextExtension
|
|
12
|
+
|
|
13
|
+
::: pdf_render.md.extensions.NerdfontGlyphExtension
|
|
14
|
+
|
|
15
|
+
::: pdf_render.md.extensions.PageBreakExtension
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# pdf_render.templates
|
|
2
|
+
|
|
3
|
+
::: pdf_render.templates.new_template_environment
|
|
4
|
+
|
|
5
|
+
::: pdf_render.templates.TypedVariableEnvironment
|
|
6
|
+
|
|
7
|
+
## Filters
|
|
8
|
+
|
|
9
|
+
::: pdf_render.templates.filters.jinja_filter_month_year_fmt
|
|
10
|
+
|
|
11
|
+
::: pdf_render.templates.filters.jinja_filter_phone_num_fmt
|
|
12
|
+
|
|
13
|
+
::: pdf_render.templates.filters.jinja_filter_get_list_item_by_attr
|
|
14
|
+
|
|
15
|
+
::: pdf_render.templates.filters.jinja_filter_with_item_attr_first
|