JSON-as-DB
Using JSON as very lightweight database
>>> db = Database()
>>> db.load('output.json')
>>> db.add([{
... "id": "1002",
... "type": "Chocolate"
... })
['FqkmbYFSCRCAHQWydhM69v', 'RUJGcVBFANvNRReXa8U3En']
>>> db.save('output.json', json_kwds={'indent': 4})
{
"created_at": "2022-12-25T16:50:02.459068",
"creator": "json_as_db",
"data": {
"FqkmbYFSCRCAHQWydhM69v": {
"id": "1001",
"type": "Regular"
},
"RUJGcVBFANvNRReXa8U3En": {
"id": "1002",
"type": "Chocolate"
}
},
"updated_at": "2022-12-28T16:51:36.276790",
"version": "1.0.0"
}
Documentation
Installation
Installing via pip:
pip install json-as-db
Installing via GitHub repository,
git clone https://github.com/joonas-yoon/json-as-db.git
pip install -e json-as-db
Contributing
Contributing guidelines can be found CONTRIBUTING.md.
Welcome all contributions to the community and feel free to contribute.
License
Under the MIT license. See the LICENSE file for more info.