Convenience library for working with Git on Linux.
Project description
Simple Python GIT Library for Linux
Provides access to Commit objects and easy branch listing.
- License: 3-Clause BSD
- Python: Python 3.5+
- Platforms: Linux
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-3.0.1.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for atudomain_git-3.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d3b1d96e20090726be988bd8cf3d59065836022ed37ee4de3bcf82449f52109 |
|
MD5 | 35e21e37edb3f172bd48726d37dafe70 |
|
BLAKE2b-256 | 15db960fff7730efa3342e120bbfe771d8674291e41aaaf6aa3cbdf1bd414cb9 |