Look at this logo, some like Python snakes. This presentation of the database Codernitydb was developed in pure python.
Previously used the next tinydb this local database, but also in an API service in the next, at first feel the speed of some do not give force, the result of a see the way to achieve, is really too bird, incredibly is the memory of JSON, even a binary compression is not. The codernitydb described 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 the option to support the HTTP service version (Codernitydb-http), and the Python client library (codernitydb-pyclient), which targets a 100%-compliant, embedded version.
Main Features
1.Pyhon Native Support
2. Multiple indexes
3. Fast (up to 50 000 insert operations per second)
4. Inline mode (default) and server mode (codernitydb-http), plus client library (codernitydb-pyclient), can be 100% compliant
5. Easy to complete customer storage
Codernitydb Database Operation code instance:
Copy Code code 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)