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 :
datetime
to handle date and timehttpx
to handle web requestjinja2
to handle templatejson
to handle JSON contentopenpyxl
to handle Microsoft Excel filesPath
from pathlib to handle local filespd
(pandas renamed) to handle tabular datareload
from importlib to reload modulerequests
to handle web requesttempfile
to hangle temporary filesxmltodict
to handle XML contentyaml
to handle YAML content
paxpar tools
actor_get
add_metadatas
AuthContext
certificates_gen
certificates_get
convert_odt2pdf
copy_final
factice
paxpar_api_set
paxpar_api_status
sign_pdf
template_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')