dbjson is a module that can help you use json as database
Project description
dbjson
Get started
things that you need:
-
Python
- of course you need it
Installation
$- pip install dbjson
What is dbjson?
dbjson
is Python module
Everyone say JSON
can't be used as database but I don't think JSON
can't be used as database
With this module you can use JSON
as database since JSON
is just Python dictionary
Example Code
Creating json file
import dbjson as db
db.new('database')
Add a data inside our database
db.data().new('database','data1','value1')
If you open the JSON
file you can see that JSON
file will automatically update
//Before
{}
//After
{"data1": "value1"}
How about we want to edit the data?
Well,you can use rewrite
method
db.data().rewrite('database','data1','value2')
check the JSON
file
//Before
{"data1": "value1"}
//After
{"data1": "value2"}
To remove data we use remove
method
db.data().remove('database','data1')
//Before
{"data1": "value2"}
//After
{}
To remove all the data in our database,we use end
method
db.data().end('database')
Quicklinks
Github
Discord Server
License
MIT License
Copyright (c) 2021
muhammad184276@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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
Built Distribution
File details
Details for the file DBJSONS-1.0.2.tar.gz
.
File metadata
- Download URL: DBJSONS-1.0.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ee96b6a705ad277e8c78e3ce635ce758ad752cd6ac25683c3766bc6bd2d4665 |
|
MD5 | 32c475b251ed0888c781a53ba423de91 |
|
BLAKE2b-256 | d825edf20f50bc602c3b2533871fc1caf080f944911593900a9ee5fe91fd1b26 |
File details
Details for the file DBJSONS-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: DBJSONS-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 741af40fffaeadfcd2d7752e0a79959f80b4d519ec7f4944480181cb173eada8 |
|
MD5 | 2adf7337ee5f215f67958057937e53c1 |
|
BLAKE2b-256 | 198506cb5dd4b954fbc00d5d8ae94fa9c5be7588e5c46fcc88f9288d22d5e9ac |