Using JSON as very lightweight database
Project description
JSON-as-DB
Using JSON as very lightweight database
>>> db = Database()
>>> db.load('output.json') # Load database from file
>>> db.add([{ # Add items what you want to add
... "id": "1002",
... "type": "Chocolate"
... })
['FqkmbYFSCRCAHQWydhM69v', 'RUJGcVBFANvNRReXa8U3En']
>>> db.save('output.json', json_kwds={'indent': 4}) # Just save it into file.
// output.json
{
"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
- Read the Docs - https://json-as-db.readthedocs.io/
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
json_as_db-0.2.4.tar.gz
(10.2 kB
view hashes)
Built Distribution
json_as_db-0.2.4-py3-none-any.whl
(11.0 kB
view hashes)
Close
Hashes for json_as_db-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19ddaf20c22fa07c89f638da202bedab8daf244794165cc005a4793ab0d9f34d |
|
MD5 | 309101c84fd9ed14db27120c2a10358a |
|
BLAKE2b-256 | 71076809231082c83ce4d49a74811e9ca174188727ae00a88f6187a0eba3f527 |