Look at this logo, some python-like snakes. The database Codernitydb introduced this time is purely python-developed.
The previous use of the next tinydb this local database, also in an API service used, at first felt that the speed of some not to force, the result of a look at the implementation of the way, is really too bird, incredibly is the storage of JSON, even a binary compression is not. The Codernitydb introduced here is also a small database of pure development.
Codernitydb is an open source, pure Python language (no third party dependent), fast, multi-platform NoSQL database. It has options to support the HTTP service version (Codernitydb-http), and the Python client library (codernitydb-pyclient), which targets the 100% compatible embedded version.
Key Features
1.Pyhon Native Support
2. Multiple indexes
3. Fast (up to 50 000 insert operations per second)
4. Embedded mode (default) and server mode (codernitydb-http), plus client library (codernitydb-pyclient), capable of 100% compatible
5. Easy to complete customer storage
Codernitydb Database Operation code Example:
The code is as follows:
Insert (Simple)
From codernitydb.database Import Database
db = Database ('/tmp/tut1 ')
Db.create ()
Insertdict = {' X ': 1}
Print Db.insert (insertdict)
Insert
From codernitydb.database Import Database
From Codernitydb.hash_index import Hashindex
Class Withxindex (Hashindex):
def __init__ (self, *args, **kwargs):
kwargs[' key_format ' = ' I '
Super (Withxindex, self). __init__ (*args, **kwargs)
def make_key_value (self, data):
A_val = Data.get ("x")
If A_val is not None:
Return A_val, None
Return None
def make_key (self, key):
Return key
db = Database ('/tmp/tut2 ')
Db.create ()
X_ind = Withxindex (Db.path, ' x ')
Db.add_index (X_ind)
Print Db.insert ({' X ': 1})
Count
From codernitydb.database Import Database
db = Database ('/tmp/tut1 ')
Db.open ()
Print Db.count (Db.all, ' x ')
Get
From codernitydb.database Import Database
db = Database ('/tmp/tut2 ')
Db.open ()
Print db.get (' x ', 1, with_doc=true)
Delete
From codernitydb.database Import Database
db = Database ('/tmp/tut2 ')
Db.open ()
Curr = Db.get (' x ', 1, with_doc=true)
doc = curr[' Doc ')
Db.delete (DOC)
Update
From codernitydb.database Import Database
db = Database ('/tmp/tut2 ')
Db.create ()
Curr = Db.get (' x ', 1, with_doc=true)
doc = curr[' Doc ')
doc[' Updated ') = True
Db.update (DOC)