pyfloe 0.1.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.
- pyfloe-0.1.0/.gitignore +34 -0
- pyfloe-0.1.0/LICENSE +21 -0
- pyfloe-0.1.0/PKG-INFO +67 -0
- pyfloe-0.1.0/README.md +43 -0
- pyfloe-0.1.0/pyproject.toml +60 -0
- pyfloe-0.1.0/src/pyfloe/__init__.py +46 -0
- pyfloe-0.1.0/src/pyfloe/core.py +1117 -0
- pyfloe-0.1.0/src/pyfloe/expr.py +1440 -0
- pyfloe-0.1.0/src/pyfloe/io.py +612 -0
- pyfloe-0.1.0/src/pyfloe/plan.py +1306 -0
- pyfloe-0.1.0/src/pyfloe/schema.py +263 -0
- pyfloe-0.1.0/src/pyfloe/stream.py +697 -0
- pyfloe-0.1.0/tests/test_100k_integration.py +526 -0
- pyfloe-0.1.0/tests/test_core.py +623 -0
- pyfloe-0.1.0/tests/test_data/cities.json +5 -0
- pyfloe-0.1.0/tests/test_data/events.jsonl +5 -0
- pyfloe-0.1.0/tests/test_data/events_dt.csv +11 -0
- pyfloe-0.1.0/tests/test_data/orders.csv +8 -0
- pyfloe-0.1.0/tests/test_data/orders_dates.csv +4 -0
- pyfloe-0.1.0/tests/test_data/people.txt +4 -0
- pyfloe-0.1.0/tests/test_data/students.tsv +5 -0
- pyfloe-0.1.0/tests/test_datetime.py +398 -0
- pyfloe-0.1.0/tests/test_io.py +435 -0
- pyfloe-0.1.0/tests/test_pivot_unpivot.py +207 -0
- pyfloe-0.1.0/tests/test_sorted.py +398 -0
- pyfloe-0.1.0/tests/test_streaming.py +436 -0
pyfloe-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
wheels/
|
|
8
|
+
|
|
9
|
+
# Virtual environments
|
|
10
|
+
.venv/
|
|
11
|
+
|
|
12
|
+
# Tools
|
|
13
|
+
.ruff_cache/
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.mypy_cache/
|
|
16
|
+
|
|
17
|
+
# Coverage
|
|
18
|
+
htmlcov/
|
|
19
|
+
.coverage
|
|
20
|
+
coverage.xml
|
|
21
|
+
|
|
22
|
+
# IDE
|
|
23
|
+
.idea/
|
|
24
|
+
.vscode/
|
|
25
|
+
*.swp
|
|
26
|
+
*.swo
|
|
27
|
+
*~
|
|
28
|
+
|
|
29
|
+
# MkDocs
|
|
30
|
+
site/
|
|
31
|
+
|
|
32
|
+
# OS
|
|
33
|
+
.DS_Store
|
|
34
|
+
Thumbs.db
|
pyfloe-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Edwardvaneechoud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pyfloe-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyfloe
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Zero-dependency lazy dataframe. Lo-fi data processing for Python.
|
|
5
|
+
Project-URL: Repository, https://github.com/Edwardvaneechoud/pyfloe
|
|
6
|
+
Project-URL: Documentation, https://edwardvaneechoud.github.io/pyfloe/
|
|
7
|
+
Author: Edward van Eechoud
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: csv,dataframe,etl,lazy,streaming
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
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
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# pyfloe
|
|
26
|
+
|
|
27
|
+
**Zero-dependency, lazy dataframes for Python.**
|
|
28
|
+
|
|
29
|
+
pyfloe is a pure-Python dataframe library with lazy evaluation, query optimization, and type safety — no external dependencies required.
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from pyfloe import Floe, read_csv, col, row_number
|
|
33
|
+
|
|
34
|
+
result = (
|
|
35
|
+
read_csv("orders.csv")
|
|
36
|
+
.filter(col("amount") > 100)
|
|
37
|
+
.with_column("rank", row_number()
|
|
38
|
+
.over(partition_by="region", order_by="amount"))
|
|
39
|
+
.select("order_id", "region", "amount", "rank")
|
|
40
|
+
.sort("region", "rank")
|
|
41
|
+
.collect()
|
|
42
|
+
)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install pyfloe
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Key features
|
|
52
|
+
|
|
53
|
+
- **Lazy evaluation** — operations build a query plan; data flows only when you collect
|
|
54
|
+
- **Expression API** — composable column expressions with arithmetic, comparisons, string methods, and conditionals
|
|
55
|
+
- **Window functions** — `row_number`, `rank`, `dense_rank`, `cumsum`, `lag`, `lead`, and more
|
|
56
|
+
- **Datetime handling** — auto-detection from CSV, `.dt` accessor for extraction, truncation, and arithmetic
|
|
57
|
+
- **Streaming I/O** — read and write CSV, TSV, JSONL, JSON, and fixed-width files with constant memory
|
|
58
|
+
- **Query optimizer** — filter pushdown and column pruning
|
|
59
|
+
- **Type safety** — TypedDict validation and `TypedFloe` for IDE-friendly typed results
|
|
60
|
+
|
|
61
|
+
## Documentation
|
|
62
|
+
|
|
63
|
+
Full documentation is available at [edwardvaneechoud.github.io/pyfloe](https://edwardvaneechoud.github.io/pyfloe/).
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|
pyfloe-0.1.0/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# pyfloe
|
|
2
|
+
|
|
3
|
+
**Zero-dependency, lazy dataframes for Python.**
|
|
4
|
+
|
|
5
|
+
pyfloe is a pure-Python dataframe library with lazy evaluation, query optimization, and type safety — no external dependencies required.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from pyfloe import Floe, read_csv, col, row_number
|
|
9
|
+
|
|
10
|
+
result = (
|
|
11
|
+
read_csv("orders.csv")
|
|
12
|
+
.filter(col("amount") > 100)
|
|
13
|
+
.with_column("rank", row_number()
|
|
14
|
+
.over(partition_by="region", order_by="amount"))
|
|
15
|
+
.select("order_id", "region", "amount", "rank")
|
|
16
|
+
.sort("region", "rank")
|
|
17
|
+
.collect()
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install pyfloe
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Key features
|
|
28
|
+
|
|
29
|
+
- **Lazy evaluation** — operations build a query plan; data flows only when you collect
|
|
30
|
+
- **Expression API** — composable column expressions with arithmetic, comparisons, string methods, and conditionals
|
|
31
|
+
- **Window functions** — `row_number`, `rank`, `dense_rank`, `cumsum`, `lag`, `lead`, and more
|
|
32
|
+
- **Datetime handling** — auto-detection from CSV, `.dt` accessor for extraction, truncation, and arithmetic
|
|
33
|
+
- **Streaming I/O** — read and write CSV, TSV, JSONL, JSON, and fixed-width files with constant memory
|
|
34
|
+
- **Query optimizer** — filter pushdown and column pruning
|
|
35
|
+
- **Type safety** — TypedDict validation and `TypedFloe` for IDE-friendly typed results
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
Full documentation is available at [edwardvaneechoud.github.io/pyfloe](https://edwardvaneechoud.github.io/pyfloe/).
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyfloe"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Zero-dependency lazy dataframe. Lo-fi data processing for Python."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
authors = [{ name = "Edward van Eechoud" }]
|
|
9
|
+
keywords = ["dataframe", "lazy", "streaming", "etl", "csv"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 4 - Beta",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3.10",
|
|
16
|
+
"Programming Language :: Python :: 3.11",
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Programming Language :: Python :: 3.13",
|
|
19
|
+
"Topic :: Scientific/Engineering",
|
|
20
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
21
|
+
"Typing :: Typed",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Repository = "https://github.com/Edwardvaneechoud/pyfloe"
|
|
26
|
+
Documentation = "https://edwardvaneechoud.github.io/pyfloe/"
|
|
27
|
+
|
|
28
|
+
[build-system]
|
|
29
|
+
requires = ["hatchling"]
|
|
30
|
+
build-backend = "hatchling.build"
|
|
31
|
+
|
|
32
|
+
[tool.hatch.build.targets.wheel]
|
|
33
|
+
packages = ["src/pyfloe"]
|
|
34
|
+
|
|
35
|
+
[tool.hatch.build.targets.sdist]
|
|
36
|
+
include = ["src/pyfloe", "tests", "README.md", "pyproject.toml"]
|
|
37
|
+
|
|
38
|
+
[tool.pytest.ini_options]
|
|
39
|
+
testpaths = ["tests"]
|
|
40
|
+
|
|
41
|
+
[tool.ruff]
|
|
42
|
+
target-version = "py310"
|
|
43
|
+
line-length = 99
|
|
44
|
+
|
|
45
|
+
[tool.ruff.lint]
|
|
46
|
+
select = ["E", "F", "I", "UP"]
|
|
47
|
+
ignore = ["E501"]
|
|
48
|
+
|
|
49
|
+
[tool.ruff.lint.per-file-ignores]
|
|
50
|
+
"tests/*" = ["E402"]
|
|
51
|
+
"src/pyfloe/expr.py" = ["E402"]
|
|
52
|
+
|
|
53
|
+
[dependency-groups]
|
|
54
|
+
dev = [
|
|
55
|
+
"pytest>=8.0",
|
|
56
|
+
"ruff>=0.4",
|
|
57
|
+
"mkdocs>=1.6",
|
|
58
|
+
"mkdocs-material>=9.5",
|
|
59
|
+
"mkdocstrings[python]>=0.27",
|
|
60
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from .core import Floe, GroupByBuilder, TypedFloe
|
|
2
|
+
from .expr import (
|
|
3
|
+
Agg,
|
|
4
|
+
AggFunc,
|
|
5
|
+
Col,
|
|
6
|
+
CumKind,
|
|
7
|
+
DateTrunc,
|
|
8
|
+
DateTruncUnit,
|
|
9
|
+
Expr,
|
|
10
|
+
Join,
|
|
11
|
+
JoinHow,
|
|
12
|
+
Lit,
|
|
13
|
+
RankKind,
|
|
14
|
+
col,
|
|
15
|
+
dense_rank,
|
|
16
|
+
lit,
|
|
17
|
+
rank,
|
|
18
|
+
row_number,
|
|
19
|
+
when,
|
|
20
|
+
)
|
|
21
|
+
from .io import (
|
|
22
|
+
read_csv,
|
|
23
|
+
read_fixed_width,
|
|
24
|
+
read_json,
|
|
25
|
+
read_jsonl,
|
|
26
|
+
read_parquet,
|
|
27
|
+
read_tsv,
|
|
28
|
+
)
|
|
29
|
+
from .plan import Optimizer
|
|
30
|
+
from .schema import ColumnSchema, LazySchema
|
|
31
|
+
from .stream import Stream, from_chunks, from_iter
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
'Floe', 'TypedFloe', 'GroupByBuilder',
|
|
35
|
+
'col', 'lit', 'rank', 'dense_rank', 'row_number', 'when',
|
|
36
|
+
'Expr', 'Col', 'Lit',
|
|
37
|
+
'LazySchema', 'ColumnSchema',
|
|
38
|
+
'Optimizer',
|
|
39
|
+
'Agg', 'AggFunc', 'Join', 'JoinHow', 'DateTrunc', 'DateTruncUnit',
|
|
40
|
+
'RankKind', 'CumKind',
|
|
41
|
+
'read_csv', 'read_tsv', 'read_jsonl', 'read_json',
|
|
42
|
+
'read_fixed_width', 'read_parquet',
|
|
43
|
+
'from_iter', 'from_chunks', 'Stream',
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
__version__ = '0.1.0'
|