Skip to main content

Simple Git Infos

Project description

Git infos

Lightful Git infos library without pretention

It uses shell commands to get git infos.

Installation

pip install simple-git-infos

Usage

Import gitinfos module

Current functions are simple and easy to understand

  • get_current_git_branch()
  • get_full_commit()
  • get_short_commit_id()
  • get_tag()

Sample

from simple_git_infos import gitinfos

print(f"BRANCH: {gitinfos.get_current_git_branch()}")
print(f"COMMIT: {gitinfos.get_full_commit()}")
print(f"ID: {gitinfos.get_short_commit_id()}")
print(f"TAG: {gitinfos.get_tag()}")

will output

BRANCH: main
COMMIT: commit b78468a45489eec3ea6b816f5b28f7093d9bac4b
Author: marc dexet <marc.dexet@ias.u-psud.fr>
Date:   Fri Feb 3 08:41:52 2023 +0000

    Initial commit
ID: b78468a
TAG: 0.0.1

All functions could be pointed to any location

full_commit= gitinfos.get_full_commit(cwd='/home/user/somewhere/')

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

simple-git-infos-0.0.2.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_git_infos-0.0.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file simple-git-infos-0.0.2.tar.gz.

File metadata

  • Download URL: simple-git-infos-0.0.2.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for simple-git-infos-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f90a7aa6633be7e91fa84c63e945c0ce88ecff3185ca994d0305f2d2d59900c4
MD5 384ec3b36e5207221ac146454e5e7bd8
BLAKE2b-256 48b83ed9fdf9c498652143fafe8961e204de324c82e31f5d4c3dbfb681186cc3

See more details on using hashes here.

File details

Details for the file simple_git_infos-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_git_infos-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e9e647c12fbeef7dcfc2408810a231dd0a8bfeaf80d3dadf19af645f0f6d72f
MD5 6f1e16ea0fcdef28457aba3f46dc7483
BLAKE2b-256 542abcf889cbdbc17379929532d3508d9b54cba3ae378556659b5b035dc572c1

See more details on using hashes here.

Supported by

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