Skip to main content

A package for experimenting with different data chunking strategies

Project description

Chunking for Pandas

codecov Tests

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

chunking_pandas-0.1.8.tar.gz (7.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chunking_pandas-0.1.8-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

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

Hashes for chunking_pandas-0.1.8.tar.gz
Algorithm Hash digest
SHA256 4c25f03b9de25e846770ded7b4f2ecff7c82c30706cbcdb97066de7704f23c05
MD5 e7edf8418da8e55bddd6d8735c31e25f
BLAKE2b-256 98c32bc624fd7f304cf95ab01f38a98966b5198085154b9943fc73999da8b7c9

See more details on using hashes here.

File details

Details for the file chunking_pandas-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for chunking_pandas-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 29cf994f583c5a121e7fd3094306720d1c65f695b4650734b307af064ed84b49
MD5 99db6b2b20d1ad0e048507c22ee16557
BLAKE2b-256 6561ddbf737f97e4bda306ff0a2bcec04f2da7200cc760e04d5d0e52e846b6a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page