TEMPLATE Design built specifically for python Language, with necessary file structure as required. This TEMPLATE DOES NOT COME with a LICENSE File, but you can easily add a required license from GitHub. However, special files like .gitignore .gitattributes are included. The TEMPLATE now includes as LICENSE file, and other files are kept as is.
Follow the steps to create a new license file as below:
- Open the Repository
- Click "Add file" > "Create a New File"
- Type the name of the File as: LICENSE or LICENSE.txt or LICENSE.md
- Click on "Choose a License Template"
- Review and Submit
- Commit Changes as Required
NOTE: some optional usage, specifications, and helpful links are as below:
- You can add GitHub Repository Badges from Shields IO - if this is a Public Repository;
- TAB (size = 4) has been used for indentation, except this file (README.md).
.github/workflows
is added however, it is recomended that you create your own workflows either using GitHub Actions or on your own.- Basic
docker
files are added for convention, modify it as per requirement. Recomended to delete the file, if not required. - The repository uses
markdown
instead ofrich text format
, so make necessary changes to file extension/type as required.
Introduced in 2019, users can now create a repository from templates in GitHub. To do this, simply head over to any repository settings and enable "Template Repository" from the Options Menu. When creating a new repository from this template, you can just click on Use this template
available in this repository (refer the picture below).
Template Repository is not limited to GitHub, and you can setup your own local-file structure for the same. The following describes the usage of rsync
which is available in most linux distros, more information on rsync.
# Note the use of rsync
rsync -rh ~/source/directory /destination/directory
The template provides a general structure that I use (highly motivated from pandas dir and coding structure). There needs to be several things that need to be changed, just after initializing with the template, which are as follows:
PKG
variable undersetup.py
has to be replaced with the module name and directory namepkg-name
,- Define High-Level Version Name (like 0.0.1, 0.1, 1.1, etc.) in
pkg-name/VERSION
file, to be interpreted bysetup.py
, and - Define/Check/Update Author Name, Copyright Information (if any) in
setup.py
andpkg-name/__init__.py
.
TIP: Install using pip
by moving into the parent directory, with the following folder:
debmalya@machine:~$ ls -l
drwxrwxr-x 3 debmalya debmalya 4096 Aug 30 12:04 PYTHON_GIT_TEMPLATE
Finally, install it via:
pip install ./PYTHON_GIT_TEMPLATE # Normal Installation
pip install -e ./PYTHON_GIT_TEMPLATE # Installation in Editable Mode
Use the command flake8 . --count --exit-zero --max-complexity=10 --statistics
to generate a report.