WSGI routing library weasyprint plugin
Project description
Weasyprint plugin for wsgirouter3
Usage
Configure application to use plugin
def _generator(html_id: str, context: Any) -> str:
# your choice of template engine
application = wsgirouter3.WsgiApp(router)
wsgirouter3_weasyprint.install(
application,
wsgirouter3_weasyprint.PdfConfig(html_generator=_generator)
)
Return instance of Pdf from endpoint
@router.get('/get', produces='application/pdf')
def get() -> Pdf:
html_generation_ctx = {'context': 'variable'}
return Pdf('html_template_id', html_generation_ctx)
Installation
$ pip install wsgirouter3_weasyprint
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
Close
Hashes for wsgirouter3_weasyprint-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 871963ee676816417d97651e9bba6d1e81c4bb3220bdadb585b19d14104f925d |
|
MD5 | 9efb916140404e456afdd64f56f5a4e9 |
|
BLAKE2b-256 | 4219cfcde0d2de2c167425eb2226eb0f89d027affb29bfec9a2121e319e41b6b |
Close
Hashes for wsgirouter3_weasyprint-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ffbc8481185023eec8819109fc93c512858917882b39afae738be596618b1ad |
|
MD5 | 48a113500b6b301def8a19d855eca0f3 |
|
BLAKE2b-256 | 61bd7c1925582d0434de8142cf27eb3abf3a3bbdf1f3429f1d7b05ca89e890c3 |