Skip to content

metabolize/missouri

Repository files navigation

missouri

version python version license types

Read and write JSON files in one line.

Features

  • 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.

Usage

Dump:

from missouri import json

json.dump({"foo": 123}, "example.json")

Load:

from missouri import json

data = json.load("example.json")

Development

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.

Acknowledgements

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.

Naming

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.

License

The project is licensed under the Apache License, Version 2.0.