Metadata-Version: 2.1
Name: python-gitdb
Version: 0.0.2
Summary: Simple Python module to use git as key-value database.
License: MIT
Author: Ansgar Kellner
Author-email: keans@gmx.de
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: pygit2 (>=1.13.3,<2.0.0)
Description-Content-Type: text/x-rst

gitdb
=====

``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"))

