Simple Python module to use git as key-value database.
Project description
python-gitdb is a small Python module that allows to use a git repository as key-value-store. The data can be serialized by different Serializers.
Serializers
There are several serializers provided to store the data:
JsonSerializer (included without futher modules)
BJsonSerializer
YamlSerializer
MsgPackSerializer
Depending on the selected serializer, the corresponding module must be installed.
Setup
poetry install python-gitdb
Usage
from gitdb import GitDb from gitdb.serializers import JsonSerializer # git repository that is used as database REPO = "/your/path/to/the/repository" # prepare the git repository database gitdb = GitDb(REPO, serializer=JsonSerializer) # add two entries gitdb.set("key_a", "test") gitdb.set("key_b", {"a": 1, "b": 2}) # load two entries print(gitdb.get("key_a")) print(gitdb.get("key_b"))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_gitdb-0.0.2.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for python_gitdb-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09aba88a08c22a65cd8b01731cc6c92ab00be79e1fdb0ccbae911e3fe77a94b8 |
|
MD5 | 5fcee2d6d497710d3fb454a765d55bde |
|
BLAKE2b-256 | c2b2dd027c6201b2476371151dbaef0c15db15a9dd8e6767aa58adc40ebf8029 |