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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ x86-64

turboxl-0.1.62-cp312-cp312-macosx_15_0_arm64.whl (992.1 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

turboxl-0.1.62-cp311-cp311-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 15.0+ x86-64

turboxl-0.1.62-cp311-cp311-macosx_15_0_arm64.whl (991.9 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

turboxl-0.1.62-cp310-cp310-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 15.0+ x86-64

turboxl-0.1.62-cp310-cp310-macosx_15_0_arm64.whl (990.7 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: turboxl-0.1.62-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.62-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 22de25c15625befa67340bed5ceb55f4592322f5eaa219bcdf0b0bf076540e76
MD5 890db3ee26335ab557d2c764487352ed
BLAKE2b-256 867d229a85e6a1e0dacf3acbbee5b12f9ce50ace2408592f4146bcd1619c4a66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 cbba0637a88a40ceb52e3ca97fa1468843fda896fffe54b6e85180cc97ee2c2d
MD5 e3912c6f47ab38645aa7f48c6e90525d
BLAKE2b-256 702238cf47ee14b7cd6d3f7ff87a021943c5946abec54bf25b96bddc2b645f05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 1bae22dcba5979af53d46377695d22954a414b0de5f19888bb5a37800370bea0
MD5 47046e29404a98b47a0edcff3b9ca77d
BLAKE2b-256 0d4bc167ce2f4c84e9bcb0be0224dab1cf80d470a58d30ba1b50f17a74a485bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 271e67b8da8a9bf5d62b4c1d3ff6b5989bc197f5836f39a41f0eadbd2f38d875
MD5 01f241236a7d05dfecec7a671add3faf
BLAKE2b-256 157ad963bfa13d7f12ce2a1a951f555a1079ff37e913bb1fbeebc2c9bfa3cb32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.62-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.62-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f88242a98d66e743d61f03bf8d0b742d618e8abd2c9e62c2d29eacf70b1b21c2
MD5 e7aa40e0389c982cb268b4f0c98db8e9
BLAKE2b-256 05eb871ce1fc972b3f77005642f4212a274122d36a3e9d4e32ec82e5b789ad9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5960fe2d841d5f9c77ab213aebba6697baaad7211bfd4abe0228c584974d63e0
MD5 d9d120e14f627cb9ad4e6d1dd4bdef61
BLAKE2b-256 717264b87ad1c58f9f926bf93a1d2f8fe54e23dc8f1b7e9c4ca1f358476d8c3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 a6eb62aa7c581e98a5b1ade759e997aacc321125befe4a349b21acc8d562313e
MD5 3bfe40b87bf3271a7bc135e2424f7210
BLAKE2b-256 bd8b0c73ea3450ddec18fe1b02f988b1d4375d8f8bfbc0b159cd8de288a0fb0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c53c6a9af8441a41cc19311cbd963a5c55e746f6ed56d92889766b10457f75ca
MD5 1b3a501d7db372eea8dbc7f87a54aa4a
BLAKE2b-256 ba6dd1325eefdb49e66cb02957c9d06ac6478288305c25fdebe1edbab799ae53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.62-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.7 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.62-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9284a71677e9ee6891d1bb28d10cd8620bedf93ba3a8976637d15bf87540aa69
MD5 c6e53e5c0404c83f4211a28f7780202c
BLAKE2b-256 597532edb9e0461689a56427ed5799bdeb1985ace4a7e8f9083664336cfb83e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7c405c614ca68b52cd8b79bc62cb0127ccf5833ee14dea62a62dc4bd3cd52eb2
MD5 4497fbabbae58413fd3955da8b3f9ed4
BLAKE2b-256 d521c0ba1c310443af6b3f0416027c5276d368d5a5405caf21d416381fa8e2f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 b76c188bcee5802ce123efce1a94aea47b3998320590422dc18af28a1018d760
MD5 924f5427b2fcf01b5ac591119ed39d30
BLAKE2b-256 4f838d004f2af68bcbc194bd3b1a67694a55e34d93b52c78a36b7c17a6c4cc9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.62-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0effee33ab45d37e1ea307c34a8cb971897236921703db7c454128303b94d6f2
MD5 c781ca065e57e25f7da9256fbf2f4b2c
BLAKE2b-256 214e61bcc55d7109c41416e72ced9843cdebc5a506f0fd623f36535c9b623518

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