hybrid-frame 0.3.0__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.
@@ -0,0 +1,2 @@
1
+ include hybrid_frame.pyi
2
+ include README.md
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: hybrid-frame
3
+ Version: 0.3.0
4
+ Summary: High-performance DataFrame unifying DuckDB (out-of-core) and Pandas (ML feature engineering)
5
+ Author: mukesh
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/shell-bay/hybrid-frame
8
+ Project-URL: Repository, https://github.com/shell-bay/hybrid-frame
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Database :: Database Engines/Servers
21
+ Requires-Python: >=3.9
22
+ Requires-Dist: duckdb>=0.8.0
23
+ Requires-Dist: pandas>=1.5.0
24
+ Provides-Extra: arrow
25
+ Requires-Dist: pyarrow>=6.0.0; extra == "arrow"
26
+ Provides-Extra: memory-guard
27
+ Requires-Dist: psutil>=5.9.0; extra == "memory-guard"
28
+ Provides-Extra: ml
29
+ Requires-Dist: scikit-learn>=1.2.0; extra == "ml"
30
+ Provides-Extra: all
31
+ Requires-Dist: pyarrow>=6.0.0; extra == "all"
32
+ Requires-Dist: psutil>=5.9.0; extra == "all"
33
+ Requires-Dist: scikit-learn>=1.2.0; extra == "all"
@@ -0,0 +1,55 @@
1
+ # HybridFrame
2
+
3
+ A high-performance dual-engine DataFrame that transparently shifts between DuckDB (lazy/out-of-core) and Pandas (materialised/in-memory).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install hybrid-frame
9
+ ```
10
+
11
+ With optional dependencies:
12
+
13
+ ```bash
14
+ pip install hybrid-frame[arrow] # zero-copy Arrow materialisation
15
+ pip install hybrid-frame[memory-guard] # psutil-based OOM protection
16
+ pip install hybrid-frame[ml] # scikit-learn for ML export
17
+ pip install hybrid-frame[all] # everything
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ```python
23
+ from hybrid_frame import HybridFrame
24
+ import pandas as pd
25
+
26
+ # Wrap an existing DataFrame
27
+ hf = HybridFrame.from_pandas(pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]}))
28
+
29
+ # Lazy DuckDB operations — zero Pandas copies
30
+ hf.filter("x > 1").sort_values("y", ascending=False)
31
+
32
+ # Chain into Pandas for ML feature engineering
33
+ result = hf.assign(x2=lambda df: df["x"] * 2).to_pandas()
34
+
35
+ # Stream a CSV lazily from disk
36
+ hf = HybridFrame.from_csv("large_file.csv")
37
+ print(hf.filter("age > 21").shape)
38
+ ```
39
+
40
+ ## Features
41
+
42
+ - **Zero-copy engine transitions** — stays in Pandas mode for simple operations (head/tail/select/rename/drop), auto-transitions to DuckDB for complex SQL operations (filter/sort/groupby/join)
43
+ - **Lazy DuckDB connections** — no connection overhead until DuckDB is actually needed
44
+ - **Out-of-core streaming** — `fetch_chunked()`, `to_pandas_iter()`, `to_arrow_reader()` for memory-efficient processing
45
+ - **ML-ready export** — `to_ml_ready(target_column)` returns `(X, y)` tuple
46
+ - **File I/O** — `from_csv()`, `from_parquet()`, `write_csv()`, `write_parquet()`
47
+ - **Set operations** — `union`, `intersect`, `except_`
48
+ - **Cumulative operations** — `diff`, `cumsum`, `cumprod`, `cummin`, `cummax`
49
+ - **Value imputation** — `fillna`, `dropna`, `replace`, `clip`, `time_series_impute`
50
+ - **DuckDB SQL passthrough** — `sql("SELECT ... FROM self WHERE ...")`
51
+ - **Memory guard** — automatic OOM protection for large materialisations
52
+
53
+ ## Documentation
54
+
55
+ Full API reference is available in the class docstrings. Run `help(HybridFrame)` or visit [GitHub](https://github.com/shell-bay/hybrid-frame).