simple json database for test projects
Project description
Features
- Easy to use
- Json friendly
- Light weight and fastest
- Support all python types
Instalation
Via pip
$ pip install spacedb
Via github
$ git clone https://github.com/fxckfxtxre/SpaceDB.git
$ cd SpaceDB
$ python setup.py
Docs
-
Initialization:
db = spacedb.Storage(<name>, <[args]>) example = spacedb.Storage("cars", ["name", "power", "color"])
-
Add
db.add(<arg>=<value>, ...) example.add(name="ferrari", power=1000, color="red")
-
Delete
db.delete(<arg>=<value>, ...) example.delete(power=1000) #Note: also use 2 and more args example.delete(color="red", power=1000) #its work
-
Update
Update data
db.update({<new args>}, <old arg>, ...) example.update({"name": "bmw"}, name="ferrari") #Note: also use 2 and more args example.update({"name": "bmw", "power": 750}, name="ferrari", color="red")
-
Search
Return first data by your query
db.search(<arg>=<value>, ...) example.search(name="ferrari") #return data or none #Note: also use 2 and more args example.search(name="ferrari", color="red")
-
Search All
As opposed to search this method returned all data by your query
db.search_all(<arg>=<value>, ...) example.search_all(name="ferrari") #return [data, data] or none
-
Unique
Check unique
db.unique(<arg>=<value>, ...) example.unique(name="ferrari") #if unique return true else false #Note: also use 2 and more args example.unique(name="ferrari", power=1000)
-
Data
All data from database
db.data() #return all data from db
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
spacedb-1.0.0.tar.gz
(2.7 kB
view hashes)