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.69-cp312-cp312-win_amd64.whl (8.4 MB view details)

Uploaded CPython 3.12Windows x86-64

turboxl-0.1.69-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.69-cp312-cp312-macosx_15_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

turboxl-0.1.69-cp312-cp312-macosx_15_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

turboxl-0.1.69-cp311-cp311-win_amd64.whl (8.4 MB view details)

Uploaded CPython 3.11Windows x86-64

turboxl-0.1.69-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.69-cp311-cp311-macosx_15_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

turboxl-0.1.69-cp311-cp311-macosx_15_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

turboxl-0.1.69-cp310-cp310-win_amd64.whl (8.4 MB view details)

Uploaded CPython 3.10Windows x86-64

turboxl-0.1.69-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.69-cp310-cp310-macosx_15_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

turboxl-0.1.69-cp310-cp310-macosx_15_0_arm64.whl (999.4 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: turboxl-0.1.69-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.4 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.69-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 98e8a4cd7ba2359bf06c5cf832ff2922b3ca7c94ae573bbb42c7d6ebbd45033e
MD5 2d06c8becd10c190ea724fd662d66a4e
BLAKE2b-256 cdf605422c0e3d322fed144074b041fd5bf7722224577ea95f90ae32d9bfebfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 861d9715bd85779b5ae49dc53f45ee23f1ea72dd1d4674307027bf2a40be9897
MD5 d68b01b4bbb76303b87e1edcdc4b614d
BLAKE2b-256 132381942a06adceed22d1877e1aa43ddacb05569a30f295ba2e1bfe6b834ed8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 0a3e5b83bfb217bc912696c89e3be13e7ebdeec70e269ba4d87fe6d262b04f18
MD5 c95afb646a35c1e7af4e64c868650dae
BLAKE2b-256 a49c345cfb86a0a268bf25a6c64fb4fa853eba4c8f52f0ab38c33cda8105e15e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a7af76ee8936ed194466d0d9c75029a48b1ccd03a1434212338e94552cdc93dc
MD5 f61396791be2afa3d801e9c6f5a79d03
BLAKE2b-256 5aa89ad3f174ffdf454b96cc5ee8bd921173601cee400017ee89cbe8e9a1b079

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.69-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 8.4 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.69-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4d390d2cf39d11984394bbe34f9254e0a7e2748c3909981fc497b4d90ac82439
MD5 dd5f0f30a14a701bd6843896866b1284
BLAKE2b-256 48299db8b95bb37daef4cb8d476ab4fc79f0cbbd3e586909a7ec92022eb96c54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5d2f9c3ac51fdab3517a30b7e7de127f214471176469a18d31aefabac70d21c4
MD5 049294c20ab6d8ebf3ed4e0673f795d6
BLAKE2b-256 4af49d6657a030132355ceb6d100c9397bc46deea890688dcf6bf8de248d168a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 83e20f784976e92c94031f3bf9a5aff27c15c7307329b001fc44b55823c349b8
MD5 b78c3f3302ad8c2b228b30cb9a6315bc
BLAKE2b-256 1b7f368c2e16c2a1cfc16bac0253063d279e3f2677cc6a29d2dc30f36c91bf3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7163595b06527367a525603d531b158cfaf85a6d74705b82d6939c6184956f5a
MD5 ab91d0b9ec87c3e83519829043b4c01e
BLAKE2b-256 b0520fb0e935856f7bc150206aaf6c544c014b0c2c7a6931a39ae29fc10f8e74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.69-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 8.4 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.69-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8715cd9a0d6949bacdafcf7a0d6379ee56e03ffd62a03d385c868a764d6d1967
MD5 8983b698f0a643d10d4f6dd7d8fc2fec
BLAKE2b-256 27d01823a6ce33e7ccdcf8b815f7812aa2aea9e8193ae9bbe0065a28267f4e85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1e0c1a21db72f8d3d8880478544ca8ddf0d164e6c4fbf2d0101f04021000f851
MD5 237c1366928d51a7e02cb9ddd09a8754
BLAKE2b-256 39e1cbdda7e8629f52b99ef0611366bf557627d1d3b83c3968297520696982e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 af031a7da5299734abc0a33fae0bdca96cdaab25f336fb783902e73258bfb0a9
MD5 47d95d44e11822e41e8c35c3a3bf1a98
BLAKE2b-256 b636fb86b8f2cab750d904ff396d43a4daa83481cb9a35718cae72f2d981664d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.69-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5836dde8d713a97fdef8725b7f9faf116478ed8f87c61a610e557bf1f7653d7a
MD5 ab60a49ac2066cbed09ad23631b5f67d
BLAKE2b-256 09957bd78383ec2f9d4b6b2465ae528c9448611e372e40992d25b87ddc1d733a

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