gitspy
======
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: License
.. image:: https://img.shields.io/pypi/v/gitspy
:target: https://pypi.org/project/gitspy/
:alt: PyPI
.. image:: https://github.com/jshwi/gitspy/actions/workflows/ci.yml/badge.svg
:target: https://github.com/jshwi/gitspy/actions/workflows/ci.yml
:alt: CI
.. image:: https://results.pre-commit.ci/badge/github/jshwi/gitspy/master.svg
:target: https://results.pre-commit.ci/latest/github/jshwi/gitspy/master
:alt: pre-commit.ci status
.. image:: https://github.com/jshwi/gitspy/actions/workflows/codeql-analysis.yml/badge.svg
:target: https://github.com/jshwi/gitspy/actions/workflows/codeql-analysis.yml
:alt: CodeQL
.. image:: https://codecov.io/gh/jshwi/gitspy/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jshwi/gitspy
:alt: codecov.io
.. image:: https://readthedocs.org/projects/gitspy/badge/?version=latest
:target: https://gitspy.readthedocs.io/en/latest/?badge=latest
:alt: readthedocs.org
.. image:: https://img.shields.io/badge/python-3.8-blue.svg
:target: https://www.python.org/downloads/release/python-380
:alt: python3.8
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Black
.. image:: https://img.shields.io/badge/linting-pylint-yellowgreen
:target: https://github.com/PyCQA/pylint
:alt: pylint
Intuitive Git for Python
------------------------
Install
-------
Dependencies: git ^2.0.0 (tested)
``pip install gitspy``
Development
``poetry install``
Example Usage
-------------
Get branch
**********
Capture will store stdout, which can then be consumed by calling `git.stdout()`
Default is to return returncode and print stdout and stderr to console
.. code-block:: python
>>> import gitspy
>>> git = gitspy.Git()
>>> git.init(capture=True) # ['...']
0
Consume stdout (a list containing a str)
.. code-block:: python
>>> len(git.stdout()) # []
1
No commands have been called yet since last call to `stdout` so stdout is empty
.. code-block:: python
>>> len(git.stdout()) # []
0
Stdout can be accrued
.. code-block:: python
>>> git.init(capture=True) # ['...']
0
>>> git.init(capture=True) # ['...', '...']
0
>>> len(git.stdout()) # []
2
Stdout is consumed
.. code-block:: python
>>> len(git.stdout()) # []
0
Get commit hash
***************
.. code-block:: python
>>> git.rev_parse("HEAD", capture=True) # ['...']
0
>>> len(git.stdout()[0]) # []
40
Raw data
{
"_id": null,
"home_page": "https://pypi.org/project/gitspy/",
"name": "gitspy",
"maintainer": "jshwi",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "stephen@jshwisolutions.com",
"keywords": "commandline,git,script,tree,wrapper",
"author": "jshwi",
"author_email": "stephen@jshwisolutions.com",
"download_url": "https://files.pythonhosted.org/packages/91/01/45bd2bee216bdc7bd78c986a34e974b738f27933fa825b0de3feb38ded0b/gitspy-0.3.0.tar.gz",
"platform": null,
"description": "gitspy\n======\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg\n :target: https://opensource.org/licenses/MIT\n :alt: License\n.. image:: https://img.shields.io/pypi/v/gitspy\n :target: https://pypi.org/project/gitspy/\n :alt: PyPI\n.. image:: https://github.com/jshwi/gitspy/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/jshwi/gitspy/actions/workflows/ci.yml\n :alt: CI\n.. image:: https://results.pre-commit.ci/badge/github/jshwi/gitspy/master.svg\n :target: https://results.pre-commit.ci/latest/github/jshwi/gitspy/master\n :alt: pre-commit.ci status\n.. image:: https://github.com/jshwi/gitspy/actions/workflows/codeql-analysis.yml/badge.svg\n :target: https://github.com/jshwi/gitspy/actions/workflows/codeql-analysis.yml\n :alt: CodeQL\n.. image:: https://codecov.io/gh/jshwi/gitspy/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/jshwi/gitspy\n :alt: codecov.io\n.. image:: https://readthedocs.org/projects/gitspy/badge/?version=latest\n :target: https://gitspy.readthedocs.io/en/latest/?badge=latest\n :alt: readthedocs.org\n.. image:: https://img.shields.io/badge/python-3.8-blue.svg\n :target: https://www.python.org/downloads/release/python-380\n :alt: python3.8\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Black\n.. image:: https://img.shields.io/badge/linting-pylint-yellowgreen\n :target: https://github.com/PyCQA/pylint\n :alt: pylint\n\nIntuitive Git for Python\n------------------------\n\n\nInstall\n-------\nDependencies: git ^2.0.0 (tested)\n\n``pip install gitspy``\n\nDevelopment\n\n``poetry install``\n\nExample Usage\n-------------\n\nGet branch\n**********\n\nCapture will store stdout, which can then be consumed by calling `git.stdout()`\n\nDefault is to return returncode and print stdout and stderr to console\n\n.. code-block:: python\n\n >>> import gitspy\n >>> git = gitspy.Git()\n >>> git.init(capture=True) # ['...']\n 0\n\nConsume stdout (a list containing a str)\n\n.. code-block:: python\n\n >>> len(git.stdout()) # []\n 1\n\nNo commands have been called yet since last call to `stdout` so stdout is empty\n\n.. code-block:: python\n\n >>> len(git.stdout()) # []\n 0\n\nStdout can be accrued\n\n.. code-block:: python\n\n >>> git.init(capture=True) # ['...']\n 0\n >>> git.init(capture=True) # ['...', '...']\n 0\n >>> len(git.stdout()) # []\n 2\n\nStdout is consumed\n\n.. code-block:: python\n\n >>> len(git.stdout()) # []\n 0\n\nGet commit hash\n***************\n\n.. code-block:: python\n\n >>> git.rev_parse(\"HEAD\", capture=True) # ['...']\n 0\n >>> len(git.stdout()[0]) # []\n 40\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Intuitive Git for Python",
"version": "0.3.0",
"split_keywords": [
"commandline",
"git",
"script",
"tree",
"wrapper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "81ff7dea711a903e27e2b99f3d1e0dcb1f41604b275167e781ac15854381642c",
"md5": "663ad122e43291b1d7b8d69550dedbe6",
"sha256": "8ca2e79c39d95d1a374d35bd3f31741fec168884fb58243adda65ea4bdfbe13d"
},
"downloads": -1,
"filename": "gitspy-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "663ad122e43291b1d7b8d69550dedbe6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 4465,
"upload_time": "2023-01-04T00:03:15",
"upload_time_iso_8601": "2023-01-04T00:03:15.058904Z",
"url": "https://files.pythonhosted.org/packages/81/ff/7dea711a903e27e2b99f3d1e0dcb1f41604b275167e781ac15854381642c/gitspy-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "910145bd2bee216bdc7bd78c986a34e974b738f27933fa825b0de3feb38ded0b",
"md5": "cd53689e6855d8f0b008a345fcfd7810",
"sha256": "74e582d2f13001f61133e02c5ceb252a1511d3859cfdff16637e50ba0f3091bd"
},
"downloads": -1,
"filename": "gitspy-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "cd53689e6855d8f0b008a345fcfd7810",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 4928,
"upload_time": "2023-01-04T00:03:16",
"upload_time_iso_8601": "2023-01-04T00:03:16.506433Z",
"url": "https://files.pythonhosted.org/packages/91/01/45bd2bee216bdc7bd78c986a34e974b738f27933fa825b0de3feb38ded0b/gitspy-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-04 00:03:16",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "gitspy"
}