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 further 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.jsonserializer 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.3.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for python_gitdb-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a1a2b2cecb4c84bcc399b887dfbeaf97e5e14fc90a7ccaf0d6e6061238d6290 |
|
MD5 | acd7b0758e0ec01558c12c0de56ce5ec |
|
BLAKE2b-256 | 954b0c3d44a854f3c54d4090b939c3f111abe2d46e7b18720ba820eea8d05ec5 |