Skip to main content

Summary

vcsinfo gathers information about a source tree, supporting Git, Mercurial, and Perforce working directories.

Installation

pip install vcsinfo

Development

For development, use uv to install dependencies:

uv sync

Usage

Example usage using the vcsinfo project itself (git backend):

import vcsinfo

data = vcsinfo.detect_vcs(my_path)
data.name  # project name: 'vcsinfo'
data.branch  # branch name: 'main'
data.id  # native commit identification: '4bb323148e43543247afe066db0dbac0fcf45537'
data.upstream_repo  # upstream repo url: 'git@github.com/adobe/vcsinfo.git'
data.user  # user who performed the commit: 'saville'
data.id_short  # a short representation of the id: '4bb323'
data.number  # same as id if commits have increasing numbers, otherwise simulated an increasing commit number: 77
data.modified  # none if no local modifications, otherwise the epoch seconds of the most recently modified file: 1629746987
data.release  # string representing the current state of the branch: '77.I4bb323.M1629746987'
data.id_string  # string providing a unique id of branch and release: 'main-77.I4bb323.M1629746987'

# Retrieves a tuple of lists of modified changes in the changeset, see code
# for return format
data.status()

# List the files known to the VCS
data.list_files()

# Retrieves VCS information as a dict, optionally including full file information
data.info()
data.info(include_files=True)

Metadata

Release files for vcsinfo 2.2.116

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vcsinfo 2.2.116
File Size Uploaded
vcsinfo-2.2.116.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vcsinfo 2.2.116
File Interpreter ABI Platform
vcsinfo-2.2.116-py3-none-any.whl Python 3 none any Details

Total release size: 25.6 kB

Release files / vcsinfo-2.2.116.tar.gz

Download URL vcsinfo-2.2.116.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d107be12103fd954e0f31ef6587abeb33d6288a060bd0cc983b90331df98883f
BLAKE2b-256 checksum
How to use checksums
e80895bac9ff758c238966480d5719396ece71e8312af39c44103f93f6bf29de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / vcsinfo-2.2.116-py3-none-any.whl

Download URL vcsinfo-2.2.116-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19909aa53200f52ef7403e6fd3ae3a2810c56542ac4e55c453dc8989b8a119db
BLAKE2b-256 checksum
How to use checksums
32e46e3a9709245522d9cf0595fb95833a34063d49114551443842e98c682ff8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

2.2.116 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page