Pipeline building toolkit
Project description
Pipeline Building Toolkit
pplkit is a lightweight Python library that provides a unified interface for
reading and writing data across multiple file formats, including CSV, JSON,
YAML, TOML, Parquet, and Pickle. It simplifies data pipeline workflows by
managing named directories and automatically dispatching I/O operations based
on file extensions.
For full documentation, visit the pplkit docs.
Installation
pip install pplkit
Quick Start
from pplkit.io import IOManager
iom = IOManager(input="path/to/input", output="path/to/output")
# Load data based on file extension
data = iom.load("data.csv", key="input")
# Dump data based on file extension
iom.dump(data, "data.parquet", key="output")
Using Loaders and Dumpers Directly
The get_loader and get_dumper functions can be used independently of
IOManager for lower-level control:
from pplkit.io import get_loader, get_dumper
# Get a loader/dumper by file extension
loader = get_loader(".json")
dumper = get_dumper(".json", obj_type=object)
data = loader("path/to/data.json")
dumper(data, "path/to/output.json")
Registering Custom Handlers
You can register your own loader or dumper for any suffix and object type:
import pathlib
import typing
import numpy as np
import numpy.typing as npt
from pplkit.io import register_loader, register_dumper
@register_loader(".npy", object)
def load_npy(path: pathlib.Path, **options: typing.Any) -> npt.NDArray:
return np.load(path, **options)
@register_dumper(".npy", object)
def dump_npy(
obj: npt.NDArray, path: pathlib.Path, **options: typing.Any
) -> None:
np.save(path, obj, **options)
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 pplkit-1.0.0.tar.gz.
File metadata
- Download URL: pplkit-1.0.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69c3a0e167c58c8f5ded1212583b69869fdd929f61bdf7991c44cfb59ea646e2
|
|
| MD5 |
4cbb492b590df8675bf49f8f64e7b84b
|
|
| BLAKE2b-256 |
e38b4ce383a144ce4b188965bfce6a6c77d9fa76999d96700c1f25fbdafc61e7
|
File details
Details for the file pplkit-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pplkit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee398cd5fc8aba90915ad4665c4fa90db1ec892b620c66b9c6381c53c5c0a70f
|
|
| MD5 |
7feb77cd23cf3cbb88901552daa7fbda
|
|
| BLAKE2b-256 |
969f670a6cb4ceec32eaf4ca4f181a5f3b7d8691245de7ee77a2076b4db04aee
|