Skip to main content

A fast, Rust-powered Excel xlsx library for Python with openpyxl-compatible API

Project description

rustypyxl

Quality Gate Status Maintainability Rating Security Rating Known Vulnerabilities

A Rust-powered Excel (XLSX) library for Python with an openpyxl-compatible API.

Installation

pip install rustypyxl

Usage

import rustypyxl

# Load a workbook
wb = rustypyxl.load_workbook('input.xlsx')
ws = wb.active

# Read values
value = wb.get_cell_value('Sheet1', 1, 1)

# Write values
wb.set_cell_value('Sheet1', 1, 1, 'Hello')
wb.set_cell_value('Sheet1', 2, 1, 42.5)
wb.set_cell_value('Sheet1', 3, 1, '=SUM(A1:A2)')

# Bulk operations
wb.write_rows('Sheet1', [
    ['Name', 'Age', 'Score'],
    ['Alice', 30, 95.5],
    ['Bob', 25, 87.3],
])

data = wb.read_rows('Sheet1', min_row=1, max_row=100)

# Save
wb.save('output.xlsx')

Features

  • openpyxl-compatible API: Familiar patterns for easy migration
  • Read and write support: Full round-trip capability
  • Cell values: Strings, numbers, booleans, dates, formulas
  • Formatting: Fonts, alignment, fills, borders, number formats
  • Workbook features: Comments, hyperlinks, named ranges, merged cells
  • Sheet features: Protection, data validation, column/row dimensions
  • Parquet import/export: Direct Parquet ↔ Excel conversion (bypasses Python FFI)
  • S3 support: Works with boto3 via bytes I/O
  • Bytes I/O: Load from bytes or file-like objects, save to bytes
  • Configurable compression: Trade off speed vs file size

Parquet Import

Import large Parquet files directly into Excel worksheets. Data flows from Parquet → Rust → Excel without crossing the Python FFI boundary, making it very fast for large datasets.

import rustypyxl

wb = rustypyxl.Workbook()
wb.create_sheet("Data")

# Import parquet file into sheet
result = wb.insert_from_parquet(
    sheet_name="Data",
    path="large_dataset.parquet",
    start_row=1,
    start_col=1,
    include_headers=True,
    column_renames={"old_name": "new_name"},  # optional
    columns=["col1", "col2", "col3"],  # optional: select specific columns
)

print(f"Imported {result['rows_imported']} rows")
print(f"Data range: {result['range_with_headers']}")

wb.save("output.xlsx")

Performance: ~4 seconds for 1M rows × 20 columns on M1 MacBook Pro.

Parquet Export

Export worksheet data to Parquet format with automatic type inference:

import rustypyxl

wb = rustypyxl.load_workbook("data.xlsx")

# Export entire sheet
result = wb.export_to_parquet(
    sheet_name="Sheet1",
    path="output.parquet",
    has_headers=True,              # first row contains headers
    compression="snappy",          # snappy, zstd, gzip, lz4, none
    column_renames={"old": "new"}, # optional: rename columns
    column_types={"date_col": "datetime"},  # optional: force column types
)

print(f"Exported {result['rows_exported']} rows")
print(f"File size: {result['file_size']} bytes")

# Export specific range
result = wb.export_range_to_parquet(
    sheet_name="Sheet1",
    path="subset.parquet",
    min_row=1, min_col=1,
    max_row=1000, max_col=5,
)

Supported column type hints: string, float64, int64, boolean, date, datetime, auto.

Loading from Bytes or File-like Objects

Load workbooks from in-memory bytes or file-like objects:

import rustypyxl
import io

# From bytes
with open("file.xlsx", "rb") as f:
    data = f.read()
wb = rustypyxl.load_workbook(data)

# From file-like object (e.g., BytesIO, HTTP response)
wb = rustypyxl.load_workbook(io.BytesIO(data))

# Save to bytes (for HTTP responses, S3, etc.)
output_bytes = wb.save_to_bytes()

S3 Support

Use save_to_bytes() and load_workbook(bytes) with boto3 for S3 integration:

import boto3
import rustypyxl

s3 = boto3.client("s3")

# Load from S3
response = s3.get_object(Bucket="my-bucket", Key="path/to/file.xlsx")
wb = rustypyxl.load_workbook(response["Body"].read())

# Save to S3
data = wb.save_to_bytes()
s3.put_object(Bucket="my-bucket", Key="path/to/output.xlsx", Body=data)

This works with any S3-compatible service and uses boto3's credential handling (IAM roles, environment variables, etc.).

Streaming Writes (Low Memory)

For very large files, use WriteOnlyWorkbook which streams rows directly to disk:

import rustypyxl

wb = rustypyxl.WriteOnlyWorkbook("large_output.xlsx")
wb.create_sheet("Data")

for i in range(1_000_000):
    wb.append_row([f"Row {i}", i, i * 1.5, i % 2 == 0])

wb.close()  # Must call close() to finalize the file

This uses minimal memory regardless of file size, similar to openpyxl's write_only=True mode.

Benchmarks

Micro benchmarks on M1 MacBook Pro. Your results may vary depending on data characteristics and hardware.

Write Performance (1M rows × 20 columns)

Library Time
rustypyxl ~10s
openpyxl ~200s

Read Performance

Dataset rustypyxl calamine openpyxl
10k × 20 (numeric) 0.08s 0.10s 0.51s
10k × 20 (strings) 0.10s 0.12s 1.23s
100k × 20 (numeric) 0.97s 1.03s 4.74s
100k × 20 (mixed) 1.20s 1.28s 12.1s

calamine is a Rust Excel reader with Python bindings via python-calamine (read-only).

Memory Usage (Read)

Dataset rustypyxl calamine openpyxl
10k × 20 29 MB 9 MB 11 MB
50k × 20 58 MB 48 MB 53 MB
100k × 20 95 MB 95 MB 106 MB

Memory Usage (Write)

Dataset rustypyxl WriteOnlyWorkbook openpyxl (write_only)
10k × 20 10 MB ~0 MB 0.4 MB
50k × 20 50 MB ~0 MB 0.4 MB
100k × 20 99 MB ~0 MB 0.4 MB

WriteOnlyWorkbook streams rows directly to disk like openpyxl's write_only mode.

Building from Source

# Install Rust and maturin
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
pip install maturin

# Build
maturin develop --release

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

rustypyxl-0.3.1-cp314-cp314-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.14Windows x86-64

rustypyxl-0.3.1-cp314-cp314-manylinux_2_34_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

rustypyxl-0.3.1-cp314-cp314-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

rustypyxl-0.3.1-cp313-cp313-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.13Windows x86-64

rustypyxl-0.3.1-cp313-cp313-manylinux_2_34_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

rustypyxl-0.3.1-cp313-cp313-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

rustypyxl-0.3.1-cp312-cp312-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.12Windows x86-64

rustypyxl-0.3.1-cp312-cp312-manylinux_2_34_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

rustypyxl-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

rustypyxl-0.3.1-cp311-cp311-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.11Windows x86-64

rustypyxl-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

rustypyxl-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

rustypyxl-0.3.1-cp310-cp310-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.10Windows x86-64

rustypyxl-0.3.1-cp310-cp310-manylinux_2_34_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

rustypyxl-0.3.1-cp310-cp310-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file rustypyxl-0.3.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: rustypyxl-0.3.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rustypyxl-0.3.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d550769d41566f414125bf579061eb92aaaa3682a998a4cad33c4ee81255af31
MD5 50dd870b71da82aea34c496a3b8f8c42
BLAKE2b-256 7d7012db7c04b6b54a42fd7558b338cfe2e5c13e9699f6acd40dec21a1f49c64

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp314-cp314-win_amd64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 288e5bd8dd21171be1d43ebf843a2503938f514633c6c4e8ff688b48b8225b40
MD5 23bac5cafd8c926f075858d3615c780b
BLAKE2b-256 e514b42dae6ead1fe2cd8b5ed3d7682df22e41d67b2a2ed8b60595b8e5afdb7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp314-cp314-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 69fd151c779b614a919e8d981da7a76dcf2b80751249954c27f42b7dd5d13d46
MD5 5f73dabedcc89c6bc919d3b60f2d2102
BLAKE2b-256 a9427fad2976dbd847b07eb524459fb67918a45ed1c285dd39477323ee9609d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: rustypyxl-0.3.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rustypyxl-0.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 967bb651ec2c54877391d6e4c304308916a7b4766a290b64b687c3c916eb3055
MD5 356bcb85f533c93903eae457839edbf9
BLAKE2b-256 74fe89b456b31790d21923cf0fd5cb12b4b42fa7c7477230828c627b638ecf91

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bca174337e825a73cc68c58f3dd8cb8ae31671df3ae287e22f76c63ee380ab8e
MD5 3d0c80510347db557ac13eb591f32999
BLAKE2b-256 9a99ae051c942d478223c07d8fbc8ec5b96664195dd165aca215996b8c1c0a28

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76fe50d6c1e2ebc4bdbe157d8583c3ac8c30004ba6e13b1373a7654814060ec9
MD5 ce4465c4d8c0d86e1d26ae8f71d54944
BLAKE2b-256 212d64c5e142de14a1a25beac8eca38bb473f5633f90f23c622b556af3d22cfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rustypyxl-0.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rustypyxl-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c837c6dc89b098d4178857b33dde9c43b41ac1dc31f1111c49f1a98548e777ae
MD5 8f1ec06704bd95dde6ecd2c7291cf79a
BLAKE2b-256 71f5eebefad4d623007a1b9395133b763d9232594a5f501e610f3cef45bf5e57

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a239309377be39863ec80835d956bae529e8546abc8f7696a9bce0994fd004b3
MD5 0d0b0a1fe3645f1e2f155a63bf0e14d9
BLAKE2b-256 d49a9349586e23c586789a0c2f0a28363ddd13d205d5c4a96f6940b3720e0a98

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8f10e757fa4775148ba8fe5a61b81335f65671f663fdac5faee2a12761ad33c
MD5 53a2dd4afc110fffd518d1383611f583
BLAKE2b-256 30c5c16ab8928a8afe16ad451761fe70eb5308ac7bb7a0e2966a2a6e3a35ad9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rustypyxl-0.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rustypyxl-0.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 259ef0de9789fcd8a9f3730dbe3852e3452526c150f0327e30fcca02b61690a4
MD5 608c6be10b65b6d78ba77b50a7435044
BLAKE2b-256 437ad5cf0f4a92c9cf3dd3ae240a4b790b48f6db0377fa9148649bb144d311cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 48f04fd0b7ed58e62bf314370ef995da0a22de0f5d58d145e91a87f8a215d873
MD5 de60b72718e1b49f408971a3ff952ada
BLAKE2b-256 f8bcb856ce6c47d59b2e3cfb3917aef4ddbc2abb12b76c4155c3896afc13b6b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b63c35da33c2893d579551fce12fb16c4499f87bf4b9564ddecec1307a82578
MD5 8fd88fb0307b7da65d68dcdee343d77a
BLAKE2b-256 4de351e45eed7f426892c3f94dad244b8cea8d92542860a88fcdc062ea726569

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: rustypyxl-0.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rustypyxl-0.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 127eedf3c3e4f698b2b68002b0da92d37b6bd2dadf57d76b7bfe53f52fc4c500
MD5 b92a5f007edab110a657bc25622a983f
BLAKE2b-256 1d0bec544c79905215a85e15f7e11a6f43cc3577d35148bf91353216349d40bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 26d3a63385c43e3b56301d8a9ff6602738f06b39f9ce554541a10c0bedf425fe
MD5 e75b9c132ff63d54b7a3bbc9f88794c0
BLAKE2b-256 d0771d4d2b2e91daaf832d81fc97fd2e059ebb07651eff954089cc8c167b2b0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustypyxl-0.3.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rustypyxl-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b5487703a70987bb4861f838a7ddbf6f2eb02994d211b6bd7c49d3996a5d94b2
MD5 4286d059258e7c49ae5fea074b0ea9bb
BLAKE2b-256 f762f7ed707766c48752e0ff3e0b75060edffb72a1ae6949b11f1835063049a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustypyxl-0.3.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on freeeve/rustypyxl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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