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 + PyPDF2) 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
GPL-3.0-or-later.
Metadata
Release files for sinpapel-reports 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sinpapel_reports-0.2.3.tar.gz | 32.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sinpapel_reports-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.0 kB
Release files / sinpapel_reports-0.2.3.tar.gz
| Download URL | sinpapel_reports-0.2.3.tar.gz |
|---|---|
| Size | 32.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70cb326170f008e35619d97a69ec54b03eebce89839c0847360c4c866a2dab87
|
|
BLAKE2b-256 checksum How to use checksums |
2d8a0cc5b92891820d11be303266ba068b04b1062ce64b296aeed3f41b2c2b31
|
| 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.3-py3-none-any.whl
| Download URL | sinpapel_reports-0.2.3-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8008018a3ff2ef61c5011fc9b1c1554048b31a5e1e68633b188ed1a2fff9a80f
|
|
BLAKE2b-256 checksum How to use checksums |
e9f62a66ec96e408ff90907375d377e59d9615cc0c6ffee6d45779862e78d782
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|