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. Autofit(mode="header") and "none" preserve a single LazyFrame evaluation; "body" and "all" evaluate it twice.

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

Release files for neatxlsx 0.2.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 neatxlsx 0.2.0
File Size Uploaded
neatxlsx-0.2.0.tar.gz 76.0 kB Details

Built distributions (wheels)

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

Total release size: 31.9 MB

Release files / neatxlsx-0.2.0.tar.gz

Download URL neatxlsx-0.2.0.tar.gz
Size 76.0 kB
Tags Source
SHA-256 checksum
How to use checksums
df177ac692adcdeec52a5c89b4b3fdad860fcb162324bd7914f8cdad0e554159
BLAKE2b-256 checksum
How to use checksums
4291ac4084db326f1e78e5c6447e911a9e9cb1adc38b8910859196ea6b394efe
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 Aug 24, 2026.

Transparency log

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

Download URL neatxlsx-0.2.0-cp311-abi3-win_amd64.whl
Size 6.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0d7991295609189e82e66a9faae19732a17dcd5c58bff3886aec022b774c401d
BLAKE2b-256 checksum
How to use checksums
83ad0d784e1a3e463ea4442acd6a5a46c57fc1ef040381951c376fbd89e98b78
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 Aug 24, 2026.

Transparency log

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

Download URL neatxlsx-0.2.0-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
045b4d0c8c46ebfa951725acadd806a9f70e4e0191f74ccdc5ec6ecbb27d159e
BLAKE2b-256 checksum
How to use checksums
85727b387b0506e309b7312fc079038343b611ac200c37f0136e1bcf789c3900
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 Aug 24, 2026.

Transparency log

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

Download URL neatxlsx-0.2.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 6.4 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
402fc55ea395311270f506a5a4163373d9f84dedd733ce04eef8d6a08100b63f
BLAKE2b-256 checksum
How to use checksums
7f0eb416c917b9f0f6704e3b432d6a4a5c7276b2ad45e75953f9378052d492a2
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 Aug 24, 2026.

Transparency log

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

Download URL neatxlsx-0.2.0-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
f5d5d7ebf9f8a993a3a7bafb9b6f194534b8155644ba3eb3d309d66489aa9115
BLAKE2b-256 checksum
How to use checksums
f1b35db99bb866833ff3caeb19858be0bad36c389452a3d82281dee284eeee44
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 Aug 24, 2026.

Transparency log

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

Download URL neatxlsx-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 6.3 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c2d9aa95688aaca6710e40fbbd4358fa00aa74c1e43621a85b8f77ee5abcc10d
BLAKE2b-256 checksum
How to use checksums
9498665435b29ecf9768fa73f2bf334e169af5b922eb236b493220ed6254d7c8
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 Aug 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

6 release files

This release

0.2.0 This release

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