Skip to main content

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


Download files

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

Source Distribution

wsgirouter3_weasyprint-0.1.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

wsgirouter3_weasyprint-0.1.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file wsgirouter3_weasyprint-0.1.2.tar.gz.

File metadata

File hashes

Hashes for wsgirouter3_weasyprint-0.1.2.tar.gz
Algorithm Hash digest
SHA256 871963ee676816417d97651e9bba6d1e81c4bb3220bdadb585b19d14104f925d
MD5 9efb916140404e456afdd64f56f5a4e9
BLAKE2b-256 4219cfcde0d2de2c167425eb2226eb0f89d027affb29bfec9a2121e319e41b6b

See more details on using hashes here.

File details

Details for the file wsgirouter3_weasyprint-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for wsgirouter3_weasyprint-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ffbc8481185023eec8819109fc93c512858917882b39afae738be596618b1ad
MD5 48a113500b6b301def8a19d855eca0f3
BLAKE2b-256 61bd7c1925582d0434de8142cf27eb3abf3a3bbdf1f3429f1d7b05ca89e890c3

See more details on using hashes here.

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