Skip to main content

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

Project description

turbo-xlsx-rs (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). Country-agnostic: locale and ISO-4217 currency code are inputs, never hardcoded.

Install

pip install turbo-xlsx-rs          # lean writer
pip install turbo-xlsx-rs-parse    # writer + XLSX reader (adds parse())

The PyPI distribution is turbo-xlsx-rs (PyPI rejects turbo-xlsx as too close to the existing turboxlsx); the import name stays turbo_xlsx either way. The -parse wheel adds an .xlsx reader — pick whichever variant you need.

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).
  • parse(data, format=None, sheet=None, typed=False) -> strturbo-xlsx-rs-parse wheel only. Read an .xlsx (incl. DEFLATE-compressed) into JSON (values grid or typed=True model), format="csv", or format="md". ~10× faster than openpyxl at reading, cell-for-cell verified against it.

opts is an optional dict {meta: {title, author, subject, company}, locale?, password?}. Setting password encrypts the output with ECMA-376 Agile Encryption (AES-256) — x.write(wb, {"password": "s3cret"}) — which Excel/LibreOffice open with that password.

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.3.tar.gz (84.2 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.3-cp38-abi3-win_amd64.whl (601.4 kB view details)

Uploaded CPython 3.8+Windows x86-64

turbo_xlsx_rs-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (722.4 kB view details)

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

turbo_xlsx_rs-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (690.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

turbo_xlsx_rs-0.1.3-cp38-abi3-macosx_11_0_arm64.whl (645.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for turbo_xlsx_rs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 db738204dd8b1cac0c6dd3d8bc640261c39e314cf245559fd3db091142702c7f
MD5 2994097b9d11651a65055e6dd5ff4628
BLAKE2b-256 4f2da58d993b1e6a056d876054775793593026dd811182c19b337bad06a18fa1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2c0b2cbd1dc28c7d25b7323e2460d3780096bf29fae283debb5de826df63a98d
MD5 d473f6a81d957138ae8a409282aac90d
BLAKE2b-256 991b8d50078133a4c8a1354b841af23346c96bb6f9f2e0eaf802cf5a345751f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4654bbed22deadc3bb2b3480ffe0e9858887a6687bdea1973bce6ff7534b1f89
MD5 5c3e2a5aa0a95c0256a9ea2797fa98be
BLAKE2b-256 ddade57680177a99574bfca27a2e46e66848e8298630b346ccf419842035dc29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c5a88468acb85cc1d855bf45d62f8734591cd896de19c05e8e9cded1e6dcdeaf
MD5 381317d3a1a7f5c5c71040528e939ff9
BLAKE2b-256 77c7063845966f6921e658d42f1666d5eb7db175a78d8e4616734d1f9a53d048

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 81d61dd0197c327630e9860169cd708a19f86b5f64a1a6c83f6cb74d52eb294a
MD5 122affb741b67c2328d42dee5b10a4c7
BLAKE2b-256 7df64c7955d834b9e62aaab25ffe8f21b5e423e5ec21f2f708f637ed68cdab1c

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