Skip to main content

sinpapel-reports

Pluggable, template-driven document generation (PDF overlay + DOCX) for the sinpapel ecosystem.

What it does

Render per-record documents by stamping live data onto a PDF template at pixel coordinates (ReportLab + pypdf) or filling a DOCX template (docxtpl). Output is persisted as sinpapel.InstanciaDocumento, optionally bundled as a ZIP.

Install

pip install sinpapel-reports

Add "sinpapel_reports" to INSTALLED_APPS (after "sinpapel").

Plug in your data

Declare a reports.py in any installed app:

from sinpapel_reports.data_sources import CampoReporte, register_data_source


@register_data_source
class SolicitudDataSource:
    name = "solicitud"

    def get_field_catalog(self):
        return [CampoReporte(key="folio", label="Folio")]

    def build_context(self, target):
        return {"folio": target.id}

Point a Documento.configuracion_overlay["data_source"] at "solicitud" and call ReportEngine.generar(documento, target).

REST (optional)

Install the drf extra and include("sinpapel_reports.drf.urls").

Endpoints (relative to the mount prefix):

Method Path Description
GET field-catalog/?source=<name> Field palette for the named data source
GET documentos/<pk>/overlay-config/ Read stored overlay config
PUT documentos/<pk>/overlay-config/ Persist overlay config (validated)
POST documentos/<pk>/generate/ Generate; returns {"instancia_id","filename"}
GET instancias/<pk>/download/ Download generated file as attachment

Auth: views require IsAuthenticated by default. Override via settings.SINPAPEL_REPORTS_PERMISSION_CLASSES.

Extensibility: register custom renderers with ReportEngine.register_renderer("XLSX", my_renderer).

License

sinpapel-reports is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

sinpapel-reports is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Metadata

Release files for sinpapel-reports 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinpapel-reports 0.2.5
File Size Uploaded Provenance Actions
sinpapel_reports-0.2.5.tar.gz 33.8 kB Without provenance Details for sinpapel_reports-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sinpapel-reports 0.2.5
File Interpreter ABI Platform Actions
sinpapel_reports-0.2.5-py3-none-any.whl Python 3 none any Details for sinpapel_reports-0.2.5-py3-none-any.whl

Total release size: 63.0 kB

Release files / sinpapel_reports-0.2.5.tar.gz

Download URL sinpapel_reports-0.2.5.tar.gz
Size 33.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b4634730c3ddfb3a868c89a0b2c78e2555734329109432ef611b1aa66b4a5d51
BLAKE2b-256 checksum
How to use checksums
6af255addceebc73233787da9a3aded875741a9df54a269b1d49828694e06034
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / sinpapel_reports-0.2.5-py3-none-any.whl

Download URL sinpapel_reports-0.2.5-py3-none-any.whl
Size 29.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20a6dc91905b4f578575cd410e187e27997d079c1270f0f3f027d98dee784e89
BLAKE2b-256 checksum
How to use checksums
00eabe08b6771bdd342902d25a973272e4607efda3b6664823694a4c3ca09acd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for sinpapel-reports 0.2.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page