Utilities to normalize working with different Version Control Systems
Project description
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)
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
vcsinfo-2.2.116.tar.gz
(10.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
vcsinfo-2.2.116-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file vcsinfo-2.2.116.tar.gz.
File metadata
- Download URL: vcsinfo-2.2.116.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d107be12103fd954e0f31ef6587abeb33d6288a060bd0cc983b90331df98883f
|
|
| MD5 |
bf4b28dc41fb6050d23adb19cbfef93a
|
|
| BLAKE2b-256 |
e80895bac9ff758c238966480d5719396ece71e8312af39c44103f93f6bf29de
|
File details
Details for the file vcsinfo-2.2.116-py3-none-any.whl.
File metadata
- Download URL: vcsinfo-2.2.116-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19909aa53200f52ef7403e6fd3ae3a2810c56542ac4e55c453dc8989b8a119db
|
|
| MD5 |
09c004ed4d168cf826905fb3289791d9
|
|
| BLAKE2b-256 |
32e46e3a9709245522d9cf0595fb95833a34063d49114551443842e98c682ff8
|