Forge
shortcuts
Many usefull modules are grouped in the paxpar.shortcuts.forge module.
It's always a good idea to import it first :
shortcuts
Many usefull modules are grouped in the paxpar.shortcuts.forge module.
It's always a good idea to import it first :
# start all your forge notebook with this
from paxpar.shortcuts.forge import *
common modules
Common Python modules that are already imported by the shortcuts module :
datetimeto handle date and timehttpxto handle web requestjinja2to handle templatejsonto handle JSON contentopenpyxlto handle Microsoft Excel filesPathfrom pathlib to handle local filespd(pandas renamed) to handle tabular datareloadfrom importlib to reload modulerequeststo handle web requesttempfileto hangle temporary filesxmltodictto handle XML contentyamlto handle YAML content
paxpar tools
actor_getadd_metadatasAuthContextcertificates_gencertificates_getconvert_odt2pdfcopy_finalfacticepaxpar_api_setpaxpar_api_statussign_pdftemplate_odt
template_odt()
Fill a LibreOffice ODT template with the given data.
>>> data = { 'x': 33, 'hello': 'world' }
>>> template_odt("tests/data/template.odt", '/tmp/dbg_pp_templated.odt', data)
convert_odt2pdf()
Convert a LibreOffice ODT file to a PDF file.
>>> await convert_odt2pdf('/tmp/dbg_pp_templated.odt', '/tmp/dbg_pp_raw.pdf')
factice()
Add to a PDF a foreground watermark/banner.
>>> factice('/tmp/dbg_pp_raw.pdf', '/tmp/dbg_pp_raw2.pdf')
add_metadatas()
Add to a PDF some files to attach, some XMP tags and some metadata.
>>> schema_id = 'https://paxpar.tech/schema/xxx/3'
>>> meta = { 'x': 33, 'hello': 'world' }
>>> tags = { 'section' : 'demo' }
>>> attachments = { 'sample.xlsx' : '/tmp/sample.xlsx'}
>>> add_metadatas('/tmp/dbg_pp_raw2.pdf', '/tmp/dbg_pp_augmented.pdf', attachments, tags, meta, schema_id)
sign_pdf()
Sign or start the signing process of a PDF given a sign workflow definition.
>>> signature = { 'provider' : 'SELF', 'email' : 'support@paxpar.tech' }
>>> await sign_pdf('/tmp/dbg_pp_augmented.pdf', signature, '/tmp/dbg_pp_final.pdf')