Skip to main content

Intuitive Git for Python

Project description

License PyPI CI pre-commit.ci status CodeQL codecov.io readthedocs.org python3.8 Black 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

>>> import gitspy
>>> git = gitspy.Git()
>>> git.init(capture=True)  # ['...']
0

Consume stdout (a list containing a str)

>>> len(git.stdout())  # []
1

No commands have been called yet since last call to stdout so stdout is empty

>>> len(git.stdout())  # []
0

Stdout can be accrued

>>> git.init(capture=True)  # ['...']
0
>>> git.init(capture=True)  # ['...', '...']
0
>>> len(git.stdout())  # []
2

Stdout is consumed

>>> len(git.stdout())  # []
0

Get commit hash

>>> git.rev_parse("HEAD", capture=True)  # ['...']
0
>>> len(git.stdout()[0])  # []
40

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitspy-0.3.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

gitspy-0.3.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page