{"id":16993146,"url":"https://github.com/jirikuncar/git-json-tree","last_synced_at":"2025-04-12T04:20:37.421Z","repository":{"id":57434657,"uuid":"117280028","full_name":"jirikuncar/git-json-tree","owner":"jirikuncar","description":"Store JSON objects as a Git trees.","archived":false,"fork":false,"pushed_at":"2018-02-17T21:40:34.000Z","size":65,"stargazers_count":3,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T23:51:44.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://git-json-tree.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jirikuncar.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-12T19:28:58.000Z","updated_at":"2024-02-25T08:07:18.000Z","dependencies_parsed_at":"2022-09-10T01:50:41.296Z","dependency_job_id":null,"html_url":"https://github.com/jirikuncar/git-json-tree","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirikuncar%2Fgit-json-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirikuncar%2Fgit-json-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirikuncar%2Fgit-json-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirikuncar%2Fgit-json-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jirikuncar","download_url":"https://codeload.github.com/jirikuncar/git-json-tree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514390,"owners_count":21116952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T03:32:13.813Z","updated_at":"2025-04-12T04:20:37.394Z","avatar_url":"https://github.com/jirikuncar.png","language":"Python","readme":"===============\n Git-JSON-Tree\n===============\n\n.. image:: https://img.shields.io/travis/jirikuncar/git-json-tree.svg\n   :target: https://travis-ci.org/jirikuncar/git-json-tree\n\n.. image:: https://img.shields.io/coveralls/jirikuncar/git-json-tree.svg\n   :target: https://coveralls.io/r/jirikuncar/git-json-tree\n\n.. image:: https://img.shields.io/github/tag/jirikuncar/git-json-tree.svg\n   :target: https://github.com/jirikuncar/git-json-tree/releases\n\n.. image:: http://readthedocs.org/projects/git-json-tree/badge/?version=latest\n   :target: http://git-json-tree.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n\n.. image:: https://img.shields.io/github/license/jirikuncar/git-json-tree.svg\n   :target: https://github.com/jirikuncar/git-json-tree/blob/master/LICENSE\n\nEncode and decode JSON files as Git tree objects.\n\n**This is an experimental developer preview release.**\n\nInstallation\n------------\n\nThe latest release is available on PyPI and can be installed using\n``pip``:\n\n::\n\n    $ pip install git-json-tree\n\nThe development version can be installed directly from the Git repository:\n\n::\n\n    $ pip install -e git+https://github.com/jirikuncar/git-json-tree.git#egg=git-json-tree\n\n\nIntegration with Git\n--------------------\n\nMove to a repository where you would like to store JSON files and\nadd following lines to files:\n\n``.git/config``\n\n.. code-block:: ini\n\n   [filter \"git-json-tree\"]\n       smudge = \"git-json-tree smudge\"\n       clean = \"git-json-tree clean\"\n       required  # optional\n\n``.gitattributes``\n\n.. code-block:: text\n\n   *.json  filter=git-json-tree\n\n\nPointer file format\n~~~~~~~~~~~~~~~~~~~\n\nGit Git-JSON-Tree's pointer file looks like this:\n\n.. code-block:: text\n\n   version https://github.com/jirikuncar/git-json-tree/tree/v1\n   oid sha1:2f769492d6b634b86b82e916630da8a693e9c20e\n   size 12345\n\nIt tracks the version of Git-JSON-Tree you're using, followed by a unique\nidentifier for the JSON file (oid). It also stores the size of the target JSON\nfile.\n\n**NOTE**:\n   ``size`` is calculated from the encoded JSON string and it might differ\n   depending on the version of serializer.\n\n\nUse the command line\n--------------------\n\nInteraction with the storage can also take place via the command-line\ninterface (CLI).\n\nFirst, you need to make sure that you are in a Git repository or you\nknow its location. The example shows a case when you are in the directory\nwith a Git repository.\n\n.. code-block:: console\n\n   $ echo '{\"hello\": \"world\", \"version\": 1}' | git-json-tree encode\n   7123db01ad8c75a8df3508305bd891317ea36feb\n\nFollowing the above example you can create a first commit of your JSON object.\n\n.. code-block:: console\n\n   $ export FIRST=$(git commit-tree 7123db01 -m First)\n\nIt is quite impractical to remember tree or commit sha1, hence we can give it\na reference name. The next steps uses the name ``master``, but you can decide\nto use your own naming convention for tracking versions of your objects. Each\nfile can have its own branch or just a single tag.\n\n.. code-block:: console\n\n   $ git update-ref refs/heads/master $FIRST  # for new object\n\nStoring a new version is very simple too.\n\n.. code-block:: console\n\n   $ export PARENT=$(git show-ref --hash refs/heads/master)\n   $ echo '{\"hello\": \"world\", \"version\": 2}' | git-json-tree encode\n   6f36c4272e88b14ab5e25a5419599534504c70fc\n   $ export SECOND=$(git commit-tree 6f36c4272e -m Second -p $PARENT)\n   $ git update-ref refs/heads/master $SECOND\n\nFinally, you can retrive and decode a tree or commit.\n\n.. code-block:: console\n\n   $ git-json-tree decode  # HEAD\n   $ git-json-tree decode $FIRST  # commit\n   $ git-json-tree decode 7123db01  # tree id\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjirikuncar%2Fgit-json-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjirikuncar%2Fgit-json-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjirikuncar%2Fgit-json-tree/lists"}