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_parse-0.1.3.tar.gz (84.8 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_parse-0.1.3-cp38-abi3-win_amd64.whl (646.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

turbo_xlsx_rs_parse-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (762.9 kB view details)

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

turbo_xlsx_rs_parse-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (731.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

turbo_xlsx_rs_parse-0.1.3-cp38-abi3-macosx_11_0_arm64.whl (684.4 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for turbo_xlsx_rs_parse-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2f6e1553377b5217de39bae2b689164cf5e0df4d6355657a0c73866e6340a769
MD5 a8faf136893bbfb64e2e6ec4fe5b1968
BLAKE2b-256 5998e626eb2a1993e7a86f9df452c15c1fa43a095b0f8e1d39762088507d38f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs_parse-0.1.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ac9992de33b1054e2fb6bec7c6011598a70f4f6afd59990d932ce0a73c46513d
MD5 ca4ced0f3c2fc5b4faa8d94e64041f57
BLAKE2b-256 30f130e7579569789dc8a2d036fffcd397cb7b5a931c0796add602f9c459b38a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs_parse-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 580a7ffffeccde24cb3c558cdd315095c934bef088a3e3157aa2f5aeeba58755
MD5 4d873dae39e1aa6d7aeb080394be402f
BLAKE2b-256 3719b871bec79ff3e04a6527c8340f8c829df28edb3e6f20a646e1c786f61d9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs_parse-0.1.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 32557c4f9a45685a310fcba04582b74b3001db4c1060f626ecb2bb110f86f923
MD5 ba6f2b945497376e2ca74ed05ff9fe43
BLAKE2b-256 badef94240e5551871c3982797b41936d536480795633ccc142ea6d9b897cfd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turbo_xlsx_rs_parse-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a0b04e2aaba66c6ea75d87b71320e6f52d9a11be6c5ed7ef73c731d5bbeb3129
MD5 346049058267daf9c128048f2474ea4d
BLAKE2b-256 dfb7a9efc9aeb942646dd35a0344eef1f8ff82524da36893a35ad2542d297664

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