Fast and Lightweight json file based database
Project description
PyNoSQLite - Fast and Lightweight json file based database
getting started - install
$ pip3 install pynosqlite
basic usage
from pynosqlite import PyNoSQLite
file = 'abc.json'
db = PyNoSQLite(file=file)
#insert single record/document -> return id of the inserted item
id = db.insert({'name': 'robin', 'age': 10})
#insert multiple records/documents -> return List of ids of the inserted items
ids = db.insert_many([{'name': 'asher', 'age': 5}, {'name': 'gush', 'age': 8}])
#get all records -> return dictionary of all records
results = db.all()
#find by id/primary key -> return record dictionary if found else return None
result = db.find(id) #return robin's record
#search for a record -> not implemented yet --TODO--
result = db.search({'name': 'asher'})
#delete single record by id -> return id of deleted item
deleted_id = db.delete(id) #delete robin's record
#delete many records by ids -> return ids of successfully deleted items
deleted_ids = db.delete_many(ids) #delete asher's, gush's records
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file pynosqlite-0.2-py3-none-any.whl
.
File metadata
- Download URL: pynosqlite-0.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.62.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 384aea37ebed1a17e436f3e5d40d7b8af9170c7a8c1632c22ca975fc899921ee |
|
MD5 | 4e901e115528dedcd095b9382b7cf547 |
|
BLAKE2b-256 | 744cb0d5d861e256689df89c496db9b3e59049c792a8937ccea98d0312a87d05 |