A package for experimenting with different data chunking strategies
Project description
Chunking for Pandas
A Python package to chunk pandas/numpy data with different chunking strategies. PyPI package found here: https://pypi.org/project/chunking-pandas/
Requirements
- Python 3.10+
- Gradio
- pandas
- pytest
- numpy
- seaborn
- matplotlib
- pyarrow
Installation
pip install chunking-pandas
Or:
make install
Usage
from chunking_pandas import ChunkingExperiment
Create an instance of a Chunking class
class_instance = ChunkingExperiment(
"input.csv",
"output.csv",
n_chunks=3,
chunking_strategy="rows"
)
Then perform the chunking:
class_instance.process_chunks()
Run the web interface
To run as a command, either run:
make run-app
or as a module:
python -m chunking_pandas
Or as a console script:
chunking-interface
Or to run the app programmatically:
from chunking_pandas import launch_interface
launch_interface()
Features
- Multiple chunking strategies (rows, columns, tokens, blocks, parallel strategies)
- Support for CSV, JSON, Numpy and Parquet files
- Web interface using Gradio
- Comprehensive test suite
- Documentation using Sphinx
- Benchmarking various chunking strategies
- Basic examples contained within examples/
Development
To install development dependencies:
pip install -e .[dev]
Or:
make install-dev
Testing
To run tests, run the following command from the root folder:
pytest
Documentation
To install the documentation dependencies:
pip install -e .[docs]
Or:
make install-docs
To build the documentation:
make docs
To serve the documentation:
make docs-serve
Below are the full list of commands that can be run from the root folder:
make benchmark
make clean
make docs
make docs-clean
make docs-serve
make install
make install-docs
make lint
make run-app
make test
make typecheck
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chunking_pandas-0.1.8.tar.gz.
File metadata
- Download URL: chunking_pandas-0.1.8.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c25f03b9de25e846770ded7b4f2ecff7c82c30706cbcdb97066de7704f23c05
|
|
| MD5 |
e7edf8418da8e55bddd6d8735c31e25f
|
|
| BLAKE2b-256 |
98c32bc624fd7f304cf95ab01f38a98966b5198085154b9943fc73999da8b7c9
|
File details
Details for the file chunking_pandas-0.1.8-py3-none-any.whl.
File metadata
- Download URL: chunking_pandas-0.1.8-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29cf994f583c5a121e7fd3094306720d1c65f695b4650734b307af064ed84b49
|
|
| MD5 |
99db6b2b20d1ad0e048507c22ee16557
|
|
| BLAKE2b-256 |
6561ddbf737f97e4bda306ff0a2bcec04f2da7200cc760e04d5d0e52e846b6a2
|