Skip to main content

Easiest-possible IO for basic file types.

Project description

dummio

Standardized wrappers for IO of various file types. The goal is to make IO as easy as possible by implementing the most common and recommendable default options. Of course users may pass additional keyword arguments to the underlying IO methods.

dummio replaces entire blocks of code like

import json

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

with 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)

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.1.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.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dummio-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6573ec167e44a6c6643c5ae6da4ef8c2e58a25fac7a7bdd5b6b3241987a54684
MD5 890b4a582dbe76baab30fede33bb97a0
BLAKE2b-256 c9336a420adde89bc71c002aec3a01ec245863265a88472f69740a8e7d968552

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dummio-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd239e25f701b2c971398d942b6f1633a36b8bf05fb3af65973f936c48ce2f05
MD5 cc4a8b4ffd41e6b4cbc539cc35a2aa50
BLAKE2b-256 2a5717b07930aa725e567fc1b7a8b80ff040575a5247702ba05d7b756df1cfbf

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