Skip to main content

Native workbook-model-to-XLSX writer (PyO3 binding over the turbo-xlsx Rust core).

Project description

turbo-xlsx (Python)

Native workbook-model-to-XLSX writer — a PyO3 binding over the turbo-xlsx Rust core. Turn a structured workbook into a formatted .xlsx (OOXML SpreadsheetML, OPC-zipped). Write-only and country-agnostic: locale and ISO-4217 currency code are inputs, never hardcoded.

import turbo_xlsx as x

wb = {
    "sheets": [
        {
            "name": "Pay",
            "rows": [
                {"cells": [
                    {"type": "string", "value": "Alice"},
                    {"type": "currency", "value": 123456,
                     "currency": {"code": "MXN", "locale": "es-MX"}},
                ]}
            ],
        }
    ]
}

data = x.write(wb)            # -> bytes, starts with b"PK" (xlsx is a zip)
assert data.startswith(b"PK")

API

  • write(workbook, opts=None) -> bytes — one-shot from a workbook dict.
  • write_full(workbook, opts=None) -> (bytes, list) — also returns lint diagnostics.
  • write_from_json(input, opts=None) -> bytesinput is a JSON string or value.
  • write_rows(input, opts=None) -> bytes — fast-path: one sheet from typed columns + rows ({sheetName?, locale?, columns?, rows}).
  • create_writer(opts=None) -> WorkbookWriter / WorkbookWriter(locale=None, opts=None) — row-by-row streaming: start_sheet, write_row, end_sheet, finish() -> (bytes, list).

opts is an optional dict {meta: {title, author, subject, company}, locale?}.

Fatal validate/write faults raise TurboXlsxError (with .code and .message). Non-fatal lints are returned, never raised.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

turbo_xlsx_rs-0.1.1.tar.gz (73.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

turbo_xlsx_rs-0.1.1-cp38-abi3-win_amd64.whl (530.8 kB view details)

Uploaded CPython 3.8+Windows x86-64

turbo_xlsx_rs-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (653.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

turbo_xlsx_rs-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (628.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

turbo_xlsx_rs-0.1.1-cp38-abi3-macosx_11_0_arm64.whl (588.9 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file turbo_xlsx_rs-0.1.1.tar.gz.

File metadata

  • Download URL: turbo_xlsx_rs-0.1.1.tar.gz
  • Upload date:
  • Size: 73.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for turbo_xlsx_rs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2202714ee38717aa81c0222aed40048b1489bfd37c8cf41a14c491f27b2b1a54
MD5 06ed4f302da5cf978120c0824bfc0e17
BLAKE2b-256 90ea39dd49ab3de1b69aeea68fdf9c57c15c09c07dfcd25bc767ac22fdfa1b5f

See more details on using hashes here.

File details

Details for the file turbo_xlsx_rs-0.1.1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 782b25a8a646efb70a9e1fd1aea37f9bbbe18133ea2d9f37ce964081633afde6
MD5 a7c9aa59dfcf69b4ea06fbbe97bfc108
BLAKE2b-256 6cd8d823eddbf296f227250966aec1e71ece3502525c6fb536213093b7c35305

See more details on using hashes here.

File details

Details for the file turbo_xlsx_rs-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 250b9a0f3f973360d5b703ac6cdfdeca18feeac6e6595d36864ea67278938349
MD5 33425d2ba1f6466370b3a35b5b3735a2
BLAKE2b-256 32e2b15a8cffaedb49dac6aea3665534dc08970b0a5d1ad0c3e527520e245a8e

See more details on using hashes here.

File details

Details for the file turbo_xlsx_rs-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e84efa30b77f4c2dcfd7498387a3ed5df5bba7a0e3c0eb6ea660f5da7c0f4999
MD5 f5331fd89f7a0b4ea6b654b37bff074a
BLAKE2b-256 969b9a34116bbda96e2c4c02336e7cf4ca05054ed95d82276df699c7dbecbad7

See more details on using hashes here.

File details

Details for the file turbo_xlsx_rs-0.1.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 067bbfefc1f8e00a5cfb59bdb07c99f5639ace77966bd4b8caa16f05af05466b
MD5 b831c733b9d35f4dfe2098696c7a29ff
BLAKE2b-256 bb53cd8d9c4a5da0bcf4ca503899ead011fd4d0ad8a85eb5625056758c976552

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page