pybcsv 1.5.11.dev0__tar.gz → 1.5.14.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pybcsv-1.5.14.dev0/CMakeLists.txt +220 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/MANIFEST.in +5 -1
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/PKG-INFO +35 -1
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/README.md +34 -0
- pybcsv-1.5.14.dev0/VERSION.txt +1 -0
- pybcsv-1.5.14.dev0/include/CLI11-2.6.2/CLI11.hpp +12216 -0
- pybcsv-1.5.14.dev0/include/CLI11-2.6.2/LICENSE +25 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/csv_reader.h +13 -2
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/csv_reader.hpp +133 -53
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/__init__.py +5 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/_version.py +3 -3
- pybcsv-1.5.14.dev0/pybcsv/tools.py +84 -0
- pybcsv-1.5.14.dev0/src/shared/comparison.h +656 -0
- pybcsv-1.5.14.dev0/src/shared/test_datasets.hpp +2036 -0
- pybcsv-1.5.14.dev0/src/shared/validation.h +193 -0
- pybcsv-1.5.14.dev0/src/tools/bcsv2csv.cpp +535 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvCast.cpp +944 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvCompare.cpp +330 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvGenerator.cpp +221 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvHead.cpp +110 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvHeader.cpp +120 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvRepair.cpp +1218 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvSampler.cpp +299 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvTail.cpp +202 -0
- pybcsv-1.5.14.dev0/src/tools/bcsvValidate.cpp +634 -0
- pybcsv-1.5.14.dev0/src/tools/cli_app.h +148 -0
- pybcsv-1.5.14.dev0/src/tools/cli_common.h +661 -0
- pybcsv-1.5.14.dev0/src/tools/csv2bcsv.cpp +1143 -0
- pybcsv-1.5.14.dev0/src/tools/spec_parse.h +249 -0
- pybcsv-1.5.14.dev0/src/tools/type_probe.h +809 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/sync_headers.py +30 -0
- pybcsv-1.5.14.dev0/tests/test_tools.py +72 -0
- pybcsv-1.5.11.dev0/CMakeLists.txt +0 -161
- pybcsv-1.5.11.dev0/VERSION.txt +0 -1
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/BUILD_NOTES.md +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/LICENSE +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/benchmarks/README.md +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/benchmarks/run_pybcsv_benchmarks.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/examples/README.md +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/examples/advanced_usage.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/examples/basic_usage.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/examples/pandas_integration.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/examples/performance_benchmark.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/bcsv.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/bcsv.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/bcsv_c_api.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/bitset.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/bitset.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/byte_buffer.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/checksum.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_file/file_codec_concept.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_file/file_codec_dispatch.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_file/file_codec_packet001.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_file/file_codec_packet_lz4_001.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_file/file_codec_packet_lz4_batch001.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_file/file_codec_stream001.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_file/file_codec_stream_lz4_001.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_row/row_codec_delta002.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_row/row_codec_delta002.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_row/row_codec_dispatch.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_row/row_codec_flat001.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_row/row_codec_flat001.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_row/row_codec_zoh001.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/codec_row/row_codec_zoh001.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/column_name_index.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/column_name_index.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/csv_writer.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/csv_writer.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/definitions.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/file_footer.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/file_header.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/file_header.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/layout.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/layout.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/layout_guard.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/lz4_block.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/lz4_stream.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/packet_header.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/reader.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/reader.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/reader_concept.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/row.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/row.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/row_visitors.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_ast.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_compiler.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_parser.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_tokenizer.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_types.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_vm.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_vm.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/sampler/sampler_window.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/std_charconv_compat.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/vle.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/writer.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/writer.hpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/bcsv/writer_concept.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4.c +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4file.c +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4file.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4frame.c +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4frame.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4frame_static.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4hc.c +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/lz4hc.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/xxhash.c +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/lz4-1.10.0/xxhash.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/xxHash-0.8.3/xxhash.c +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/include/xxHash-0.8.3/xxhash.h +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/__init__.pyi +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/__version__.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/_bcsv.pyi +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/bindings.cpp +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/pandas_utils.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/parquet_utils.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/polars_utils.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pybcsv/py.typed +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/pyproject.toml +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/README.md +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/conftest.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_basic_functionality.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_count_rows.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_csv_writer_reader.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_cycle4_python_hardening.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_data_types.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_interoperability.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_minimal_string.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_parquet_conversion.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_performance_edge_cases.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_arrow.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_codecs.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_columnar.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_core.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_direct_access.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_errors.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_pandas.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_performance.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_polars.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_pybcsv_sampler.py +0 -0
- {pybcsv-1.5.11.dev0 → pybcsv-1.5.14.dev0}/tests/test_streaming_bindings.py +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.15...3.30)
|
|
2
|
+
project(pybcsv LANGUAGES C CXX)
|
|
3
|
+
|
|
4
|
+
# ── Version from VERSION.txt ────────────────────────────────────────────
|
|
5
|
+
# VERSION.txt is the single source of truth, mirroring cmake/GetGitVersion.cmake.
|
|
6
|
+
# Deriving this from `git describe` instead meant a wheel built where git was
|
|
7
|
+
# unavailable silently stamped whatever the last committed fallback happened to
|
|
8
|
+
# be. sync_headers.py copies VERSION.txt next to this file for sdist builds, so
|
|
9
|
+
# both the full checkout and the sdist find it.
|
|
10
|
+
set(_PY_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../VERSION.txt")
|
|
11
|
+
if(NOT EXISTS "${_PY_VERSION_FILE}")
|
|
12
|
+
set(_PY_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt")
|
|
13
|
+
endif()
|
|
14
|
+
if(NOT EXISTS "${_PY_VERSION_FILE}")
|
|
15
|
+
message(FATAL_ERROR
|
|
16
|
+
"[pybcsv] VERSION.txt not found in either ${CMAKE_CURRENT_SOURCE_DIR}/.. or "
|
|
17
|
+
"${CMAKE_CURRENT_SOURCE_DIR}. Run sync_headers.py or build from the project root.")
|
|
18
|
+
endif()
|
|
19
|
+
|
|
20
|
+
file(READ "${_PY_VERSION_FILE}" _PY_FILE_VERSION)
|
|
21
|
+
string(STRIP "${_PY_FILE_VERSION}" _PY_FILE_VERSION)
|
|
22
|
+
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" _PY_FV_MATCH "${_PY_FILE_VERSION}")
|
|
23
|
+
if(NOT _PY_FV_MATCH)
|
|
24
|
+
message(FATAL_ERROR
|
|
25
|
+
"[pybcsv] ${_PY_VERSION_FILE} contains '${_PY_FILE_VERSION}', not a valid X.Y.Z version.")
|
|
26
|
+
endif()
|
|
27
|
+
|
|
28
|
+
set(BCSV_VERSION_MAJOR ${CMAKE_MATCH_1})
|
|
29
|
+
set(BCSV_VERSION_MINOR ${CMAKE_MATCH_2})
|
|
30
|
+
set(BCSV_VERSION_PATCH ${CMAKE_MATCH_3})
|
|
31
|
+
set(BCSV_VERSION_STRING "${_PY_FILE_VERSION}")
|
|
32
|
+
|
|
33
|
+
message(STATUS "[pybcsv] Version: ${BCSV_VERSION_STRING}")
|
|
34
|
+
|
|
35
|
+
# Set variables expected by cmake/version.h.in template
|
|
36
|
+
set(VERSION_MAJOR ${BCSV_VERSION_MAJOR})
|
|
37
|
+
set(VERSION_MINOR ${BCSV_VERSION_MINOR})
|
|
38
|
+
set(VERSION_PATCH ${BCSV_VERSION_PATCH})
|
|
39
|
+
set(VERSION_STRING ${BCSV_VERSION_STRING})
|
|
40
|
+
|
|
41
|
+
# Generate version_generated.h into build dir
|
|
42
|
+
set(VERSION_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/version.h.in")
|
|
43
|
+
if(EXISTS "${VERSION_TEMPLATE}")
|
|
44
|
+
configure_file("${VERSION_TEMPLATE}"
|
|
45
|
+
"${CMAKE_CURRENT_BINARY_DIR}/include/bcsv/version_generated.h" @ONLY)
|
|
46
|
+
else()
|
|
47
|
+
# Fallback for standalone / sdist builds where ../cmake/ doesn't exist
|
|
48
|
+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/include/bcsv/version_generated.h"
|
|
49
|
+
"// Auto-generated version header\n"
|
|
50
|
+
"#ifndef BCSV_VERSION_GENERATED_H\n"
|
|
51
|
+
"#define BCSV_VERSION_GENERATED_H\n"
|
|
52
|
+
"namespace bcsv { namespace version {\n"
|
|
53
|
+
"constexpr int MAJOR = ${BCSV_VERSION_MAJOR};\n"
|
|
54
|
+
"constexpr int MINOR = ${BCSV_VERSION_MINOR};\n"
|
|
55
|
+
"constexpr int PATCH = ${BCSV_VERSION_PATCH};\n"
|
|
56
|
+
"constexpr const char* STRING = \"${BCSV_VERSION_STRING}\";\n"
|
|
57
|
+
"} }\n"
|
|
58
|
+
"#endif\n"
|
|
59
|
+
)
|
|
60
|
+
endif()
|
|
61
|
+
|
|
62
|
+
# ── Find nanobind ───────────────────────────────────────────────────────
|
|
63
|
+
find_package(Python 3.11 COMPONENTS Interpreter Development.Module REQUIRED)
|
|
64
|
+
|
|
65
|
+
# Detect nanobind CMake dir via Python
|
|
66
|
+
execute_process(
|
|
67
|
+
COMMAND ${Python_EXECUTABLE} -m nanobind --cmake_dir
|
|
68
|
+
OUTPUT_VARIABLE NB_DIR
|
|
69
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
70
|
+
COMMAND_ERROR_IS_FATAL ANY
|
|
71
|
+
)
|
|
72
|
+
list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
|
|
73
|
+
find_package(nanobind CONFIG REQUIRED)
|
|
74
|
+
|
|
75
|
+
# ── Source files ────────────────────────────────────────────────────────
|
|
76
|
+
# Prefer parent project's include/ (always available in full checkout / CI).
|
|
77
|
+
# Fall back to local python/include/ (populated by sync_headers.py for standalone builds).
|
|
78
|
+
set(PARENT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../include")
|
|
79
|
+
set(LOCAL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
80
|
+
|
|
81
|
+
if(EXISTS "${PARENT_INCLUDE_DIR}/bcsv/bcsv.h")
|
|
82
|
+
set(BCSV_INCLUDE_DIR "${PARENT_INCLUDE_DIR}")
|
|
83
|
+
message(STATUS "[pybcsv] Using parent include: ${BCSV_INCLUDE_DIR}")
|
|
84
|
+
elseif(EXISTS "${LOCAL_INCLUDE_DIR}/bcsv/bcsv.h")
|
|
85
|
+
set(BCSV_INCLUDE_DIR "${LOCAL_INCLUDE_DIR}")
|
|
86
|
+
message(STATUS "[pybcsv] Using local include: ${BCSV_INCLUDE_DIR}")
|
|
87
|
+
else()
|
|
88
|
+
message(FATAL_ERROR "[pybcsv] Cannot find bcsv headers. Run sync_headers.py or build from the project root.")
|
|
89
|
+
endif()
|
|
90
|
+
|
|
91
|
+
set(LZ4_DIR "${BCSV_INCLUDE_DIR}/lz4-1.10.0")
|
|
92
|
+
|
|
93
|
+
set(BCSV_SOURCES
|
|
94
|
+
pybcsv/bindings.cpp
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
set(LZ4_SOURCES
|
|
98
|
+
${LZ4_DIR}/lz4.c
|
|
99
|
+
${LZ4_DIR}/lz4file.c
|
|
100
|
+
${LZ4_DIR}/lz4frame.c
|
|
101
|
+
${LZ4_DIR}/lz4hc.c
|
|
102
|
+
${LZ4_DIR}/xxhash.c
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
# ── Build the extension module ──────────────────────────────────────────
|
|
106
|
+
nanobind_add_module(_bcsv STABLE_ABI ${BCSV_SOURCES} ${LZ4_SOURCES})
|
|
107
|
+
|
|
108
|
+
target_include_directories(_bcsv PRIVATE
|
|
109
|
+
${CMAKE_CURRENT_BINARY_DIR}/include
|
|
110
|
+
${BCSV_INCLUDE_DIR}
|
|
111
|
+
${LZ4_DIR}
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
set_target_properties(_bcsv PROPERTIES
|
|
115
|
+
CXX_STANDARD 20
|
|
116
|
+
CXX_STANDARD_REQUIRED ON
|
|
117
|
+
C_STANDARD 11
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
# ── Platform-specific flags ─────────────────────────────────────────────
|
|
121
|
+
if(MSVC)
|
|
122
|
+
target_compile_options(_bcsv PRIVATE
|
|
123
|
+
/O2
|
|
124
|
+
/std:c++20
|
|
125
|
+
)
|
|
126
|
+
elseif(APPLE)
|
|
127
|
+
# Apple Clang ships LLVM 18-era libc++ where jthread/stop_token are
|
|
128
|
+
# still experimental (guarded by _LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN).
|
|
129
|
+
# The -fexperimental-library flag enables these features.
|
|
130
|
+
target_compile_options(_bcsv PRIVATE
|
|
131
|
+
-O3 -Wall -Wextra
|
|
132
|
+
-fexperimental-library
|
|
133
|
+
-mmacosx-version-min=13.3
|
|
134
|
+
)
|
|
135
|
+
else()
|
|
136
|
+
# Linux: full C++20 with pthreads
|
|
137
|
+
target_compile_options(_bcsv PRIVATE
|
|
138
|
+
-O3 -Wall -Wextra
|
|
139
|
+
)
|
|
140
|
+
target_link_libraries(_bcsv PRIVATE pthread)
|
|
141
|
+
endif()
|
|
142
|
+
|
|
143
|
+
target_compile_definitions(_bcsv PRIVATE BCSV_HAS_BATCH_CODEC=1)
|
|
144
|
+
|
|
145
|
+
# ── Install ─────────────────────────────────────────────────────────────
|
|
146
|
+
install(TARGETS _bcsv LIBRARY DESTINATION pybcsv)
|
|
147
|
+
|
|
148
|
+
# ── Bundled CLI tools ───────────────────────────────────────────────────
|
|
149
|
+
# A curated subset of the BCSV CLI tools is compiled into the wheel and
|
|
150
|
+
# installed into the environment's scripts dir (on PATH in every venv), so
|
|
151
|
+
# `pip install pybcsv` ships the high-performance converters with a version
|
|
152
|
+
# that always matches the bundled library. Sources come from the parent
|
|
153
|
+
# checkout (CI / full clone) or from the copies sync_headers.py places under
|
|
154
|
+
# python/src/ for standalone sdist builds.
|
|
155
|
+
option(PYBCSV_BUILD_TOOLS "Build and bundle the BCSV CLI tools" ON)
|
|
156
|
+
|
|
157
|
+
set(PARENT_TOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../src/tools")
|
|
158
|
+
set(LOCAL_TOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/tools")
|
|
159
|
+
set(PARENT_SHARED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../src/shared")
|
|
160
|
+
set(LOCAL_SHARED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/shared")
|
|
161
|
+
|
|
162
|
+
if(EXISTS "${PARENT_TOOLS_DIR}/csv2bcsv.cpp")
|
|
163
|
+
set(BCSV_TOOLS_DIR "${PARENT_TOOLS_DIR}")
|
|
164
|
+
set(BCSV_SHARED_DIR "${PARENT_SHARED_DIR}")
|
|
165
|
+
elseif(EXISTS "${LOCAL_TOOLS_DIR}/csv2bcsv.cpp")
|
|
166
|
+
set(BCSV_TOOLS_DIR "${LOCAL_TOOLS_DIR}")
|
|
167
|
+
set(BCSV_SHARED_DIR "${LOCAL_SHARED_DIR}")
|
|
168
|
+
else()
|
|
169
|
+
set(BCSV_TOOLS_DIR "")
|
|
170
|
+
endif()
|
|
171
|
+
|
|
172
|
+
set(CLI11_INCLUDE_DIR "${BCSV_INCLUDE_DIR}/CLI11-2.6.2")
|
|
173
|
+
|
|
174
|
+
if(PYBCSV_BUILD_TOOLS AND BCSV_TOOLS_DIR AND EXISTS "${CLI11_INCLUDE_DIR}/CLI11.hpp")
|
|
175
|
+
# Keep in sync with pybcsv/tools.py::TOOLS.
|
|
176
|
+
set(PYBCSV_TOOLS
|
|
177
|
+
csv2bcsv bcsv2csv bcsvHeader bcsvCast bcsvValidate
|
|
178
|
+
bcsvHead bcsvTail bcsvSampler bcsvCompare bcsvRepair bcsvGenerator)
|
|
179
|
+
|
|
180
|
+
# Compile the vendored LZ4 once, shared by every tool (the extension
|
|
181
|
+
# module compiles its own copy because nanobind owns that target).
|
|
182
|
+
add_library(pybcsv_tools_lz4 STATIC ${LZ4_SOURCES})
|
|
183
|
+
target_include_directories(pybcsv_tools_lz4 PUBLIC ${LZ4_DIR})
|
|
184
|
+
|
|
185
|
+
foreach(tool IN LISTS PYBCSV_TOOLS)
|
|
186
|
+
add_executable(${tool} "${BCSV_TOOLS_DIR}/${tool}.cpp")
|
|
187
|
+
target_include_directories(${tool} PRIVATE
|
|
188
|
+
${CMAKE_CURRENT_BINARY_DIR}/include
|
|
189
|
+
${BCSV_INCLUDE_DIR}
|
|
190
|
+
${BCSV_TOOLS_DIR}
|
|
191
|
+
${BCSV_SHARED_DIR}
|
|
192
|
+
)
|
|
193
|
+
target_include_directories(${tool} SYSTEM PRIVATE ${CLI11_INCLUDE_DIR})
|
|
194
|
+
target_link_libraries(${tool} PRIVATE pybcsv_tools_lz4)
|
|
195
|
+
target_compile_definitions(${tool} PRIVATE BCSV_HAS_BATCH_CODEC=1)
|
|
196
|
+
set_target_properties(${tool} PROPERTIES
|
|
197
|
+
CXX_STANDARD 20
|
|
198
|
+
CXX_STANDARD_REQUIRED ON
|
|
199
|
+
)
|
|
200
|
+
if(MSVC)
|
|
201
|
+
target_compile_options(${tool} PRIVATE /O2 /std:c++20)
|
|
202
|
+
elseif(APPLE)
|
|
203
|
+
target_compile_options(${tool} PRIVATE
|
|
204
|
+
-O3 -fexperimental-library -mmacosx-version-min=13.3)
|
|
205
|
+
else()
|
|
206
|
+
target_compile_options(${tool} PRIVATE -O3)
|
|
207
|
+
target_link_libraries(${tool} PRIVATE pthread)
|
|
208
|
+
target_link_options(${tool} PRIVATE -s) # strip: ~60% smaller wheels
|
|
209
|
+
endif()
|
|
210
|
+
endforeach()
|
|
211
|
+
|
|
212
|
+
if(DEFINED SKBUILD_SCRIPTS_DIR)
|
|
213
|
+
install(TARGETS ${PYBCSV_TOOLS} RUNTIME DESTINATION "${SKBUILD_SCRIPTS_DIR}")
|
|
214
|
+
else()
|
|
215
|
+
install(TARGETS ${PYBCSV_TOOLS} RUNTIME DESTINATION bin)
|
|
216
|
+
endif()
|
|
217
|
+
message(STATUS "[pybcsv] Bundling CLI tools: ${PYBCSV_TOOLS}")
|
|
218
|
+
else()
|
|
219
|
+
message(STATUS "[pybcsv] CLI tools not bundled (sources or CLI11 not found, or disabled)")
|
|
220
|
+
endif()
|
|
@@ -17,4 +17,8 @@ prune tests
|
|
|
17
17
|
prune examples
|
|
18
18
|
global-exclude *.pyc
|
|
19
19
|
global-exclude __pycache__
|
|
20
|
-
global-exclude .DS_Store
|
|
20
|
+
global-exclude .DS_Store
|
|
21
|
+
# Bundled CLI tool sources (synced by sync_headers.py; compiled into the wheel)
|
|
22
|
+
recursive-include src *.cpp
|
|
23
|
+
recursive-include src *.h
|
|
24
|
+
recursive-include src *.hpp
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pybcsv
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.14.dev0
|
|
4
4
|
Summary: High-performance Python bindings for the BCSV (Binary CSV) library with pandas integration
|
|
5
5
|
Keywords: csv,binary,data-science,compression,performance,pandas,numpy,big-data,data-processing
|
|
6
6
|
Author-Email: Tobias Weber <weber.tobias.md@gmail.com>
|
|
@@ -156,6 +156,40 @@ with pybcsv.ReaderDirectAccess() as da:
|
|
|
156
156
|
print(da.read(100)) # alternative syntax
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
+
## Bundled Native CLI Tools
|
|
160
|
+
|
|
161
|
+
The wheel ships the core BCSV command-line tools as native, version-matched
|
|
162
|
+
binaries — installed into the environment's scripts directory, so they are on
|
|
163
|
+
PATH in an activated venv with no compiler or CMake required:
|
|
164
|
+
|
|
165
|
+
| Tool | Purpose |
|
|
166
|
+
|------|---------|
|
|
167
|
+
| `csv2bcsv` | CSV → BCSV with validated type inference (see the main CLI docs) |
|
|
168
|
+
| `bcsv2csv` | BCSV → CSV with row/column selection |
|
|
169
|
+
| `bcsvHeader` | Show a file's schema |
|
|
170
|
+
| `bcsvHead` / `bcsvTail` | Show the first/last N rows |
|
|
171
|
+
| `bcsvCast` | Change/narrow column types |
|
|
172
|
+
| `bcsvSampler` | Filter/project rows with a condition expression |
|
|
173
|
+
| `bcsvValidate` | Integrity-check a file |
|
|
174
|
+
| `bcsvRepair` | Recover data from truncated/corrupted files |
|
|
175
|
+
| `bcsvCompare` | Compare two files (with float tolerance) |
|
|
176
|
+
| `bcsvGenerator` | Generate synthetic test datasets |
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
csv2bcsv data.csv data.bcsv # from an activated environment
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
import pybcsv
|
|
184
|
+
|
|
185
|
+
pybcsv.tools.run("csv2bcsv", "data.csv", "data.bcsv", "--overwrite")
|
|
186
|
+
print(pybcsv.tools.run("bcsvHeader", "data.bcsv").stdout)
|
|
187
|
+
pybcsv.tools.path("csv2bcsv") # absolute path, e.g. for custom pipelines
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Source builds can opt out with `-DPYBCSV_BUILD_TOOLS=OFF`; the full tool suite
|
|
191
|
+
(and docs) live in the main repository under `src/tools/`.
|
|
192
|
+
|
|
159
193
|
## Parquet Conversion Tools (CLI)
|
|
160
194
|
|
|
161
195
|
Installing `pybcsv` provides two streaming command-line converters (require the
|
|
@@ -110,6 +110,40 @@ with pybcsv.ReaderDirectAccess() as da:
|
|
|
110
110
|
print(da.read(100)) # alternative syntax
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
+
## Bundled Native CLI Tools
|
|
114
|
+
|
|
115
|
+
The wheel ships the core BCSV command-line tools as native, version-matched
|
|
116
|
+
binaries — installed into the environment's scripts directory, so they are on
|
|
117
|
+
PATH in an activated venv with no compiler or CMake required:
|
|
118
|
+
|
|
119
|
+
| Tool | Purpose |
|
|
120
|
+
|------|---------|
|
|
121
|
+
| `csv2bcsv` | CSV → BCSV with validated type inference (see the main CLI docs) |
|
|
122
|
+
| `bcsv2csv` | BCSV → CSV with row/column selection |
|
|
123
|
+
| `bcsvHeader` | Show a file's schema |
|
|
124
|
+
| `bcsvHead` / `bcsvTail` | Show the first/last N rows |
|
|
125
|
+
| `bcsvCast` | Change/narrow column types |
|
|
126
|
+
| `bcsvSampler` | Filter/project rows with a condition expression |
|
|
127
|
+
| `bcsvValidate` | Integrity-check a file |
|
|
128
|
+
| `bcsvRepair` | Recover data from truncated/corrupted files |
|
|
129
|
+
| `bcsvCompare` | Compare two files (with float tolerance) |
|
|
130
|
+
| `bcsvGenerator` | Generate synthetic test datasets |
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
csv2bcsv data.csv data.bcsv # from an activated environment
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import pybcsv
|
|
138
|
+
|
|
139
|
+
pybcsv.tools.run("csv2bcsv", "data.csv", "data.bcsv", "--overwrite")
|
|
140
|
+
print(pybcsv.tools.run("bcsvHeader", "data.bcsv").stdout)
|
|
141
|
+
pybcsv.tools.path("csv2bcsv") # absolute path, e.g. for custom pipelines
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Source builds can opt out with `-DPYBCSV_BUILD_TOOLS=OFF`; the full tool suite
|
|
145
|
+
(and docs) live in the main repository under `src/tools/`.
|
|
146
|
+
|
|
113
147
|
## Parquet Conversion Tools (CLI)
|
|
114
148
|
|
|
115
149
|
Installing `pybcsv` provides two streaming command-line converters (require the
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.5.13
|