Welcome to ReDATA-commons documentation!¶
Overview¶
This repository contains commonly used codes by ReDATA software
The GitHub repository is available here.
TL;DR: The primary sub-package is
commons
. It includes a number of modules, such as:
git_info
…
Installation¶
From PyPI:
(venv) $ pip install redata
From source:
(venv) $ git clone git@github.com:UAL-ODIS/redata-commons.git
(venv) $ python setup.py install
Execution¶
Using git_info
¶
To use, there are a number of ways to import it the main class,
GitInfo
.
import redata
code_path = "/path/to/repo"
gi = redata.commons.git_info.GitInfo(code_path)
or
from redata.commons.git_info import GitInfo
code_path = "/path/to/repo"
gi = GitInfo(code_path)
Authors¶
Chun Ly, Ph.D. (@astrochun) - University of Arizona Libraries, Office of Digital Innovation and Stewardship
See also the list of contributors who participated in this project.
License¶
This project is licensed under the MIT License - see the LICENSE file for details.
API Documentation¶
Subpackages¶
commons
sub-package¶
Submodules¶
git_info
module¶-
class
redata.commons.git_info.
GitInfo
(input_path)¶ Bases:
object
Provides
git
repo information- Parameters
input_path (
str
) – Full path containing the.git
contents- Variables
input_path – Full path containing the
.git
contentshead_path – Full path of the
.git
HEADbranch – Active branch name
commit – Full hash
short_commit – short hash commit
-
get_active_branch_name
()¶ Retrieve active branch name
- Return type
str
-
get_latest_commit
()¶ Retrieve latest commit hash
- Return type
Tuple
[str
,str
]