{ "info": { "author": "Holger Frey", "author_email": "mail@holgerfrey.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Version Control" ], "description": "gitdict \u2013 Dict Like Access to a Git Repository\n==============================================\n\nThe great `pygit2 `__ package enables working with\n`python `__ on a `git `__\nrepository on a fast but low level basis.\n\nThe `gitdict `__ package builds on\n`pygit2 `__ and offers a simple interface to the\ngit repository, but is currently limited to reading from a repository.\n\nOne of the main goals - beside providing a nice git access - is to use\nthis in a `pyramid `__ web application\nwith a\n`traversal `__\nstyle routing. There is a small \n`example pyramid project `__ to \ndemonstrate this. Of cause, the package can also be used otherwise ;-)\n\nThe documentation consists mainly of examples.\n\nIntroduction by Example\n-----------------------\n\n.. code:: python\n\n # open a Repository\n import gitdict\n repo = Repository('/path/to/gitdict.git')\n\n # read a folder and a file from the repository\n folder = repo['docs']\n file = folder['index.md']\n\n # access to file data\n file.data == b'gitdict - Dict Like Access [\u2026]'\n file.text == 'gitdict - Dict Like Access [\u2026]'\n # iterate over lines in a file, just like with standard python open()\n for line in file:\n do_something(line)\n\n # data about the last change to the file\n last_change = file.last_commit\n last_change.message == 'latest commit message'\n last_change.author == pygit2.Signature('Holger Frey', 'spam@holgerfrey.de')\n\n # all changes done to a file\n file.history == [commit_3, commit_2, commit_1]\n # difference between current and a previous version\n patch = file.diff(commit_1)\n\nOverview\n--------\n\nThere are three main classes in the gitdict package:\n\n- `Repository `__: used to open a git repository,\n acts also as the 'root folder'\n- `Folder `__: like a folder in the file system,\n located inside a repository\n- `File `__: like a file in the file system, stores data\n and is located inside a folder\n\nA ``Folder`` or a ``File`` object should not be created directly but\nretrieved either from a ``Repository`` or another ``Folder``.\n\nSome methods just act as a proxy to the underlying pygit2 object, others\ndo some extra work. In some cases pygit2 object are directly exposed to\nthe user. But this only happens where simplification is not needed,\nIMHO.\n\nShared Api\n----------\n\nThis is common in ``Repository``, ``Folder`` and ``File``\n\n- ``git_path``: path of the object in the git repository\n- ``last_commit``: last commit that introduced a change\n- ``history``: list of commits, that introduced changes, newest first\n- ``diff(commit, reference=None)``: difference between the current object\n and a previous version, if reference is None, the current commit is used\n to calculate the commit\n\nThe ``Repository``, ``Folder`` have a dict-like read-only access to\ncontained objects in common:\n\n- ``name in repo_or_folder``: check if a file or folder exists\n- ``repo_or_folder[name]``: retrieve a file or folder, might raise\n KeyError\n- ``repo_or_folder.get(name, default=None)``: retrieve a file or\n folder, or default value\n- ``len(repo_or_folder)``: number of contained files and folders\n- ``repo_or_folder.keys()``: iterator with the name of all contained\n files and folders\n- ``repo_or_folder.values()``: iterator with all contained files and\n folders\n- ``repo_or_folder.items()``: iterator with tuples of (name,\n file\\_or\\_folder)\n- ``for name in repo_or_folder``: iterator interface\n- ``repo_or_folder.walk()``: similar to os.walk()\n\nNote of Warning\n---------------\n\nThis package was developed on Mac OS X and `Python\n3.5 `__. There is currently no such thing as\ntesting on other platforms or Python versions.\n\nIf the installation with ``python3 setup.py`` doesn't work, try to\ninstall pygit2 manually first - this is the tricky part. E.g. on my setup \nthe cffi-package was missing.\n\nIn other words: Works for me ;-)\n\nLicense?\n~~~~~~~~\n\nWell, I decided to go with the `Simplified BSD\nLicense `__.\n\nContinue reading\n~~~~~~~~~~~~~~~~\n\n- `Repository `__\n- `Folder `__\n- `File `__", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/holgi/gitdict", "keywords": "git pygit2", "license": "Simplified BSD License", "maintainer": "", "maintainer_email": "", "name": "gitdict", "package_url": "https://pypi.org/project/gitdict/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gitdict/", "project_urls": { "Homepage": "https://github.com/holgi/gitdict" }, "release_url": "https://pypi.org/project/gitdict/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Access a git repository like a python dict", "version": "0.1.2" }, "last_serial": 1918439, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f1d4884d33f812c01a9cfc70efa455a3", "sha256": "5e91766d2fa812da2fe12e3d56d5b69bcf19a1ec1f72e05406a664914f6c2684" }, "downloads": -1, "filename": "gitdict-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f1d4884d33f812c01a9cfc70efa455a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8889, "upload_time": "2016-01-08T10:40:15", "url": "https://files.pythonhosted.org/packages/7d/33/412dee6bf519a2c4b4608b2b6a9711ff6f39326ce3949ee26e08cbc9dd41/gitdict-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "eb763245e39106459c330e3eda09feb0", "sha256": "40ffd9c7e988aa1932553b1baf56d67d18974099f2449e1139a2fe498ec5c265" }, "downloads": -1, "filename": "gitdict-0.1.1.tar.gz", "has_sig": false, "md5_digest": "eb763245e39106459c330e3eda09feb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9212, "upload_time": "2016-01-22T11:18:10", "url": "https://files.pythonhosted.org/packages/a0/98/be1b746efa80f9346a476abd6fa3573a379ca8537ab4bb3182ca225d45aa/gitdict-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "dc24c4aafaea119b8b3051f400671bca", "sha256": "b1508dcfa2028da2432e9adeb77306788288ff9ec31bbb41caddf6117b6cc069" }, "downloads": -1, "filename": "gitdict-0.1.2.tar.gz", "has_sig": false, "md5_digest": "dc24c4aafaea119b8b3051f400671bca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9254, "upload_time": "2016-01-23T02:09:06", "url": "https://files.pythonhosted.org/packages/87/7b/412f970acc4564951d6c72a8d5ed588ce3df2ab9b7214a103b0efa223264/gitdict-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dc24c4aafaea119b8b3051f400671bca", "sha256": "b1508dcfa2028da2432e9adeb77306788288ff9ec31bbb41caddf6117b6cc069" }, "downloads": -1, "filename": "gitdict-0.1.2.tar.gz", "has_sig": false, "md5_digest": "dc24c4aafaea119b8b3051f400671bca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9254, "upload_time": "2016-01-23T02:09:06", "url": "https://files.pythonhosted.org/packages/87/7b/412f970acc4564951d6c72a8d5ed588ce3df2ab9b7214a103b0efa223264/gitdict-0.1.2.tar.gz" } ] }