Welcome to GitVerse’s documentation!

ReleaseNotes

gitverse.releases.generate_snippets() List[str]

Generate snippets based on the releases information.

Returns:

Returns a list of snippets ready to be loaded into a markdown or rst file.

Return type:

List[str]

gitverse.releases.get_api_releases() Generator[Dict[str, List[str]]]

Get release notes via git api.

Yields:

Generator[Dict[str, List[str]]] – Yields release notes in the form of release version and description as key-value pairs gathered via GitHub API.

gitverse.releases.get_releases() Optional[List[Dict[str, Union[str, int, List[str]]]]]

Get releases mapped with the timestamp.

Returns:

Returns all the releases information as list of dictionaries.

Return type:

Union[List[Dict[str, Union[str, List[str], int, str]]], None]

gitverse.releases.get_tags() Generator[Dict[str, Union[str, int, List[str]]]]

Get all tags for repo and create a dictionary by iterating over each tag for it’s subject.

Yields:

Dict[str, int] – Yields the release version, description, timestamp and the date for each tag.

gitverse.releases.run(filename: str, title: str) None

Handler for generator functions that writes the release notes into a file.

Parameters:
  • filename – Name of the file that where the release notes has to be stored.

  • title – Title under which the release notes has to be stored.

gitverse.releases.run_git_cmd(cmd: str) str

Run the git command.

Parameters:

Takes the command as an argument.

Returns:

Returns the output of the git command split by lines.

Return type:

list

CommitHistory

gitverse.commits.generator(versions: List[str], gitlog: List[str]) List[str]

Triggers the conversion process.

Returns:

List of snippets that has to be written to the output file.

Return type:

list

gitverse.commits.get_branches() List[str]

Runs git branch command to get the branches available for the repo.

Returns:

Returns a list of branches available.

Return type:

list

gitverse.commits.get_commits(trunk: str) int

Scans for the number of commits in the trunk branch.

Parameters:

trunk – Branch name.

Returns:

Number of commits.

Return type:

int

gitverse.commits.get_gitlog(branch: str) List[str]

Runs the command git log to get the all commit messages excluding merges and in reverse order.

Parameters:

branch – Branch name.

Returns:

Returns the output of gitlog as a list.

Return type:

list

gitverse.commits.run(branch: str, filename: str, title: str) None

Handler for generator functions that writes the commit history into a file.

Parameters:
  • branch – Name of the branch.

  • filename – Name of the file that where the commit history has to be stored.

  • title – Title under which the commit history has to be stored.

AuthBearer

Module to set up bearer authentication.

>>> AuthBearer
class gitverse.models.auth_bearer.BearerAuth(token: str)

Instantiates BearerAuth object.

>>> BearerAuth

References

New Forms of Authentication

Initializes the class and assign object members.

Parameters:

token – Token for bearer auth.

Debugger

gitverse.models.debugger.debug(msg, override: bool = False)

Print the incoming message in light green.

gitverse.models.debugger.error(msg, override: bool = False)

Print the incoming message in bright red.

gitverse.models.debugger.info(msg, override: bool = False)

Print the incoming message in bright green.

gitverse.models.debugger.warning(msg, override: bool = False)

Print the incoming message in bright yellow.

RST Parser

gitverse.utils.rst.get_release_notes(filename: Union[PathLike, str], version: str = None) Iterable[str]

Get release notes from an RST file. Tested for files generated by this module.

Parameters:
  • filename – Name of the source file.

  • version – Version number to get release notes of a particular version.

Returns:

Returns an iterable string.

Return type:

Iterable

gitverse.utils.rst.rst2dict(filename: Union[PathLike, str], regular_dict: bool = False) Union[OrderedDict, Dict]

Converts RST file to a python dictionary.

Parameters:
  • filename – Source filename or filepath.

  • regular_dict – Boolean flag to return as regular dict. Defaults to OrderedDict

Returns:

Output as regular dict or ordered dict based on arg passed.

Return type:

Union[OrderedDict, Dict]

gitverse.utils.rst.rst2html(src: Union[PathLike, str], dst: Union[PathLike, str]) bool

Converts RST files to HTML.

Parameters:
  • src – Source filename or filepath.

  • dst – Destination filename or filepath.

Returns:

A boolean flag if conversion was successful.

Return type:

bool

Indices and tables