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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 15.0+ x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 15.0+ x86-64

turboxl-0.1.72-cp310-cp310-macosx_15_0_arm64.whl (996.3 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: turboxl-0.1.72-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.72-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5468d00be3d75acf9ccdc331528a3a723b8cef40c7dbb96403bee039e8a38397
MD5 e2f2959400a69557736eb1eefe08d0cd
BLAKE2b-256 53a5d5e9d58b47855ad51de830444ce2f5db9507f1c2d2845e5b85b835f85ff6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ee6ba693732e72ea9983504717052f9c53ed4d1e44f9d98b1a6042436a919829
MD5 6fd0204831af581db4b625eceb488354
BLAKE2b-256 0075a7018d34dcbc6c474498dc097d5634a2c99180fa6ade3e138fc7b2fcae29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 591697f1633dc2253871341909b4bb752e178df57cba6c5a3b1653ffbf929061
MD5 d950e00d46c7072410ed78f5017b8297
BLAKE2b-256 10955c9c7a7ddc351bbdd84e8ef3f8e55fe5ba9fe1eba22db2bd951f341f93df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 812318f105cdf51bec8b7f08e03a64636ce96c6ddc594cee62c52466b70748ff
MD5 55b945b0c37e3dfc4ae4a794bcfc070f
BLAKE2b-256 620e72040276001da2cd7e74021641ea310e849f378a06bae315c517a6fc942d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.72-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.72-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0269267cfa86fbe47d59cf0b5204f2189dcc4724f1808f52eb38f43fc8bbf9b0
MD5 e86b3c150bdd8cc46967d59d5ceed5c5
BLAKE2b-256 1d368656e861abafbc5441bf49ec609ef5acc7f9044304c9658347bedbd5f992

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 17f90ea939d3409956a057d91793a960a1c0918961a66b1a91bdc3a0330028b0
MD5 88c6ff5f987092eb5650a7dc35f9b3f3
BLAKE2b-256 9ae21e4db432124d19c21d74d5ef5fa8280f19b7b80b1da643f0288659c0f8cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 055e14c88b1f14d19afb36547706efebd83a530609ade79bb188d5b1f61bf26e
MD5 ada118741a716ff7e9689f05aee59648
BLAKE2b-256 4419315e0cbdaf8e424548855106ea9560244b04ecf4bb8337637d1503d43d7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 cf6061d0ec2fb5dc142fead3036decfa8752e32fcd433726939d27235ced5e58
MD5 9551724548f0c23655137093d9bbd410
BLAKE2b-256 77d96f77eaa5c41dab80025aa465bbd12abb994ca6ba3aa189b24961f3353e3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turboxl-0.1.72-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.72-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8f915fb19cdb2dfebda644b47a67504c62a71090e98c60acd9be52d28d0ee330
MD5 9c9a7a862b4aab4347906558cb7514dd
BLAKE2b-256 c00001bd85fa0a868a6bc31ff7e7e65a1196710b25d2ea4feca4708d5e72096e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 dfb0789adb80453e22a60b3709deb1e7cda2bc3020a2e345eac4ac5551476352
MD5 769c1bfb6f82175bd9751bab8459acb1
BLAKE2b-256 07898ce97483ff8c219e1ceea2774798d22dd8943fa1f7f997a545a4da6ce4d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 6d32276d49c5391f6ae2903342a2eba23f8eacf2d0662ca9b90d629d58121058
MD5 b20b6f4cdbb221f57b4e38615074102d
BLAKE2b-256 a75f9d7d398c922c54bd1d37a77ba2efe7366e47051440fd89056de6b6f79bf6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for turboxl-0.1.72-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ddfab9b155c0315e8c50d805d5cae742ccef88e7b34c4220c345b5d205dc85a1
MD5 ca9b13559e1a819fea1ee8b3f6ac44af
BLAKE2b-256 00e84ffd45696cb08c5633edda00b1d206f875b2fdb1a1949af49bc3bb59806c

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