{"id":41861328,"url":"https://github.com/zipreport/zipreport","last_synced_at":"2026-01-25T11:16:45.824Z","repository":{"id":46105398,"uuid":"284938696","full_name":"zipreport/zipreport","owner":"zipreport","description":"Python PDF reporting library","archived":false,"fork":false,"pushed_at":"2024-12-08T04:31:17.000Z","size":6544,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-29T08:47:37.240Z","etag":null,"topics":["converter","css","js","pdf","python","zipreport"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zipreport.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-04T09:44:45.000Z","updated_at":"2025-02-10T13:36:56.000Z","dependencies_parsed_at":"2023-09-27T06:56:07.217Z","dependency_job_id":"25134e13-c87f-4693-9a2c-2ef1f114f8e7","html_url":"https://github.com/zipreport/zipreport","commit_stats":{"total_commits":29,"total_committers":4,"mean_commits":7.25,"dds":"0.48275862068965514","last_synced_commit":"2fb9dbf4651aee2f54d3fe8da69eb7710e0f94e3"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/zipreport/zipreport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zipreport%2Fzipreport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zipreport%2Fzipreport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zipreport%2Fzipreport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zipreport%2Fzipreport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zipreport","download_url":"https://codeload.github.com/zipreport/zipreport/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zipreport%2Fzipreport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28752667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["converter","css","js","pdf","python","zipreport"],"created_at":"2026-01-25T11:16:45.762Z","updated_at":"2026-01-25T11:16:45.816Z","avatar_url":"https://github.com/zipreport.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZipReport\n\n[![Tests](https://github.com/zipreport/zipreport/workflows/Tests/badge.svg?branch=master)](https://github.com/zipreport/zipreport/actions)\n[![pypi](https://img.shields.io/pypi/v/zipreport-lib.svg)](https://pypi.org/project/zipreport-lib/)\n[![license](https://img.shields.io/pypi/l/zipreport-lib.svg)](https://github.com/zipreport/zipreport/blob/master/LICENSE)\n\n---\n\n**Documentation:** [https://zipreport.github.io/zipreport/](https://zipreport.github.io/zipreport/)\n\n---\n\nTransform HTML templates into beautiful PDF or MIME reports, with full CSS and client Javascript support, under a\npermissive license.\n\n**PagedJS Examples:**\n\n| Example                                                   | Description                                             | Output                                                 |\n|-----------------------------------------------------------|---------------------------------------------------------|--------------------------------------------------------|\n| [pagedjs](examples/code/pagedjs/)                         | Basic PagedJS with matplotlib graphics and radar charts | [PDF](examples/samples/pagedjs_output.pdf)             |\n| [executive_report](examples/code/executive_report/)       | Modern executive report with KPIs, charts, and TOC      | [PDF](examples/samples/executive_report_output.pdf)    |\n| [product_brochure](examples/code/product_brochure/)       | Software product brochure with pricing and testimonials | [PDF](examples/samples/product_brochure_output.pdf)    |\n| [analytics_dashboard](examples/code/analytics_dashboard/) | Single-page site analytics dashboard (A4 landscape)     | [PDF](examples/samples/analytics_dashboard_output.pdf) |\n\n**Highlights**:\n\n- Create your reports using Jinja templates;\n- Customize the Jinja Environment();\n- Dynamic image support (embedding of runtime-generated images);\n- Reports are packed in a single file for easy distribution or bundling;\n- Optional MIME processor to embed resources in a single email message;\n- Support for browser-generated JS content (with zipreport-server);\n- Support for headers, page numbers and ToC (using [PagedJS](https://pagedjs.org/), see details below);\n\n**Requirements**:\n\n- Python \u003e= 3.10\n- Jinja2 \u003e= 3.1\n- Compatible backend for PDF generation (zipreport-server or WeasyPrint);\n\n### v2.x.x breaking changes\n\nStarting with zipreport 2.0.0, support for the electron-based zipreport-cli rendering backend is removed; using\na [zipreport-server](https://github.com/zipreport/zipreport-server) version 2.0.0 or later - preferably using a docker\ncontainer,\nis now the recommended approach.\n\nThe behavior of the JS event approach has also changed; PDF rendering can now be triggered via console message,\ninstead of dispatching an event. **If you use JS events to trigger rendering, you need to update your templates**.\n\nOld method:\n\n```javascript\n    (\n...)\n// signal PDF generation after all DOM changes are performed\ndocument.dispatchEvent(new Event('zpt-view-ready'))\n(...)\n```\n\nNew method, starting with v2.0.0:\n\n```javascript\n    (\n...)\n// signal PDF generation after all DOM changes are performed\nconsole.log('zpt-view-ready')\n(...)\n```\n\n### Installation\n\nInstalling via pip:\n\n```shell script\n$ pip install zipreport-lib\n```\n\n##### TL;DR; example\n\nUsing zipreport-server backend to render a report file:\n\n```python\nfrom zipreport import ZipReport\nfrom zipreport.report import ReportFileLoader\n\n# existing zpt template\nreport_file = \"report.zpt\"\n\n# output file\noutput_file = \"result.pdf\"\n\n# template variables\nreport_data = {\n    'title': \"Example report using Jinja templating\",\n    'color_list': ['red', 'blue', 'green'],\n    'description': 'a long text field with some filler description',\n}\n\n# load report from file\nzpt = ReportFileLoader.load(report_file)\n\n# initialize api client\nclient = ZipReport(\"https://127.0.0.1:6543\", \"secretKey\")\njob = client.create_job(zpt)\n\n# generate a PDF by calling the processor, using the API client\n# this method returns a JobResult\nresult = client.render(job, report_data)\n\n# if PDF generation was successful, save to file\nif result.success:\n    with open(output_file, 'wb') as rpt:\n        rpt.write(result.report.read())\n```\n\n### Testing\n\nRunning the test suite:\n\n```shell script\n$ pip install pytest pillow\n$ pytest tests/\n```\n\nIntegration tests that require a running [zipreport-server](https://github.com/zipreport/zipreport-server)\nare skipped by default. To enable them:\n\n```shell script\n$ ZIPREPORT_SERVER=1 pytest tests/\n```\n\nThe server host, port and API key can be configured via environment variables:\n\n- `ZIPREPORT_API_PORT` - server port (default: 6543)\n- `ZIPREPORT_API_KEY` - API key (default: somePassword)\n\n### Paged.js\n\n[PagedJS](https://www.pagedjs.org/) is an amazing javascript library that performs pagination of HTML documents for\nprint,\nunder MIT license. It acts as polyfill for W3C specification for print, and allows the creation of headers, footers,\npage numbers, table of contents, etc. in the browser.\n\nTo use PagedJS capabilities, [zipreport-server](https://github.com/zipreport/zipreport-server) must be used as a\nbackend.\n\n### Available backends\n\n#### Zipreport-Server\n\n[zipreport-server](https://github.com/zipreport/zipreport-server) is a headless browser daemon orchestrator, designed\nspecifically to work with ZipReport. It can be\neither installed locally or run via docker.\n\nzipreport-server is the only supported backend that enables full usage of client-side JavaScript and leveraging the\nPagedJS\ncapabilities.\n\n#### WeasyPrint\n\nThis backend is provided for compatibility. For new projects, please use zipreport-server.\n\n[WeasyPrint](https://weasyprint.org/) is a popular Python library to generate PDFs from HTML. It doesn't support\nJavaScript,\nand CSS is limited.\n\n## Sponsors\n\nThe [ZipReport Project](https://github.com/zipreport/) is sponsored exclusively by [BlackShield](https://blackshield.pt)\n\n## License\n\nMIT License - see LICENSE file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipreport%2Fzipreport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipreport%2Fzipreport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipreport%2Fzipreport/lists"}