Skip to main content

Fill in PDF forms

Project description

Upload Python Package

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etb_pdf-0.1.2.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

etb_pdf-0.1.2-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page