Skip to main content

Easiest-possible IO for basic file types.

Project description

dummio

IO for dummies! We make IO as easy as possible by implementing the most common and recommendable default options. (Users may pass additional keyword arguments to the underlying IO methods.) For example, instead of

import json

with open(file_path, 'r', encoding='utf-8') as file:
    data = json.load(file)

you can simply

import dummio

data = dummio.json.load(file_path)

So far we support:

  • text
  • json
  • yaml

Note that yaml is not a required dependency; you may install dummio and use it for json without bothering with yaml installation. Any other IO modules to be added will similarly be optional.

Examples

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)

# JSON
dummio.json.save(data)
assert data == dummio.json.load(path)

# YAML
dummio.yaml.save(data)
assert data == dummio.yaml.load(path)

Installation

We're on pypi so you can just pip install dummio or poetry add dummio etc.

Development

Install poetry:

curl -sSL https://install.python-poetry.org | python3 -

Install pyenv and its virtualenv plugin. Then:

pyenv install 3.12.2
pyenv global 3.12.2
pyenv virtualenv 3.12.2 dummio
pyenv activate dummio

Install this package and its dependencies in your virtual env:

poetry install --with extras --with dev

Set up git hooks:

pre-commit install

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

dummio-0.0.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

dummio-0.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file dummio-0.0.2.tar.gz.

File metadata

  • Download URL: dummio-0.0.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for dummio-0.0.2.tar.gz
Algorithm Hash digest
SHA256 dbeb8f462364afe58e544f564eb850ee85ee887c96376d753868de4ab5029f29
MD5 1faff2459da01c8ea72205c7ce629fda
BLAKE2b-256 e1c53bc76afa3b3db7799117504c8e68af2f240a8b734e106af295dec70f4519

See more details on using hashes here.

File details

Details for the file dummio-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dummio-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for dummio-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7c122a4d7639e9e3d092c41d8e3c668c67852e4255d58a008dbf1e483246e4a
MD5 b999a77adb52a81a42334c05b0b958c4
BLAKE2b-256 87aef93af51dbc30362841c16bd6784974bd0c8e447cdca2321a2732543de8f0

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