Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yieldbot/herodb
A simple key/value store backed by git.
https://github.com/yieldbot/herodb
Last synced: 2 months ago
JSON representation
A simple key/value store backed by git.
- Host: GitHub
- URL: https://github.com/yieldbot/herodb
- Owner: yieldbot
- License: gpl-3.0
- Created: 2012-03-30T18:24:49.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-12T05:36:04.000Z (about 10 years ago)
- Last Synced: 2024-03-26T05:38:35.041Z (3 months ago)
- Language: Python
- Homepage:
- Size: 276 KB
- Stars: 10
- Watchers: 50
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-git-powered - HeroDB
README
# About
Herodb is a key, value store written in Python that uses Git as its organizing principle.
# Getting started
## Server
Install prerequisites (if needed):
$ sudo apt-get install build-essential python-dev
Install Herodb:
$ git clone git://github.com/yieldbot/herodb.git
$ virtualenv herodb
$ cd herodb
$ source bin/activate
$ pip install -e . # install herodb as a live editable versionCreate a new Herodb store and start server using it:
$ mkdir my_store
$ python herodb/server.py my_store## Client
The client requires a running server. Please see Server above if one isn't running.
To run the client code in a Python REPL:
$ python
>>> from herodb import client
>>> store = client.StoreClient('http://localhost:8080', 'foo')
To store a Python dictionary type:>>> fruit = {'yellow': 'grapefruit', 'red': 'apple', 'green': 'grape', 'purple': 'plum'}
>>> store.create_store('fruit_market')
>>> [store.put('fruit_market', key, value) for key, value in fruit.items()]To retrieve a Python dictionary type:
>>> store.get('fruit_market')
To retrieve a particular value:
>>> store.get('fruit_market', 'yellow')
u'grapefruit'### Notes
- Keys are always Unicode.
- The int 0 is not a valid key.