https://github.com/reorx/litekv
Simple kv store for Python
https://github.com/reorx/litekv
Last synced: 27 days ago
JSON representation
Simple kv store for Python
- Host: GitHub
- URL: https://github.com/reorx/litekv
- Owner: reorx
- Created: 2014-05-09T08:58:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-01-06T12:50:13.000Z (over 4 years ago)
- Last Synced: 2025-03-23T08:22:20.563Z (about 1 month ago)
- Language: Python
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
LiteKV - redis-like wrapper for sqlite3
=======================================LiteKV is a wrapper for sqlite3, it turns sqlite3 into a kv data store,
and has similar APIs with redis-py.Simply execute ``python -m litekv`` (if you have installed it) or ``python litekv.py`` to run doctest.
Installation
------------::
pip install litekv
Usage
-----.. code:: python
>>> db = LiteKV(reset=True)
>>> db.set('a', '1')
>>> db.get('a')
'1'
>>> db.set('a', '2')
>>> db.get('a')
'2'
>>> db.set('b', '3')
>>> list(db.keys())
['a', 'b']
>>> db.delete('a')
>>> db.get('a') is None
TrueBenchmark
---------::
$ python -m litekv --benchmark
With rowid
Do 10000 inserts & reads
1215.88587897 Insertion per second
18041.2587533 Reads per secondWithout rowid
Do 10000 inserts & reads
1182.05950852 Insertion per second
17828.1725067 Reads per second