Fill in PDF forms
Project description
Pdf.write() args:
rows: list of dictionaries of data to be filled into PDF
map(optional): dictionary that maps values from rows to field names in the PDF
for example, if fields are ["Name", "Age"]
and rows are [{"foo" : "John", "bar" : 25}, {"foo" : "Jane", "bar" : 30}],
then map should be: {"Name" : "foo", "Age" : "bar"}
naming(optional): very simple naming convention dict.
naming["static_name"] will be the first part of the file name
naming["dynamic_name_key"] will be appended after a underscore. it will pull the (post mapping, if applicable) key value from each row and append it to the file name.
for example (using the rows and map from above), if naming = {"static_name" : "output", "dynamic_name_key" : "Name"}
then the file names will be: "output_John.pdf" and "output_Jane.pdf"
required_keys: if map is not None: if True, all values in map dictionary will be asserted
if you pass an iterable, then each value in the map dictionary that is in the iterable will be asserted
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file etb_pdf-0.1.2.tar.gz
.
File metadata
- Download URL: etb_pdf-0.1.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dff8fad4e35a707ec3422ff00e0251ddcbe424a951380594a55acd24f40163a |
|
MD5 | 1ac3d347d9b476589a32a2c0d526ff73 |
|
BLAKE2b-256 | 78af2ace559087f4a2bae6b9db87199e239ce50100660bbec5a52b67432ab2bb |
File details
Details for the file etb_pdf-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: etb_pdf-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22ba45a86f6d68e4075b78ea87a3ca238b5a3092aef514bbd233119a92236e98 |
|
MD5 | 04bba30875206fd201ef1d5a5737842e |
|
BLAKE2b-256 | 158b6b42c98372da9f3cd03df59d360124c9d4f340b2daa4ced1a25b8eb182b1 |