{ "info": { "author": "Valentin Lab", "author_email": "valentin.lab@kalysto.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Version Control" ], "description": "=========================\nkids.vcs\n=========================\n\n.. image:: http://img.shields.io/pypi/v/kids.vcs.svg?style=flat\n :target: https://pypi.python.org/pypi/kids.vcs/\n :alt: Latest PyPI version\n\n.. image:: http://img.shields.io/travis/0k/kids.vcs/master.svg?style=flat\n :target: https://travis-ci.org/0k/kids.vcs/\n :alt: Travis CI build status\n\n.. image:: http://img.shields.io/coveralls/0k/kids.vcs/master.svg?style=flat\n :target: https://coveralls.io/r/0k/kids.vcs\n :alt: Test coverage\n\n\n\n``kids.vcs`` is a Python library providing GIT helpers. Would have\nnamed it ``kids.git`` if it didn't messed everything with github.\n\nIt's part of 'Kids' (for Keep It Dead Simple) library.\n\n\nFeatures\n========\n\nusing ``kids.vcs``:\n\n- You can manage and access your git repository, commits, logs, or git\n config.\n\nCompatibility\n=============\n\nThis code is python2 and python3 ready. It wasn't tested on windows.\n\n\nInstallation\n============\n\nYou don't need to download the GIT version of the code as ``kids.vcs`` is\navailable on the PyPI. So you should be able to run::\n\n pip install kids.vcs\n\nIf you have downloaded the GIT sources, then you could add install\nthe current version via traditional::\n\n python setup.py install\n\nAnd if you don't have the GIT sources but would like to get the latest\nmaster or branch from github, you could also::\n\n pip install git+https://github.com/0k/kids.vcs\n\nOr even select a specific revision (branch/tag/commit)::\n\n pip install git+https://github.com/0k/kids.vcs@master\n\n\nUsage\n=====\n\nLet's play with a new git repository, let's first create temporary\ndirectory::\n\n >>> from __future__ import print_function\n\n >>> import tempfile, os\n >>> old_cwd = os.getcwd()\n >>> tmpdir = tempfile.mkdtemp()\n >>> os.chdir(tmpdir)\n\nLet's now create a real git repository::\n\n >>> from kids.vcs import git\n\nThis first command will create a new directory and launch ``git init`` and\nand will return the new ``GitRepos`` object::\n\n >>> r = git.GitRepos.create(\"repos\",\n ... email=\"committer@example.com\",\n ... name=\"The Committer\")\n\nYou might also want to only use an existing directory and launch ``git init`` then\nuse::\n\n >>> r = git.GitRepos.init(\"repos\")\n\nOr, if wanting to use an already existing folder already initialised::\n\n >>> r = git.GitRepos(\"repos\")\n\nBy default, the current directory is used and the top-most git repository\nthat contains the current directory will be used as the master git repository.\n\nAvoid instantiating a non-existent git repository::\n\n >>> git.GitRepos(\"/\")\n Traceback (most recent call last):\n ...\n OSError: Not a git repository ('/' or any of the parent directories).\n\n\n\nGit commands shortcut\n---------------------\n\nAside from all the helpers that will be exposed in the following section, a\n``GitRepos`` object provides a handy ``.git`` attribute to directly tap on\nthe git command line::\n\n >>> print(r.git.rev_parse(is_bare_repository=True))\n false\n\nA few things to note:\n\n- the method name is the git command you want to launch\n- ``_`` (underscores) are swapped for ``-``.\n- there are 2 different way to use the methods:\n\n - provide one unique array of strings that will simply appended\n on the command line.\n\n - provide string positional arguments and keyword arguments:\n\n - keyword arguments are options... :\n\n - a double-dash will be added before the keyword if it is\n composed of more than one char\n - a single dash will be added before the keyword in cas it\n a single character keyword.\n - ``_`` (underscores) are swapped for ``-`` in keyword name\n - and value is appended just after on the command line.\n\n - positional arguments are appended AFTER all the options...\n\n- the method return value is the space-stripped standard output of the\n command sent.\n\nTo illustrate this and the following points::\n\n >>> print(r.git.commit(\n ... message='new: first commit',\n ... author='Bob ',\n ... date='2000-01-01 10:00:00',\n ... allow_empty=True))\n [master (root-commit) ...] new: first commit\n Author: Bob \n Date: Sat Jan 1 10:00:00 2000 ...\n\n >>> print(r.git.tag(\"0.0.1\"))\n >>> print(r.git.commit(\n ... message='new: second commit',\n ... author='Alice ',\n ... date='2000-01-02 11:00:00',\n ... allow_empty=True))\n [master ...] new: second commit\n Author: Alice \n Date: Sun Jan 2 11:00:00 2000 ...\n >>> print(r.git.tag(\"0.0.2\"))\n\n\nAccess core informations\n------------------------\n\nYou can get interesting information fron the git repository itself::\n\n >>> print(r.toplevel)\n /.../repos\n\n >>> r.bare\n False\n\n >>> print(r.gitdir)\n /.../repos/.git\n\n\nRead git config\n---------------\n\nWe can access the config thanks to::\n\n >>> r.config\n <...GitConfig...>\n\n >>> print(r.config[\"core.filemode\"])\n true\n\nYou can also instanciate directly the ``GitConfig`` class::\n\n >>> from kids.vcs import git\n\n >>> print(git.GitConfig(\"repos\")[\"core.filemode\"])\n true\n\nWithout any repository, it's the current repository that should be\nused, and if none, well it should answer as much as a normal ``git\nconfig`` would::\n\n >>> git.GitConfig()[\"core.filemode\"]\n Traceback (most recent call last):\n ...\n KeyError: 'core.filemode'\n >>> os.chdir(\"repos\")\n >>> print(git.GitConfig()[\"core.filemode\"])\n true\n\n\nGit commit access\n-----------------\n\nWe can access interesting information per commit::\n\n >>> r.commit(\"HEAD\")\n \n\nAnd several information are available::\n\n >>> print(r.commit(\"HEAD\").author_name)\n Alice\n >>> print(r.commit(\"master\").subject)\n new: second commit\n\nYou can access to all of these::\n\n >>> print(\", \".join(sorted(git.GIT_FORMAT_KEYS)))\n author_date, author_date_timestamp, author_email, author_name, body,\n committer_date_timestamp, committer_name, decorate_string,\n parent_list_string, raw_body, sha1, sha1_short, subject\n\n\nThere's a convienience attribute ``date`` also::\n\n >>> print(r.commit(\"0.0.2\").date)\n 2000-01-02\n\n\nTags\n----\n\nYou can get the list of tags::\n\n >>> r.tags\n [, ]\n\n\nLogs\n----\n\nYou can access all commits via::\n\n >>> list(r.log())\n [, ]\n\nand provide wich commit ancestry to include or to exclude (see ``git\nlog``)::\n\n >>> list(r.log([\"HEAD\", \"^0.0.1\", ]))\n []\n\n\nContributing\n============\n\nAny suggestion or issue is welcome. Push request are very welcome,\nplease check out the guidelines.\n\n\nPush Request Guidelines\n-----------------------\n\nYou can send any code. I'll look at it and will integrate it myself in\nthe code base and leave you as the author. This process can take time and\nit'll take less time if you follow the following guidelines:\n\n- check your code with PEP8 or pylint. Try to stick to 80 columns wide.\n- separate your commits per smallest concern.\n- each commit should pass the tests (to allow easy bisect)\n- each functionality/bugfix commit should contain the code, tests,\n and doc.\n- prior minor commit with typographic or code cosmetic changes are\n very welcome. These should be tagged in their commit summary with\n ``!minor``.\n- the commit message should follow gitchangelog rules (check the git\n log to get examples)\n- if the commit fixes an issue or finished the implementation of a\n feature, please mention it in the summary.\n\nIf you have some questions about guidelines which is not answered here,\nplease check the current ``git log``, you might find previous commit that\nwould show you how to deal with your issue.\n\n\nLicense\n=======\n\nCopyright (c) 2019 Valentin Lab.\n\nLicensed under the `BSD License`_.\n\n.. _BSD License: http://raw.github.com/0k/kids.vcs/master/LICENSE\n\nChangelog\n=========\n\n\n0.0.3 (2019-04-02)\n------------------\n\nNew\n~~~\n- Add ``GitUrl`` as a conveniency to access parts of a remote git\n repository url. [Valentin Lab]\n- Added ``ls_remote(url)``, ``remote_url_reachable(url)``,\n ``query_remote_for_ref(url, ref)`` to work with remote repository.\n [Valentin Lab]\n- Provide a shortcut to ``git`` command line directly in module.\n [Valentin Lab]\n\nFix\n~~~\n- Python ``3.7`` compatibility fix. [Valentin Lab]\n\n\n0.0.2 (2018-04-09)\n------------------\n\nNew\n~~~\n- Major update. [Valentin Lab]\n\n - GitCommit: does not recognize magic identifier ``LAST`` anymore.\n - GitCommit: added new attributes to access direct info of commit\n ``sha1_short``, ``author_email``, ``parent_list_string``, ``decorate_string``\n - GitCommit: added pythonic access to generic trailer values using\n ``trailer_LABEL`` attributes. Supports multi-valued trailer values.\n - GitCommit: specific ``authors``, ``author_names`` special attributes\n that leverage ``Co-Authored-By`` trailer value and commit author to\n provide a full list of authors.\n - GitCommit: new ``parents`` attribute to get the GitCommit parent list.\n - GitCommit: new ``tags_name`` attribute to get the list of tags attributed\n to current commit, along with ``tags`` that iterates through new ``GitTag``\n objects of the current commit, and ``.tag(label)`` method to instantiate\n a ``GitTag`` of current commit thanks to its label.\n - GitCommit: support of ``<`` (less-than) operator to map as close as possible\n with order relation of commits given by command git log.\n - GitCommit: support of ``in`` (``.__contains__(..)``) operator to map with\n ancestor relationship.\n - new ``GitTag``object that represent annotated tags and non-annotated tags,\n check ``README.rst`` for usage.\n - GitRepos: new ``.create(..)`` classmethod to create a new git repository.\n - GitRepos: new ``.init(..)`` classmethod to create a new git repository from\n an existing repository.\n - GitRepos: new ``.Tag(label)`` method to get a GitTag object from a given label.\n - GitRepos: renamed ``.commit(..)`` method to ``.Commit(..)``. Old method still\n kept for compatibility reason.\n - GitRepos: renamed ``.config(..)`` method to ``.Config(..)``. Old method still\n kept for compatibility reason.\n - GitRepos: API CHANGE: ``.log(..)`` method is now closer to ``git log`` command\n line usage, and ``includes``, ``excludes``, ``include_merge`` arguments have\n been removed. Please refer to documentation for more information.\n\nFix\n~~~\n- Catches bad repository when using ``GitRepos.log()``. [Valentin Lab]\n- ``GitConfig()`` would fail if no arg. [Valentin Lab]\n\n\n0.0.1 (2015-02-05)\n------------------\n- First import. [Valentin Lab]\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/0k/kids.vcs", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "kids.vcs", "package_url": "https://pypi.org/project/kids.vcs/", "platform": "", "project_url": "https://pypi.org/project/kids.vcs/", "project_urls": { "Homepage": "http://github.com/0k/kids.vcs" }, "release_url": "https://pypi.org/project/kids.vcs/0.0.3/", "requires_dist": [ "kids.sh", "kids.cache", "kids.file" ], "requires_python": "", "summary": "Kids VCS management library.", "version": "0.0.3" }, "last_serial": 5049892, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "6983c64e4aff73869ae37cb4a7664672", "sha256": "4a9eeef66fc14e787d1a35637dfb9943b185c79c29ba28549b520e7755424a4d" }, "downloads": -1, "filename": "kids.vcs-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6983c64e4aff73869ae37cb4a7664672", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8531, "upload_time": "2015-02-06T08:07:20", "url": "https://files.pythonhosted.org/packages/29/15/9ca943478a8d4a0b7a2b3d56ffd10a0a73a0588e713bff19453c16d10e43/kids.vcs-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "21530c5a43d0ccc5889be848710d4eef", "sha256": "e6a9909c04623b63a39825d39b664fca44c85553c589fedee17902a7584f2049" }, "downloads": -1, "filename": "kids.vcs-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "21530c5a43d0ccc5889be848710d4eef", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17138, "upload_time": "2018-04-10T09:55:16", "url": "https://files.pythonhosted.org/packages/ed/52/8c01f380e017be28c774b56cd37616e99fb0549606342e2fc6d53e0717a9/kids.vcs-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "214c49007a6878a78c023e3cdba6ffd4", "sha256": "116e130c919c7a45df11db841bcf1d62bdd4589eeb0f14959071afaf35b87a82" }, "downloads": -1, "filename": "kids.vcs-0.0.2.tar.gz", "has_sig": false, "md5_digest": "214c49007a6878a78c023e3cdba6ffd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17030, "upload_time": "2018-04-10T09:55:17", "url": "https://files.pythonhosted.org/packages/d6/33/ca0d275d2f6d12d995a0d7b7cb8f5f362a7df6ae894c67089a8076d5a3e7/kids.vcs-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a867874d9cf93f26bfc94dcdb70737e9", "sha256": "b06a46997018f188c6883ff678173d5a36dd514d9103b42fd0db78bc5772cbcc" }, "downloads": -1, "filename": "kids.vcs-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a867874d9cf93f26bfc94dcdb70737e9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18298, "upload_time": "2019-04-02T14:05:12", "url": "https://files.pythonhosted.org/packages/fd/72/0e8a99d40288778b50e1d11e4ecbb7028429c5aeca106fa5effe934b7c36/kids.vcs-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87a3363733d6e68d025a8eca9fb90a18", "sha256": "1b34ae2a07fab5b5777970d460c2f20066bfdbbc543ce2336438cb45ac7a4fab" }, "downloads": -1, "filename": "kids.vcs-0.0.3.tar.gz", "has_sig": false, "md5_digest": "87a3363733d6e68d025a8eca9fb90a18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18298, "upload_time": "2019-04-02T14:05:14", "url": "https://files.pythonhosted.org/packages/83/16/616b04b4fbe51087a35ae7e26e4d06e90660efb182feb59e9e693d0db647/kids.vcs-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a867874d9cf93f26bfc94dcdb70737e9", "sha256": "b06a46997018f188c6883ff678173d5a36dd514d9103b42fd0db78bc5772cbcc" }, "downloads": -1, "filename": "kids.vcs-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a867874d9cf93f26bfc94dcdb70737e9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18298, "upload_time": "2019-04-02T14:05:12", "url": "https://files.pythonhosted.org/packages/fd/72/0e8a99d40288778b50e1d11e4ecbb7028429c5aeca106fa5effe934b7c36/kids.vcs-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87a3363733d6e68d025a8eca9fb90a18", "sha256": "1b34ae2a07fab5b5777970d460c2f20066bfdbbc543ce2336438cb45ac7a4fab" }, "downloads": -1, "filename": "kids.vcs-0.0.3.tar.gz", "has_sig": false, "md5_digest": "87a3363733d6e68d025a8eca9fb90a18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18298, "upload_time": "2019-04-02T14:05:14", "url": "https://files.pythonhosted.org/packages/83/16/616b04b4fbe51087a35ae7e26e4d06e90660efb182feb59e9e693d0db647/kids.vcs-0.0.3.tar.gz" } ] }