arnio 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.
- arnio-0.1.0/.gitignore +218 -0
- arnio-0.1.0/CMakeLists.txt +20 -0
- arnio-0.1.0/LICENSE +21 -0
- arnio-0.1.0/PKG-INFO +189 -0
- arnio-0.1.0/README.md +175 -0
- arnio-0.1.0/arnio/__init__.py +42 -0
- arnio-0.1.0/arnio/_core.py +25 -0
- arnio-0.1.0/arnio/cleaning.py +90 -0
- arnio-0.1.0/arnio/convert.py +88 -0
- arnio-0.1.0/arnio/frame.py +56 -0
- arnio-0.1.0/arnio/io.py +48 -0
- arnio-0.1.0/arnio/pipeline.py +58 -0
- arnio-0.1.0/bindings/CMakeLists.txt +5 -0
- arnio-0.1.0/bindings/bind_arnio.cpp +137 -0
- arnio-0.1.0/cpp/CMakeLists.txt +12 -0
- arnio-0.1.0/cpp/include/arnio/cleaning.h +32 -0
- arnio-0.1.0/cpp/include/arnio/column.h +43 -0
- arnio-0.1.0/cpp/include/arnio/csv_reader.h +46 -0
- arnio-0.1.0/cpp/include/arnio/frame.h +45 -0
- arnio-0.1.0/cpp/include/arnio/types.h +38 -0
- arnio-0.1.0/cpp/src/cleaning.cpp +320 -0
- arnio-0.1.0/cpp/src/column.cpp +64 -0
- arnio-0.1.0/cpp/src/csv_reader.cpp +243 -0
- arnio-0.1.0/cpp/src/frame.cpp +101 -0
- arnio-0.1.0/pyproject.toml +28 -0
- arnio-0.1.0/sample.csv +3 -0
- arnio-0.1.0/setup.py +7 -0
- arnio-0.1.0/tests/conftest.py +63 -0
- arnio-0.1.0/tests/test_cleaning.py +109 -0
- arnio-0.1.0/tests/test_convert.py +56 -0
- arnio-0.1.0/tests/test_csv.py +58 -0
- arnio-0.1.0/tests/test_pipeline.py +59 -0
arnio-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
# Temporary file for partial code execution
|
|
204
|
+
tempCodeRunnerFile.py
|
|
205
|
+
|
|
206
|
+
# Ruff stuff:
|
|
207
|
+
.ruff_cache/
|
|
208
|
+
|
|
209
|
+
# PyPI configuration file
|
|
210
|
+
.pypirc
|
|
211
|
+
|
|
212
|
+
# Marimo
|
|
213
|
+
marimo/_static/
|
|
214
|
+
marimo/_lsp/
|
|
215
|
+
__marimo__/
|
|
216
|
+
|
|
217
|
+
# Streamlit
|
|
218
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.15)
|
|
2
|
+
project(arnio LANGUAGES CXX)
|
|
3
|
+
|
|
4
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
5
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
6
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
7
|
+
|
|
8
|
+
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
|
9
|
+
|
|
10
|
+
# Fetch pybind11
|
|
11
|
+
include(FetchContent)
|
|
12
|
+
FetchContent_Declare(
|
|
13
|
+
pybind11
|
|
14
|
+
GIT_REPOSITORY https://github.com/pybind/pybind11.git
|
|
15
|
+
GIT_TAG v2.12.0
|
|
16
|
+
)
|
|
17
|
+
FetchContent_MakeAvailable(pybind11)
|
|
18
|
+
|
|
19
|
+
add_subdirectory(cpp)
|
|
20
|
+
add_subdirectory(bindings)
|
arnio-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anish Raj
|
|
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.
|
arnio-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: arnio
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Fast CSV processing and data cleaning companion for pandas
|
|
5
|
+
Author: Anish Raj
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Requires-Dist: pandas>=1.5
|
|
9
|
+
Requires-Dist: numpy>=1.23
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
12
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# arnio
|
|
16
|
+
|
|
17
|
+
**Fast CSV processing and data cleaning for Python — powered by C++.**
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
arnio is a lightweight, C++-backed Python library designed to make CSV ingestion and data cleaning faster, simpler, and more memory-efficient. It sits comfortably alongside your existing pandas workflows, handling the heavy lifting before your data ever hits a DataFrame.
|
|
22
|
+
|
|
23
|
+
If you've ever waited too long for a large CSV to load, or spent more time wrangling messy columns than actually analyzing data — arnio is built for you.
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
import arnio as ar
|
|
27
|
+
|
|
28
|
+
df = ar.read_csv("sales_data.csv")
|
|
29
|
+
clean = ar.clean(df, drop_nulls=True, strip_whitespace=True)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Why arnio?
|
|
35
|
+
|
|
36
|
+
Python's data ecosystem is excellent — but reading and cleaning raw CSV files at scale has always been a rough edge. `pandas.read_csv` is versatile and reliable, but it isn't optimized for raw speed or low memory pressure. Preprocessing logic ends up scattered across notebooks, inconsistent between projects, and slow on large files.
|
|
37
|
+
|
|
38
|
+
arnio addresses this directly:
|
|
39
|
+
|
|
40
|
+
- **Reads large CSVs faster** using a C++ parsing core with minimal Python overhead
|
|
41
|
+
- **Provides a clean, composable cleaning API** so preprocessing logic is explicit, readable, and repeatable
|
|
42
|
+
- **Works with pandas** — arnio outputs standard DataFrames; it's a faster on-ramp, not a replacement
|
|
43
|
+
- **Keeps memory usage low** by parsing efficiently before data is materialized in Python
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Key Features
|
|
48
|
+
|
|
49
|
+
| Feature | Description |
|
|
50
|
+
|---|---|
|
|
51
|
+
| ⚡ C++ CSV parser | Reads large files with significantly lower overhead than pure-Python parsers |
|
|
52
|
+
| 🧹 Cleaning primitives | Drop nulls, strip whitespace, fix dtypes, normalize column names, and more |
|
|
53
|
+
| 🐼 pandas-compatible output | Returns standard `pd.DataFrame` objects — drop arnio into any existing workflow |
|
|
54
|
+
| 🧠 Memory-conscious | Designed to avoid unnecessary copies during ingestion and cleaning |
|
|
55
|
+
| 🔗 Composable API | Chain cleaning operations in a clear, readable style |
|
|
56
|
+
| 📦 Simple import | `import arnio as ar` — that's it |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install arnio
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
> **Note:** arnio requires Python 3.9+ and a platform with a compatible C++ build (wheels are provided for Linux, macOS, and Windows on PyPI). For source builds, a C++17-compatible compiler is required.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
### Reading a CSV
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
import arnio as ar
|
|
76
|
+
|
|
77
|
+
# Fast CSV ingestion — returns a pandas DataFrame
|
|
78
|
+
df = ar.read_csv("data/transactions.csv")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Cleaning Data
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
import arnio as ar
|
|
85
|
+
|
|
86
|
+
df = ar.read_csv("data/customers.csv")
|
|
87
|
+
|
|
88
|
+
clean = ar.clean(
|
|
89
|
+
df,
|
|
90
|
+
drop_nulls=True, # Remove rows with missing values
|
|
91
|
+
strip_whitespace=True, # Trim leading/trailing whitespace in string columns
|
|
92
|
+
normalize_columns=True, # Lowercase, underscore-separated column names
|
|
93
|
+
)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Chaining Operations
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import arnio as ar
|
|
100
|
+
|
|
101
|
+
result = (
|
|
102
|
+
ar.read_csv("data/orders.csv")
|
|
103
|
+
.pipe(ar.drop_nulls)
|
|
104
|
+
.pipe(ar.normalize_columns)
|
|
105
|
+
.pipe(ar.strip_whitespace)
|
|
106
|
+
)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
arnio operations return standard DataFrames, so you can pass results directly into any pandas, scikit-learn, or plotting workflow without modification.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## arnio + pandas: Better Together
|
|
114
|
+
|
|
115
|
+
arnio is not a pandas replacement. It is the step that happens *before* pandas — and occasionally alongside it.
|
|
116
|
+
|
|
117
|
+
Think of it this way:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
Raw CSV on disk
|
|
121
|
+
│
|
|
122
|
+
▼
|
|
123
|
+
ar.read_csv() ← Fast C++ parsing, low memory
|
|
124
|
+
│
|
|
125
|
+
▼
|
|
126
|
+
ar.clean() ← Consistent preprocessing
|
|
127
|
+
│
|
|
128
|
+
▼
|
|
129
|
+
pd.DataFrame ← Your normal pandas workflow continues here
|
|
130
|
+
│
|
|
131
|
+
▼
|
|
132
|
+
Analysis, modeling, visualization — business as usual
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Once your data is clean and in a DataFrame, pandas takes over completely. arnio simply makes the path from raw file to clean DataFrame faster and more predictable.
|
|
136
|
+
|
|
137
|
+
> **Philosophy:** arnio doesn't compete with the pandas ecosystem — it strengthens it. The goal is to reduce the friction between raw data and productive analysis.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Roadmap
|
|
142
|
+
|
|
143
|
+
arnio is actively in development. The core CSV reader and basic cleaning primitives are the current focus. Planned work includes:
|
|
144
|
+
|
|
145
|
+
- [x] C++ CSV parser core
|
|
146
|
+
- [x] Basic cleaning API (`drop_nulls`, `strip_whitespace`, `normalize_columns`)
|
|
147
|
+
- [x] pandas DataFrame output
|
|
148
|
+
- [ ] Streaming / chunked reads for very large files
|
|
149
|
+
- [ ] Type inference and automatic dtype casting
|
|
150
|
+
- [ ] Encoding detection and normalization
|
|
151
|
+
- [ ] Schema validation and column contracts
|
|
152
|
+
- [ ] Parallel parsing across CPU cores
|
|
153
|
+
- [ ] CLI tool (`arnio clean data.csv --output clean.csv`)
|
|
154
|
+
- [ ] Async-friendly API for use in async pipelines
|
|
155
|
+
|
|
156
|
+
Feedback on priorities is welcome — open a [GitHub Discussion](https://github.com/yourusername/arnio/discussions) to share what matters most to you.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Contributing
|
|
161
|
+
|
|
162
|
+
Contributions are welcome and genuinely appreciated. arnio is early-stage, which means there's real space to shape how it grows.
|
|
163
|
+
|
|
164
|
+
**To get started:**
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
git clone https://github.com/yourusername/arnio.git
|
|
168
|
+
cd arnio
|
|
169
|
+
pip install -e ".[dev]"
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Before submitting a pull request:
|
|
173
|
+
|
|
174
|
+
- Run the test suite: `pytest tests/`
|
|
175
|
+
- Follow the existing code style (enforced via `ruff`)
|
|
176
|
+
- Keep PRs focused — one concern per pull request
|
|
177
|
+
- Open an issue first for significant changes so the direction can be discussed
|
|
178
|
+
|
|
179
|
+
There's a [CONTRIBUTING.md](CONTRIBUTING.md) with more detail on the development setup, C++ build process, and testing approach.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## License
|
|
184
|
+
|
|
185
|
+
arnio is released under the [MIT License](LICENSE).
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
*Built to make Python data work feel faster and cleaner — one CSV at a time.*
|
arnio-0.1.0/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# arnio
|
|
2
|
+
|
|
3
|
+
**Fast CSV processing and data cleaning for Python — powered by C++.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
arnio is a lightweight, C++-backed Python library designed to make CSV ingestion and data cleaning faster, simpler, and more memory-efficient. It sits comfortably alongside your existing pandas workflows, handling the heavy lifting before your data ever hits a DataFrame.
|
|
8
|
+
|
|
9
|
+
If you've ever waited too long for a large CSV to load, or spent more time wrangling messy columns than actually analyzing data — arnio is built for you.
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
import arnio as ar
|
|
13
|
+
|
|
14
|
+
df = ar.read_csv("sales_data.csv")
|
|
15
|
+
clean = ar.clean(df, drop_nulls=True, strip_whitespace=True)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Why arnio?
|
|
21
|
+
|
|
22
|
+
Python's data ecosystem is excellent — but reading and cleaning raw CSV files at scale has always been a rough edge. `pandas.read_csv` is versatile and reliable, but it isn't optimized for raw speed or low memory pressure. Preprocessing logic ends up scattered across notebooks, inconsistent between projects, and slow on large files.
|
|
23
|
+
|
|
24
|
+
arnio addresses this directly:
|
|
25
|
+
|
|
26
|
+
- **Reads large CSVs faster** using a C++ parsing core with minimal Python overhead
|
|
27
|
+
- **Provides a clean, composable cleaning API** so preprocessing logic is explicit, readable, and repeatable
|
|
28
|
+
- **Works with pandas** — arnio outputs standard DataFrames; it's a faster on-ramp, not a replacement
|
|
29
|
+
- **Keeps memory usage low** by parsing efficiently before data is materialized in Python
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Key Features
|
|
34
|
+
|
|
35
|
+
| Feature | Description |
|
|
36
|
+
|---|---|
|
|
37
|
+
| ⚡ C++ CSV parser | Reads large files with significantly lower overhead than pure-Python parsers |
|
|
38
|
+
| 🧹 Cleaning primitives | Drop nulls, strip whitespace, fix dtypes, normalize column names, and more |
|
|
39
|
+
| 🐼 pandas-compatible output | Returns standard `pd.DataFrame` objects — drop arnio into any existing workflow |
|
|
40
|
+
| 🧠 Memory-conscious | Designed to avoid unnecessary copies during ingestion and cleaning |
|
|
41
|
+
| 🔗 Composable API | Chain cleaning operations in a clear, readable style |
|
|
42
|
+
| 📦 Simple import | `import arnio as ar` — that's it |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install arnio
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> **Note:** arnio requires Python 3.9+ and a platform with a compatible C++ build (wheels are provided for Linux, macOS, and Windows on PyPI). For source builds, a C++17-compatible compiler is required.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
### Reading a CSV
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import arnio as ar
|
|
62
|
+
|
|
63
|
+
# Fast CSV ingestion — returns a pandas DataFrame
|
|
64
|
+
df = ar.read_csv("data/transactions.csv")
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Cleaning Data
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
import arnio as ar
|
|
71
|
+
|
|
72
|
+
df = ar.read_csv("data/customers.csv")
|
|
73
|
+
|
|
74
|
+
clean = ar.clean(
|
|
75
|
+
df,
|
|
76
|
+
drop_nulls=True, # Remove rows with missing values
|
|
77
|
+
strip_whitespace=True, # Trim leading/trailing whitespace in string columns
|
|
78
|
+
normalize_columns=True, # Lowercase, underscore-separated column names
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Chaining Operations
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import arnio as ar
|
|
86
|
+
|
|
87
|
+
result = (
|
|
88
|
+
ar.read_csv("data/orders.csv")
|
|
89
|
+
.pipe(ar.drop_nulls)
|
|
90
|
+
.pipe(ar.normalize_columns)
|
|
91
|
+
.pipe(ar.strip_whitespace)
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
arnio operations return standard DataFrames, so you can pass results directly into any pandas, scikit-learn, or plotting workflow without modification.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## arnio + pandas: Better Together
|
|
100
|
+
|
|
101
|
+
arnio is not a pandas replacement. It is the step that happens *before* pandas — and occasionally alongside it.
|
|
102
|
+
|
|
103
|
+
Think of it this way:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Raw CSV on disk
|
|
107
|
+
│
|
|
108
|
+
▼
|
|
109
|
+
ar.read_csv() ← Fast C++ parsing, low memory
|
|
110
|
+
│
|
|
111
|
+
▼
|
|
112
|
+
ar.clean() ← Consistent preprocessing
|
|
113
|
+
│
|
|
114
|
+
▼
|
|
115
|
+
pd.DataFrame ← Your normal pandas workflow continues here
|
|
116
|
+
│
|
|
117
|
+
▼
|
|
118
|
+
Analysis, modeling, visualization — business as usual
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Once your data is clean and in a DataFrame, pandas takes over completely. arnio simply makes the path from raw file to clean DataFrame faster and more predictable.
|
|
122
|
+
|
|
123
|
+
> **Philosophy:** arnio doesn't compete with the pandas ecosystem — it strengthens it. The goal is to reduce the friction between raw data and productive analysis.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Roadmap
|
|
128
|
+
|
|
129
|
+
arnio is actively in development. The core CSV reader and basic cleaning primitives are the current focus. Planned work includes:
|
|
130
|
+
|
|
131
|
+
- [x] C++ CSV parser core
|
|
132
|
+
- [x] Basic cleaning API (`drop_nulls`, `strip_whitespace`, `normalize_columns`)
|
|
133
|
+
- [x] pandas DataFrame output
|
|
134
|
+
- [ ] Streaming / chunked reads for very large files
|
|
135
|
+
- [ ] Type inference and automatic dtype casting
|
|
136
|
+
- [ ] Encoding detection and normalization
|
|
137
|
+
- [ ] Schema validation and column contracts
|
|
138
|
+
- [ ] Parallel parsing across CPU cores
|
|
139
|
+
- [ ] CLI tool (`arnio clean data.csv --output clean.csv`)
|
|
140
|
+
- [ ] Async-friendly API for use in async pipelines
|
|
141
|
+
|
|
142
|
+
Feedback on priorities is welcome — open a [GitHub Discussion](https://github.com/yourusername/arnio/discussions) to share what matters most to you.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Contributing
|
|
147
|
+
|
|
148
|
+
Contributions are welcome and genuinely appreciated. arnio is early-stage, which means there's real space to shape how it grows.
|
|
149
|
+
|
|
150
|
+
**To get started:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
git clone https://github.com/yourusername/arnio.git
|
|
154
|
+
cd arnio
|
|
155
|
+
pip install -e ".[dev]"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Before submitting a pull request:
|
|
159
|
+
|
|
160
|
+
- Run the test suite: `pytest tests/`
|
|
161
|
+
- Follow the existing code style (enforced via `ruff`)
|
|
162
|
+
- Keep PRs focused — one concern per pull request
|
|
163
|
+
- Open an issue first for significant changes so the direction can be discussed
|
|
164
|
+
|
|
165
|
+
There's a [CONTRIBUTING.md](CONTRIBUTING.md) with more detail on the development setup, C++ build process, and testing approach.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
arnio is released under the [MIT License](LICENSE).
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
*Built to make Python data work feel faster and cleaner — one CSV at a time.*
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""
|
|
2
|
+
arnio — Fast CSV processing and data cleaning companion for pandas.
|
|
3
|
+
|
|
4
|
+
import arnio as ar
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
|
|
9
|
+
from .frame import ArFrame
|
|
10
|
+
from .io import read_csv, scan_csv
|
|
11
|
+
from .cleaning import (
|
|
12
|
+
drop_nulls,
|
|
13
|
+
fill_nulls,
|
|
14
|
+
drop_duplicates,
|
|
15
|
+
strip_whitespace,
|
|
16
|
+
normalize_case,
|
|
17
|
+
rename_columns,
|
|
18
|
+
cast_types,
|
|
19
|
+
)
|
|
20
|
+
from .convert import to_pandas, from_pandas
|
|
21
|
+
from .pipeline import pipeline
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
# Core class
|
|
25
|
+
"ArFrame",
|
|
26
|
+
# I/O
|
|
27
|
+
"read_csv",
|
|
28
|
+
"scan_csv",
|
|
29
|
+
# Cleaning
|
|
30
|
+
"drop_nulls",
|
|
31
|
+
"fill_nulls",
|
|
32
|
+
"drop_duplicates",
|
|
33
|
+
"strip_whitespace",
|
|
34
|
+
"normalize_case",
|
|
35
|
+
"rename_columns",
|
|
36
|
+
"cast_types",
|
|
37
|
+
# Conversion
|
|
38
|
+
"to_pandas",
|
|
39
|
+
"from_pandas",
|
|
40
|
+
# Pipeline
|
|
41
|
+
"pipeline",
|
|
42
|
+
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""
|
|
2
|
+
arnio._core
|
|
3
|
+
Internal module that imports the C++ extension.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
from ._arnio_cpp import ( # type: ignore[import-not-found]
|
|
8
|
+
Frame as _Frame,
|
|
9
|
+
Column as _Column,
|
|
10
|
+
CsvConfig as _CsvConfig,
|
|
11
|
+
CsvReader as _CsvReader,
|
|
12
|
+
DType as _DType,
|
|
13
|
+
drop_nulls as _drop_nulls,
|
|
14
|
+
fill_nulls as _fill_nulls,
|
|
15
|
+
drop_duplicates as _drop_duplicates,
|
|
16
|
+
strip_whitespace as _strip_whitespace,
|
|
17
|
+
normalize_case as _normalize_case,
|
|
18
|
+
rename_columns as _rename_columns,
|
|
19
|
+
cast_types as _cast_types,
|
|
20
|
+
)
|
|
21
|
+
except ImportError as e:
|
|
22
|
+
raise ImportError(
|
|
23
|
+
"arnio C++ extension (_arnio_cpp) not found. "
|
|
24
|
+
"Please install arnio with: pip install ."
|
|
25
|
+
) from e
|