sofartQuick and dirty Python embedded and non-relationnal database | |
Download |
sofart Ranking & Summary
Advertisement
- License:
- BSD License
- Price:
- FREE
- Publisher Name:
- Geoffrey Lehee
- Publisher web site:
- https://github.com/Socketubs
sofart Tags
sofart Description
sofart is a quick and dirty Python embedded and non-relationnal database.For production and test, heavly inspired by Mongodb. Use Pickle for storage. Can be use in single (default) and multi user. It means real-time sync or "database connection" sync.InstallationInstall with pip:pip install sofartExampleEasy use:>>> from sofart import DatabaseCreate Database and a collection:>>> db = Database('/tmp/so.fart')>>> db.new_collection('test_collection')>>> db.collectionsPlay with collection:>>> c = db.get('test_collection')>>> post = { "artist": "Jambon",... "track": "I love my jambon"}>>> c.save(post)>>> c.find_one(){'track': 'I love my jambon', '_id': 'b2d6bf60-6c11-4e26-9357-efb28056e60d', 'artist': 'Jambon'}$>>> c.remove('b2d6bf60-6c11-4e26-9357-efb28056e60d')>>> c.find_one()>>>Some filter:>>> c.find_one({"artist": "Jambon"}){'track': 'I love my jambon', '_id': 'b2d6bf60-6c11-4e26-9357-efb28056e60d', 'artist': 'Jambon'}>>> c.find_one({"artist":"Bieber"})>>>TestsYou can run test under tests/test_test_sofart.py. And there is a populate script into tests/populate.py.PerformancesPerformances are certainly ridiculous, see BENCH. Single is higlhy faster than multi cause it's mainly work in RAM and just down data when database is closed. In otherwise multi down data at each request.Product's homepage
sofart Related Software