2.1. pylibtemplate.generate_local_git_repo_template

generate_local_git_repo_template(lib_name_for_imports='pylibtemplate', abbreviated_lib_name_for_docs='PyLibTemplate', non_abbreviated_lib_name_for_docs='Python Library Template', author='Matthew Fitzpatrick', email='matthew.rc.fitzpatrick@gmail.com', gist_id='7baba2a56d07b59cc49b8323f44416e5', path_to_directory_to_contain_new_repo='')[source]

Generate a local git repository template.

The primary purpose of generating a local git repository template is to modify it subsequently to develop a new Python library.

This Python function will perform several actions: First, it will clone the git commit of the pylibtemplate GitHub repository corresponding to the version of pylibtemplate being used currently, in the directory at the path path_to_directory_to_contain_new_repo, i.e. the git clone command is executed while the working directory is set temporarily to the path path_to_directory_to_contain_new_repo; Next, it will rename the cloned repository to lib_name_for_imports such that the path to the cloned repository becomes path_to_directory_to_contain_new_repo+"/"+lib_name_for_imports; Next, all instances of the string of characters “pylibtemplate” are replaced with lib_name_for_imports, be it in file contents, directory basenames, or file basenames; Next, all instances of the string of characters “PyLibTemplate” are replaced with abbreviated_lib_name_for_docs; Next, all instances of the string of characters “Python Library Template” are replaced with non_abbreviated_lib_name_for_docs; Next, all email address placeholders (i.e. instances of the string of characters “matthew.rc.fitzpatrick@gmail.com”) are replaced with email; Next, all instances of the gist ID of pylibtemplate are replaced with gist_id; Next, all author placeholders (i.e. instances of the string of characters “Matthew Fitzpatrick”) are replaced with author; Next, all copyright statements are updated according to the current year; And lastly, the following file is removed:

* ``<local_repo_root>/docs/how_to_create_a_python_library_using_pylibtemplate.rst``

where <local_repo_root> is the root of the local git repository, as well as the following directory:

* ``<local_repo_root>/.git``

On a unrelated note, for the purposes of demonstrating the citing of literature, we cite Ref. [RefLabel1] and [RefLabel2].

Parameters:
lib_name_for_importsstr, optional

The name of the new Python library, as it would appear in Python import commands. This parameter needs to be a valid Python identifier.

abbreviated_lib_name_for_docsstr, optional

An abbreviated format of the name of the new Python library that appears in documentation pages. This parameter needs to be a valid Python identifier. It can be set to the same value as lib_name_for_imports.

non_abbreviated_lib_name_for_docsstr, optional

A non-abbreviated format of the name of the new Python library that appears in documentation pages.

authorstr, optional

The name of the author of the new Python library.

emailstr, optional

The email address of the author.

gist_idstr, optional

The ID of the GitHub gist to be used to record the code coverage from your unit tests. See the How to create a Python library using pylibtemplate page for instructions on how to create a GitHub gist for your new Python library.

path_to_directory_to_contain_new_repostr, optional

The path to the directory inside which the git commit — of the pylibtemplate GitHub repository corresponding to the version of pylibtemplate being used currently — is to be cloned, i.e. the git clone command is executed while the working directory is set temporarily to path_to_directory_to_contain_new_repo.