Skip to main content

Convenience library for working with Git on Linux.

Project description

Simple Python GIT Library for Linux

pipeline Documentation Status

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

https://atudomain-git.readthedocs.io/en/latest/

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

atudomain-git-3.0.1.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

atudomain_git-3.0.1-py3-none-any.whl (10.7 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