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

Uploaded CPython 3.12Windows x86-64

turboxl-0.1.65-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

turboxl-0.1.65-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11macOS 15.0+ x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

turboxl-0.1.65-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 15.0+ x86-64

turboxl-0.1.65-cp310-cp310-macosx_15_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: turboxl-0.1.65-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.65-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2e1c91bfc30bf63fec1d6ea4360102593af8c1238ad093997e16e538ac822f4d
MD5 bf2da3623a6da6be798d16be58bc81ae
BLAKE2b-256 ed7f5e4ba61e8379d966e5e20778309ff8957763a086d7224e411e82e9c73d2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 53260822487ea2ceb91f145b660add71590c6a6489db358fe8f5b4b5f0b1e7a4
MD5 b63e42ae6ca1886d7c40c262708e48e4
BLAKE2b-256 9986948d9c341272f1fc48528201ac8a4cb1e53d9289f9e71b87ccbca0199cb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 b9c67dbb478d5fb47d6e6f850b07379bddeb5d63254ff567f851c4911e6f45f2
MD5 3c2d2ee8ad73fe1ed16936029985666d
BLAKE2b-256 3fd1fbb6fbc07fa89af707f100cd82d5f2ec54f48232f5f8bd44f6b907ce207f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 21f67987b418e4c01337ff1ea5a7c477d0e6cde1332eecc6d9fa222694701279
MD5 30fa69a498e51fa819d117090ce718cb
BLAKE2b-256 bf554a966e1c50cbdabaa4e78be5c536e08df09b5c14ab765c83fe6e229f440e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.65-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.65-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aa72e3639544fb0b3230a9d476a52094753d27b9c7aabc64cefbf90407e253bf
MD5 0296b76c79a4c1c98113383125c442d8
BLAKE2b-256 ea9928a25f7b16015207ab630109e7ca59523c98da6e4341697cccb122e83f31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2baa21c0b7098dd75cb813740519fea6ef1ca5b1a8e309f515c11c32f63bbc14
MD5 3f237802f425e3fb471b2a610f5046ee
BLAKE2b-256 fe77d4463613b3b649387f546e76136f0858646ca113f685a3f01abe77831e31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 deef9a6677f747a2438097ce5297c80ee9863662c4dd4265a7958db0d389af1e
MD5 fd8776c9acb9c6d5c6af77e09588f580
BLAKE2b-256 22c9026cc6c45fd98a6daffe034b0af267d253a02b0a8b3ec39b0fc8799a1a6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6165c66e8be725e0fa76c06e24d906276268e4eb896fbf44a008736a9304470a
MD5 4f1dfef5413e2db8d6a837749b5e0479
BLAKE2b-256 22491391064ef2173766477cb462d2f99eb661fb8ed7632e46572c452aedaf57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.65-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.65-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b0fb9a63bdf35cd20f0d0f190c33997e04eb6cd780330dfcb48fe8b6680ed04b
MD5 0f398d6b23d6d44d7f6351fb256b8f20
BLAKE2b-256 5e41c99475155831af8c302d380654c22c54f9bd03f15c3e9df3d8b036fde443

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 50290c9818c1d36d3b16910dd1ca047c879c21b6c30d15651e1e00f9597d2b7f
MD5 afd77e928364e136f89bf50d1ebeaac8
BLAKE2b-256 1edd3801594268dd6ecada37fe1edf1b081c7b9f5f80d2c3e36e2cdb07933c72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f0633cef5881b801c3dccc0494b2809be11480aa4140889b2809bac492357df5
MD5 9363b810e81a5b8cc6aee3ea7a1ded1e
BLAKE2b-256 5cefd5e897e5750bbb9ba32b0a277ff83563eee8a5d05cf036e8efd5b06a9136

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.65-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 031a2ef5be163e4e580a9b024b588ef593e6a3e8a2340e1250d0d59fd6dcf9cb
MD5 9823767385abb3240e7b29c47bf56cd6
BLAKE2b-256 fc8216a6e790e2c77426274d963d0891aaceafe496419e54819260cf78c586cf

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