Convenience library for working with Git on Linux.
Project description
Simple Python wrapper for Git
Provides access to Commit objects and easy branch listing.
- License: 3-Clause BSD
- Python: Python 3.6+
Table of Contents
Installation
Install using pip:
python3 -m pip install atudomain-git --user
Alternatively, you can just append downloaded repository path to PYTHONPATH.
Quickstart
Import Git class:
from atudomain.git import Git
Create Git object:
git = Git('/home/user/example-repo')
Getting branches
Get list of remote origin branches:
branches = git.get_branches(include='^remotes/origin')
Get list of local branches:
branches = git.get_branches(exclude='^remotes/')
Getting Commits
Get list of Commits for the current branch:
commits = git.get_commits()
Get list with last Commit for the current branch:
commits = git.get_commits('HEAD^..HEAD')
Getting Commit details
Get committer date from Commit:
committer_date = commits[0].committer_date
Get commit id from Commit:
commit_id = commits[0].commit_id
Check if Commit is a merge:
is_merge = commits[0].is_merge
API Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
atudomain-git-4.0.0.tar.gz
(11.7 kB
view details)
Built Distribution
File details
Details for the file atudomain-git-4.0.0.tar.gz
.
File metadata
- Download URL: atudomain-git-4.0.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 291f643d69862980088742cb23a8bc4289b555e24462034fce5fe9075839a09d |
|
MD5 | da3da585beea30e0e6c04d6136ea1744 |
|
BLAKE2b-256 | eb26c464b3946f982834bf3973c6f53e6359640534d8146f88aa09d38930d181 |
File details
Details for the file atudomain_git-4.0.0-py3-none-any.whl
.
File metadata
- Download URL: atudomain_git-4.0.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4bf090a0ff28d7df0ef4af7e42d6a0d27862be82141ab0dd44bc543a29ad78e |
|
MD5 | 60075d37a2a9c7a16094dec453389da8 |
|
BLAKE2b-256 | 9822ec910db9899a39d87d2030bf916658787dd45303234a41f685bf376f6b51 |