Intuitive Git for Python
Project description
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.1.2.tar.gz
(4.8 kB
view hashes)
Built Distribution
gitspy-0.1.2-py3-none-any.whl
(5.0 kB
view hashes)