Easiest-possible IO for basic file types.
Project description
dummio
IO for dummies! We make IO as easy as possible by providing a unified save/load interface, using the most common and recommendable default options for IO between various object types and file types. (Users may pass additional keyword arguments to the underlying IO methods.)
Simple IO calls
dummio simplifies IO calls for some file types. For example, instead of
with open(file_path, 'r', encoding='utf-8') as file:
data = json.load(file)
you can simply
data = dummio.json.load(file_path)
Standardized IO interface
In some coding applications it is desirable to pass an IO module as an argument to a function. Here it is convenient to pass a dummio submodule, since all dummio submodules have the same save and load interface, having equivalent signatures (except for differences hidden in **kwargs).
Supported object and file types
So far we support:
- text
- simple dictionaries:
- json
- yaml
- pandas dataframes:
- csv
- parquet
Dependencies
dummio has no required dependencies. For example, calling from dummio.pandas import df_parquet will raise a helpful message to install pandas if you have not already done so.
Examples
Basic IO methods can be accessed directly as dummio.text, dummio.json, etc:.
import dummio
text = "hello world"
data = {"key": text}
path = "io_example_file"
# Text
dummio.text.save(text, path=path)
assert text == dummio.text.load(path)
# YAML
dummio.yaml.save(data)
assert data == dummio.yaml.load(path)
Installation
We're on pypi, so pip install dummio.
Development
git clone git@github.com:zkurtz/dummio.git
cd dummio
pip install uv
uv sync --group extras
source .venv/bin/activate
pre-commit install
Project details
Release history Release notifications | RSS feed
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 dummio-1.0.0.tar.gz.
File metadata
- Download URL: dummio-1.0.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a5a2437fdac46fdf469b043ce062d826d370c92af8bad39e30e988ce213e179
|
|
| MD5 |
379f64d5b9caf9264219551c8983b9c5
|
|
| BLAKE2b-256 |
83bceeaae4d759a927e8d927b2820f3beaf6b481c5f2d318d2728edeeb624263
|
File details
Details for the file dummio-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dummio-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
662b4a429ae5d623f9730f002d93e4934f896ac1e5dad7af793f1cb7b3cb2b98
|
|
| MD5 |
dd9ebef96773b21cb4cdd17ce41c6ae4
|
|
| BLAKE2b-256 |
6c5e38d8cf7e5c73311a8496f9e68db2b6b8ea777c8a4e14eb6856ed7cbe8aee
|