Skip to main content

Fast XLSX to CSV converter (C++ core with Python bindings)

Project description

TurboXL

TurboXL Logo

Fast, read-only XLSX to CSV converter with C++20 core and Python bindings.

Performance

Real-world benchmarks on Chicago Crime dataset (21.9MB, 146,574 rows):

Metric TurboXL OpenPyXL Improvement
Speed 2.4s 63.1s 26.7x faster
Memory 33.5MB 66.9MB 2.0x less
Throughput 62,040 rows/sec 2,321 rows/sec 26.7x faster

Dataset: Chicago Crimes 2025

🚀 Recent Optimizations Implemented:

  • zlib-ng integration - Up to 2.5x faster ZIP decompression
  • Release build optimizations - -O3 -march=native -flto for GCC/Clang, /O2 /GL /arch:AVX2 for MSVC
  • Arena-based shared strings - Memory-efficient string storage
  • Chunked ZIP reading - 512 KiB buffer optimization

What It Does

  • ✅ Read XLSX files and convert to CSV
  • ✅ Handle shared strings, numbers, dates, booleans
  • ✅ Process multiple worksheets
  • ✅ Memory-efficient streaming (33.5MB for 146k rows)
  • ✅ Cross-platform (Linux, macOS, Windows)

What It Doesn't Do

  • ❌ Write or modify XLSX files
  • ❌ Formula evaluation (uses cached values)
  • ❌ Charts, images, pivot tables
  • ❌ Password-protected files

Quick Start

Python

import turboxl

# Convert first sheet
csv_data = turboxl.read_sheet_to_csv("data.xlsx")

# Convert specific sheet
csv_data = turboxl.read_sheet_to_csv("data.xlsx", sheet="Sheet2")

# Custom options
csv_data = turboxl.read_sheet_to_csv(
    "data.xlsx",
    sheet=0,
    delimiter=";",
    date_mode="iso"
)

# Save to file
with open("output.csv", "w", encoding="utf-8") as f:
    f.write(csv_data)

C++

#include <xlsxcsv.hpp>
#include <iostream>

int main() {
    try {
        std::string csv = xlsxcsv::readSheetToCsv("data.xlsx");
        std::cout << csv << std::endl;
    } catch (const std::exception& e) {
        std::cerr << "Error: " << e.what() << std::endl;
    }
    return 0;
}

Building

Prerequisites

Install system dependencies (used via pkg-config/CMake):

# macOS (Recommended for best performance)
brew install libxml2 minizip-ng zlib-ng cmake pybind11 pkg-config

# Ubuntu/Debian (Recommended for best performance)
sudo apt-get install -y libxml2-dev libminizip-dev cmake build-essential pkg-config
# For zlib-ng on Ubuntu/Debian, build from source:
# git clone https://github.com/zlib-ng/zlib-ng.git
# cd zlib-ng && cmake -B build && cmake --build build -j && sudo cmake --install build

# Windows (vcpkg)
vcpkg install libxml2 minizip-ng zlib-ng

Performance Note: Installing zlib-ng provides significant performance improvements (up to 2.5x faster decompression). The build system automatically detects and uses zlib-ng if available, falling back to standard zlib otherwise.

Build C++ Core (library only)

Build the C++ core without Python bindings (no Python/pybind11 required):

# From repo root
cmake -S . -B build \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_TESTS=OFF \
  -DBUILD_PYTHON=OFF \
  -DBUILD_CLI=OFF
cmake --build build -j4

Artifacts:

  • Static library: build/libturboxl_core.a

Build Modes:

  • Release (Recommended): Enables -O3 -march=native -flto optimizations
  • Debug: Enables debugging symbols and assertions

Build Options

  • BUILD_TESTS=ON/OFF - Build test suite (default: ON)
  • BUILD_PYTHON=ON/OFF - Build Python bindings (default: ON)
  • BUILD_CLI=ON/OFF - Build command-line tool (default: OFF)

Python Wheel

TurboXL ships a PEP 517/518 build powered by scikit-build-core. The wheel builds the C++ core and Python extension in Release mode using CMake.

Python prerequisites

python3 -m pip install -U pip build scikit-build-core pybind11

System dependencies listed above (libxml2, minizip-ng, zlib-ng, cmake, compiler) must be installed and discoverable by CMake/pkg-config.

Build the wheel

# From repo root
python3 -m build -w

Outputs go to dist/, for example:

  • dist/turboxl-0.1.0-<python>-<abi>-<platform>.whl

Install the built wheel locally:

pip install python/dist/turboxl-*.whl

Tips:

  • Parallel CMake build: CMAKE_BUILD_PARALLEL_LEVEL=4 python3 -m build -w
  • macOS arch (defaults to arm64 via pyproject.toml): to override, you can pass --config-setting=cmake.define.CMAKE_OSX_ARCHITECTURES="arm64;x86_64" to python -m build.

Requirements

  • C++: C++20 compiler (GCC 10+, Clang 12+, MSVC 2019+)
  • Build: CMake 3.20+
  • Python: 3.8-3.12 (for Python bindings)

API Reference

Python

turboxl.read_sheet_to_csv(
    xlsx_path: str,
    sheet: Union[str, int] = None,  # First sheet if None
    delimiter: str = ",",
    newline: Literal["LF", "CRLF"] = "LF",
    include_bom: bool = False,
    date_mode: Literal["iso", "rawNumber"] = "iso"
) -> str

C++

struct CsvOptions {
    std::string sheetByName;
    int sheetByIndex = -1;
    char delimiter = ',';
    bool includeBom = false;
    // ... more options
};

std::string readSheetToCsv(
    const std::string& xlsxPath,
    const CsvOptions& opts = {}
);

License

MIT License - see LICENSE file for details.

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.

turboxl-0.1.74-cp312-cp312-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.12Windows x86-64

turboxl-0.1.74-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

turboxl-0.1.74-cp312-cp312-macosx_15_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

turboxl-0.1.74-cp312-cp312-macosx_15_0_arm64.whl (998.5 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

turboxl-0.1.74-cp311-cp311-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.11Windows x86-64

turboxl-0.1.74-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

turboxl-0.1.74-cp311-cp311-macosx_15_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

turboxl-0.1.74-cp311-cp311-macosx_15_0_arm64.whl (997.5 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

turboxl-0.1.74-cp310-cp310-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.10Windows x86-64

turboxl-0.1.74-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

turboxl-0.1.74-cp310-cp310-macosx_15_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

turboxl-0.1.74-cp310-cp310-macosx_15_0_arm64.whl (996.2 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file turboxl-0.1.74-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: turboxl-0.1.74-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for turboxl-0.1.74-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 73d12ac0c522a5a9cf73fb826668163951acee6933c03ea10d412d020b241d76
MD5 3b5d85d614c053864b48f2d3d858360f
BLAKE2b-256 4b55331d564157dc3e11aaaaa85581f7769e0b449ac342de0e96a16b3ff630ea

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c666da590caef286e69ec2d4b0d7c7842825a9aed26976fcd1278e7a9c987ec5
MD5 502718fddbe388cc9378349c2433a772
BLAKE2b-256 a77a55617b3911917bb23dcac18b8071883c339edc170987ca64ced3ccd54e71

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 14e3ad10a48b22ed511b92098ef3428a160d4f4954eb9e1f18f8b9ea961bebe6
MD5 5a96fba76468509bf0bb2db3d5ccd2b1
BLAKE2b-256 5c91130930aab2c4dd28dd59bebb7abd7c4948ecfac96c19c83f36c1e2da7d85

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 351d49878343eb69abf77b5e1344e0d6fbeffb406eba7b6b4560159745153896
MD5 74968243447d82e0aca69e933b715244
BLAKE2b-256 b966f2799becad28adae479ca9758994d423d5828ca1e5ff37a70dc6e575f41c

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: turboxl-0.1.74-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for turboxl-0.1.74-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0677c41c4f40f0dee17c12fa5d0a5d14860b47608419259619090cc94e9651fe
MD5 83b14003d56ae1b15b54fb4d88ad383a
BLAKE2b-256 ccc1ceaddf8571800c31aa04163dab42e8b4856ca1cf8148b65c08cafbcefc91

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5a1c6e8018084203d67225347c62d59cc5af2b6a520670cbe868d3e02dcabc1c
MD5 8f5ca9e77f90c9410fc544f7a62543ff
BLAKE2b-256 4fe536517bdf7975c1e91f59887f2dc1b517654515dc3cf516c75fd00d87328f

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 6677fc541c5d19c081ad19e992f2cc9b1540701b97d736f4671e90c8f6027981
MD5 ee947e579047dd7a39416f18a0c8074d
BLAKE2b-256 53136ce44a6fb536dd54a726313753165bcd09fdbc1e56ba6273fa36bb7d03e2

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6090fbf4981fbcb0d60f33706a5dde7b3689c29ffb50551a00375b49dd01fc69
MD5 320819b4deebe380bd595a2a772bf9b2
BLAKE2b-256 3708a75782eeb49bb88a34dc05f22c2ca3a924d08634df8448f0d196b54fd507

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: turboxl-0.1.74-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for turboxl-0.1.74-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 568752daaa7d7106fa6409ddf9988b266fba3aaab205de4a270d418fa1f0b496
MD5 f905ed16988ed6f06631cd32dee2b1b1
BLAKE2b-256 6d66397ff07d96e0114ba3af2db66804cb116e3b07ca59c284594e6c79a46323

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e84748049ec2f51bf3bc9ff2e7f90647fda1352e3dbb67fd4b3868392cba0270
MD5 ae5d5ab8fcba040572e2e76f394ddc9d
BLAKE2b-256 65c8bc14c53154dac20458498571610c2461022c5caa4462b683199805feb105

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 6cbda5e7bb9c32c1d8292b4775e6abae57583c660238b09059ea56bbfa332c8a
MD5 5f4fc8165f2059d9bba3bbd37c0c0164
BLAKE2b-256 1aed66d7f6af582e7108ac2799702776fb45bb44471992d930dc19a131b57764

See more details on using hashes here.

File details

Details for the file turboxl-0.1.74-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for turboxl-0.1.74-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 54e73fdb99bfce9c54a117c2ae389b3532a653e19e3ce70d4e044fd509306893
MD5 d6c674a8c681200646077457675535ba
BLAKE2b-256 40d73055ab3aa80322f65d161a699e12279a69d6d023210689ba75177e4b78c2

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