Skip to main content

flat-file-renderers

License Python QA Coverage Publish Docs pre-commit

Render tabular/nested datasets - a list of dicts, a dict of {"rows": [...], "cols": [...]}, a QuerySet-like iterable, or record/model objects - into xlsx, csv, tsv, json, html or parquet files, zipped. Nested lists of dicts are flattened automatically into dot+index-notation columns (contacts.1.phone, contacts.2.phone, ...), and a dict[str, dataset] renders one file per key into the same zip (one sheet per key for xlsx, one file per key for the others).

No required dependencies for csv/tsv/json/html. xlsx and parquet are optional extras.

Installation

pip install flat-file-renderers            # csv, tsv, json, html - zero extra dependencies
pip install flat-file-renderers[xlsx]       # + openpyxl, for XlsxRenderer
pip install flat-file-renderers[parquet]    # + pyarrow, for ParquetRenderer
pip install flat-file-renderers[all]        # everything

Quick start

from flat_file_renderers import CsvRenderer

renderer = CsvRenderer({})
zip_path = renderer.render({"dataset": [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]})
# zip_path -> Path to a .zip containing one .csv
from flat_file_renderers.xlsx import XlsxRenderer  # requires the "xlsx" extra

renderer = XlsxRenderer({})
zip_path = renderer.render({"dataset": {"Students": [{"name": "Alice"}], "Courses": [{"title": "Python"}]}})
# zip_path -> Path to a .zip containing one .xlsx with two sheets

Every renderer shares the same interface (BaseRenderer.render(context) -> Path, where context["dataset"] holds the data), so switching output formats is a one-line change:

from flat_file_renderers import CsvRenderer, TsvRenderer, JsonRenderer, HtmlRenderer
from flat_file_renderers.xlsx import XlsxRenderer
from flat_file_renderers.parquet import ParquetRenderer

for Renderer in (CsvRenderer, TsvRenderer, JsonRenderer, HtmlRenderer, XlsxRenderer, ParquetRenderer):
    zip_path = Renderer({}).render({"dataset": rows})

Runnable examples for every renderer live in sandbox/.

Modules

  • flat_file_renderers.base - BaseRenderer, ZipFileEntry
  • flat_file_renderers.flat_dict_list_helper - FlatDictListHelper, the flattening engine shared by every renderer
  • flat_file_renderers.separated_value - CsvRenderer, TsvRenderer
  • flat_file_renderers.json - JsonRenderer (JSON Lines/NDJSON: one object per line, .jsonl)
  • flat_file_renderers.html - HtmlRenderer
  • flat_file_renderers.xlsx - XlsxRenderer (extra: xlsx)
  • flat_file_renderers.parquet - ParquetRenderer (extra: parquet)

See the documentation for details and more examples.

Security

Please report vulnerabilities according to SECURITY.md.

Author

Kelson da Costa Medeiros kelsoncm@gmail.com

Metadata

Release files for flat-file-renderers 0.3.0

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

Source distribution (sdist)

Source distribution for flat-file-renderers 0.3.0
File Size Uploaded Provenance
flat_file_renderers-0.3.0.tar.gz 18.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for flat-file-renderers 0.3.0
File Interpreter ABI Platform
flat_file_renderers-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / flat_file_renderers-0.3.0.tar.gz

Download URL flat_file_renderers-0.3.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6b41a58e51642ee6f8a412541a4f874e2f771b4dd955147752c2adc5fb65e19e
BLAKE2b-256 checksum
How to use checksums
00c946e373623b3d31bea7f66989c9a1a520f7a23ab3e4046585d7754b3b9f3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / flat_file_renderers-0.3.0-py3-none-any.whl

Download URL flat_file_renderers-0.3.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70479869e4131778ca8adeae6fd099836f6d88232d770644cea7c44148bb8d45
BLAKE2b-256 checksum
How to use checksums
8f14f8b178fffac2ca2f62779fb594c3f60da1119c72019c739b44abd85ab616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Security for flat-file-renderers 0.3.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flat_file_renderers-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

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