Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zkurtz committed Nov 27, 2024
1 parent bc97d7a commit 9d605fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
with:
version: "0.5.4"

- name: Install extras
run: uv sync --group extras

- name: Linting check
run: uv run ruff check

Expand Down
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
# 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
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
```
import dummio
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
- json
- yaml
- simple dictionaries:
- json
- yaml
- pandas dataframes:
- csv
- parquet

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.
## 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
Expand All @@ -34,10 +47,6 @@ path = "io_example_file"
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)
Expand Down

0 comments on commit 9d605fb

Please sign in to comment.