Skip to content

Python Bindings + Fallback Float Parsing Fix#316

Merged
vincentlaucsb merged 19 commits into
masterfrom
python-bindings
May 13, 2026
Merged

Python Bindings + Fallback Float Parsing Fix#316
vincentlaucsb merged 19 commits into
masterfrom
python-bindings

Conversation

@vincentlaucsb
Copy link
Copy Markdown
Owner

@vincentlaucsb vincentlaucsb commented May 10, 2026

Summary

Adds first-class Python bindings for the CSV parser under the fastpycsv package name, plus a few C++ parser improvements that support the Python work.

Python

  • Added fastpycsv.reader() with lazy C++-backed row objects
  • Added materialized row iterators for lists, tuples, and dicts, including bounded-memory chunk iteration
  • Added bulk materialization helpers for lists, tuples, and dicts
  • Added fast NumPy materialization APIs:
    • fastpycsv.read_numpy(...)
    • fastpycsv.read_numpy_batches(...)
  • Added native predicate support for filtering before materialization
  • Added fastpycsv.write_csv(...)
  • Added Python docs using Furo, linked from the generated C++ docs
  • Added Python package metadata, cibuildwheel wheel builds, dry-run CI, and PyPI trusted publishing workflow
  • Renamed the package from the internal csvpy naming to the PyPI-ready fastpycsv
  • Added Python tests for reader behavior, lazy rows, materialized iterators, NumPy output, predicates, writer behavior, and compatibility wrappers

C++

  • Added eager field classification support so parser-side type classification can be reused by higher-level consumers
  • Fixed floating-point parsing behavior when std::from_chars() floating support is unavailable
  • Added supporting tests for eager classification and fallback floating-point parsing behavior

Verification

  • Python unit tests pass locally
  • Python docs build successfully
  • cibuildwheel dry run passes on Windows, macOS, and Ubuntu
  • Source distribution build passes
  • Wheel metadata validation passes
  • Existing C++ tests pass
  • PyPI publishing is gated to published GitHub releases with version/tag validation

@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

❌ Patch coverage is 91.71429% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.12%. Comparing base (e730e89) to head (a8926df).

Files with missing lines Patch % Lines
include/internal/memory/field_scalar_list.hpp 80.00% 1 Missing and 6 partials ⚠️
python/fastpycsv/_format.py 79.16% 5 Missing ⚠️
python/fastpycsv/__init__.py 90.24% 4 Missing ⚠️
python/fastpycsv/_reader.py 96.52% 4 Missing ⚠️
include/internal/parser/orchestrator.hpp 50.00% 0 Missing and 2 partials ⚠️
include/internal/speculative/parallel_parser.hpp 66.66% 2 Missing ⚠️
python/fastpycsv/_writer.py 86.66% 2 Missing ⚠️
include/internal/csv_row.cpp 90.00% 0 Missing and 1 partial ⚠️
include/internal/csv_row.hpp 94.44% 0 Missing and 1 partial ⚠️
include/internal/parser/core.hpp 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #316      +/-   ##
==========================================
+ Coverage   89.56%   91.12%   +1.56%     
==========================================
  Files          39       47       +8     
  Lines        2922     3346     +424     
  Branches     1106      942     -164     
==========================================
+ Hits         2617     3049     +432     
- Misses         93      130      +37     
+ Partials      212      167      -45     
Flag Coverage Δ
cpp 90.93% <87.71%> (?)
python 93.64% <93.64%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread python/csvpy/compat.py Fixed
run: python -m coverage xml -o python-coverage.xml

- name: Upload Python coverage to Codecov
uses: codecov/codecov-action@v5
Comment thread python/csvpy/DictReader.py Fixed
Comment thread python/fastpycsv/_reader.py Fixed
Comment thread .github/workflows/python-publish.yml Fixed
def cleanup(self) -> None:
try:
os.unlink(self.name)
except FileNotFoundError:
@vincentlaucsb vincentlaucsb changed the title Python bindings Python Bindings + Fallback Float Parsing Fix May 13, 2026
@vincentlaucsb vincentlaucsb merged commit 9d70013 into master May 13, 2026
31 checks passed
@vincentlaucsb vincentlaucsb deleted the python-bindings branch May 13, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants