Read and write JSON files in one line.
- Read and write
- Automatically serialize and deserialize NumPy arrays.
- Uses simplejson.
- Defaults to calling
for_json()
to serialize objects which declare that method. - Future: Automatically round nested data structures.
Dump:
from missouri import json
json.dump({"foo": 123}, "example.json")
Load:
from missouri import json
data = json.load("example.json")
First, install Poetry.
After cloning the repo, run ./bootstrap.zsh
to initialize a virtual
environment with the project's dependencies.
Subsequently, run ./dev.py install
to update the dependencies.
This friendly API was developed at Body Labs for an library called baiji-serialization which provided one-line reading and writing of objects to JSON and YAML files and S3 keys on top of baiji (may it rest in peace). These were likely based on code written by alex weiss.
baiji is a river dolphin of the Yangtze; boto is a river dolphin of the Amazon. This library is not named after a dolphin, but it is named after a different big river.
The project is licensed under the Apache License, Version 2.0.