Skip to main content

neatxlsx

neatxlsx is an opinionated XLSX report-table writer for Polars. It turns DataFrames and streaming LazyFrames into consistently formatted workbooks while keeping multi-row headers, freeze panes, large/wide-table splitting, and transactional delivery behind one small API.

Installation

pip install neatxlsx

Python 3.11 or newer and Polars 1.38.1 or newer are required.

Quick start

import neatxlsx as nx
import polars as pl

data = pl.DataFrame(
    {
        "Sample": ["A", "B"],
        "Count": [12, 18],
        "Score": [0.125, 0.375],
    }
)

with nx.Workbook("report.xlsx") as workbook:
    workbook.write_sheet(
        data,
        "Results",
        integer_columns="Count",
        decimal_columns="Score",
        freeze_columns=1,
    )

Workbook writes to a sibling temporary file. Normal context-manager exit atomically replaces the target where the filesystem supports atomic rename; exceptional exit discards the temporary workbook and leaves an existing target untouched.

Formats and policies

import neatxlsx as nx
import polars.selectors as cs

with nx.Workbook(
    "report.xlsx",
    header_format=nx.Format(bg_color="#D9EAF7"),
    decimal_format=nx.Format(num_format="0.000"),
) as workbook:
    workbook.write_sheet(
        data,
        "Results",
        header_column_formats={"Sample": nx.Format(font_name="Arial")},
        column_formats={"Score": nx.Format(font_color="#1F4E78")},
        integer_columns=cs.integer(),
        decimal_columns=cs.float(),
        autofit=nx.Autofit(mode="all", max_rows=10_000),
        scientific_notation=nx.ScientificNotation(scope="decimal"),
    )

Column arguments accept one name/index, an ordered sequence, or a Polars selector. Explicit integer and decimal selections override inferred roles for those columns; other columns remain inferred unless the matching infer_* option is disabled.

header_column_formats maps one logical data-column name or zero-based index to a header Format patch. It applies to the generated header and every custom header row, after the workbook header format and any header_row_formats row patch. column_formats remains body-only. Nonempty header-column patches cannot be combined with merge_header=True because a merged range has no unambiguous per-column style.

Large workbooks

ZIP64 is enabled by default because XLSX size depends on uncompressed worksheet XML and cannot be predicted reliably before streaming. Use nx.Workbook(..., use_zip64=False) only when a downstream reader lacks ZIP64 support. Every autofit mode consumes one LazyFrame batch stream. For "body" and "all", column widths are tracked while rows are written and applied only after that stream is exhausted.

See the documentation map for the complete API, lifecycle, testing, and release contracts.

For detailed pass-count, sampling, and temporary-file behavior, read the streaming and autofit architecture. Existing axiomkit callers can use the migration guide; contributors can use the benchmark protocol.

Release files for neatxlsx 0.2.1

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

Source distribution (sdist)

Source distribution for neatxlsx 0.2.1
File Size Uploaded
neatxlsx-0.2.1.tar.gz 77.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for neatxlsx 0.2.1
File
neatxlsx-0.2.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
neatxlsx-0.2.1-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
neatxlsx-0.2.1-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
neatxlsx-0.2.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
neatxlsx-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 32.0 MB

Release files / neatxlsx-0.2.1.tar.gz

Download URL neatxlsx-0.2.1.tar.gz
Size 77.4 kB
Tags Source
SHA-256 checksum
How to use checksums
77aef84e184e321595f45058452c2ceaaab7054fed118af01b0c9bc724c8580b
BLAKE2b-256 checksum
How to use checksums
5cc908a5886e87f68cbeddf0410acdd6a5cb8d8929f735150ab9c3948f8cb5f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 8, 2026.

Transparency log

Release files / neatxlsx-0.2.1-cp311-abi3-win_amd64.whl

Download URL neatxlsx-0.2.1-cp311-abi3-win_amd64.whl
Size 6.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
71fd5177af5354148c745f563c5cb2b2455ad5f9ecfa222222036811f00db3fe
BLAKE2b-256 checksum
How to use checksums
2b529dbea2cbb6cbd392fd83577dbf523f7ca7b946289bfea3b853e679309104
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 8, 2026.

Transparency log

Release files / neatxlsx-0.2.1-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL neatxlsx-0.2.1-cp311-abi3-manylinux_2_28_x86_64.whl
Size 6.8 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
eed1fc963332b87c95ddb008b3a7b7d01a5ef32c1baa911875d9e56d995dd8a3
BLAKE2b-256 checksum
How to use checksums
f2a59badf197aa62895290eb9a02b3ecdb918a7f817b94140a01bb53fec730a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 8, 2026.

Transparency log

Release files / neatxlsx-0.2.1-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL neatxlsx-0.2.1-cp311-abi3-manylinux_2_28_aarch64.whl
Size 6.5 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
329f89851835458bd0f34b96f317837eb3829c4165cd0c0c0ea935306069d2f8
BLAKE2b-256 checksum
How to use checksums
0837ad90619bbe8caa0ec7a7098bc98e93357cd148077b3a97380f9b72bc553c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 8, 2026.

Transparency log

Release files / neatxlsx-0.2.1-cp311-abi3-macosx_11_0_arm64.whl

Download URL neatxlsx-0.2.1-cp311-abi3-macosx_11_0_arm64.whl
Size 5.9 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f9d72b20f101f7c7deb94c127cd7555eea7567d59d835e40f4c1e361f5650fb7
BLAKE2b-256 checksum
How to use checksums
9b2620198742adc8fd464ec7fb6f3ae9b7bf2cbe0540b712fcef1d97e240beef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 8, 2026.

Transparency log

Release files / neatxlsx-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL neatxlsx-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl
Size 6.4 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
65dc3264590f0bc6ff1568031cd31594a441ab91b8faee4364bb750ca007483c
BLAKE2b-256 checksum
How to use checksums
dfe74b79cb682be22e7ea1092aa80ef33ee5660b6c6a240854214d53dd39c9b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

6 release files

0.2.0

6 release files

0.1.0

6 release files

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