Python Project Template

Overview

Python Project Template

A low dependency and really simple to start project template for Python Projects.

See also Flask-Project-Template for a full feature Flask project including database, API, admin interface, etc.

HOW TO USE THIS TEMPLATE

DO NOT FORK this is meant to be used from Use this template feature.

  1. Click on Use this template
  2. Give a name to your project
    (e.g. my_awesome_project recommendation is to use all lowercase and underscores separation for repo names.)
  3. Wait until the first run of CI finishes
    (Github Actions will process the template and commit to your new repo)
  4. If you want codecov Reports and Automatic Release to PyPI
    On the new repository settings->secrets add your PIPY_API_TOKEN and CODECOV_TOKEN (get the tokens on respective websites)
  5. Read the file CONTRIBUTING.md
  6. Then clone your new project and happy coding!

NOTE: WAIT until first CI run on github actions before cloning your new project.

What is included on this template?

  • 🖼️ Templates for starting multiple application types:
    • Basic low dependency Python program (default) use this template
    • Flask with database, admin interface, restapi and authentication use this template. or Run make init after cloning to generate a new project based on a template.
  • 📦 A basic setup.py file to provide installation, packaging and distribution for your project.
    Template uses setuptools because it's the de-facto standard for Python packages, you can run make switch-to-poetry later if you want.
  • 🤖 A Makefile with the most useful commands to install, test, lint, format and release your project.
  • 📃 Documentation structure using mkdocs
  • 💬 Auto generation of change log using gitchangelog to keep a HISTORY.md file automatically based on your commit history on every release.
  • 🐋 A simple Containerfile to build a container image for your project.
    Containerfile is a more open standard for building container images than Dockerfile, you can use buildah or docker with this file.
  • 🧪 Testing structure using pytest
  • Code linting using flake8
  • 📊 Code coverage reports using codecov
  • 🛳️ Automatic release to PyPI using twine and github actions.
  • 🎯 Entry points to execute your program using python -m or $ project_name with basic CLI argument parsing.
  • 🔄 Continuous integration using Github Actions with jobs to lint, test and release your project on Linux, Mac and Windows environments.

Curious about architectural decisions on this template? read ABOUT_THIS_TEMPLATE.md
If you want to contribute to this template please open an issue or fork and send a PULL REQUEST.


project_name

codecov CI

project_description

Install it from PyPI

pip install project_name

Usage

from project_name import BaseClass
from project_name import base_function

BaseClass().base_method()
base_function()
$ python -m project_name
#or
$ project_name

Development

Read the CONTRIBUTING.md file.

Comments
  • Rename-project won't run by default

    Rename-project won't run by default

    Describe the bug Action Rename-project won't run without elevating workflow permissions

    To Reproduce Click the link in readme ( https://github.com/rochacbruno/python-project-template/generate ) Name the project Go into actions and error should be there

    Expected behavior AFAIK this can not be worked around. Probably update readme so newbs like me don't spend 30 minutes hunting git docs for a solution. I have like 1 hour of work experience in GitHub so can't advise how it should be solved.

    Error Log remote: Permission to jdobruchowski/Oracle-REST-SQL-util-.git denied to github-actions[bot]. fatal: unable to access 'https://github.com/jdobruchowski/Oracle-REST-SQL-util-/': The requested URL returned error: 403 Error: Invalid status code: 128 at ChildProcess. (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1022:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) { code: 128 } Error: Invalid status code: 128 at ChildProcess. (/home/runner/work/_actions/stefanzweifel/git-auto-commit-action/v4/index.js:17:19) at ChildProcess.emit (events.js:314:20) at maybeClose (internal/child_process.js:1022:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

    bug help wanted 
    opened by jdobruchowski 2
  • fix typo

    fix typo

    Summary :memo:

    Small fix for a typo in readme.md file

    Details

    1. changed readme.md

    Checks

    • [ ] Closed #798
    • [ ] Tested Changes
    • [ ] Stakeholder Approval
    opened by osbm 0
  • cleanups

    cleanups

    Summary :memo:

    Write an overview about it.

    Details

    Describe more what you did on changes.

    1. (...)
    2. (...)

    Bugfixes :bug: (delete if dind't have any)

    Checks

    • [ ] Closed #798
    • [ ] Tested Changes
    • [ ] Stakeholder Approval
    opened by rochacbruno 0
  • wrong version pushed to pypi

    wrong version pushed to pypi

    https://github.com/rochacbruno/python-project-template/blob/3b55b1c022d54fba2c8604cc56d7daccba310352/Makefile#L82-L87

    maybe the line

        @git tag $${TAG}
    

    should be moved to behind the line

        @git commit -m "release: version $${TAG} 🚀"
    

    ?

    Thanks for your effort. A very useful template.

    opened by oirontro 0
  • Add basic ArgParse example

    Add basic ArgParse example

    The file https://github.com/rochacbruno/python-project-template/blob/main/project_name/main.py is missing a simple implementation of a CLI using ArgParse from stdlib.

    opened by rochacbruno 0
  • [bug] Fix generation when project name has dashes and upper case

    [bug] Fix generation when project name has dashes and upper case

    Example of generated repo

    https://github.com/rochacbruno/This-Is_Great

    This-Is_Great is replaced as This_Is_Great and it doesn't match repo URL.

    Read a new variable on rename_project.sh script and job, use this as repo_slug on specific places as readme badges and URLS.

    bug 
    opened by rochacbruno 0
Releases(0.1.2)
Owner
Bruno Rocha
Programmer at @RedHatOfficial. #Python #Rust . Working on: @ansible @python #dynaconf @codeshow
Bruno Rocha
SimBiber - A tool for simplifying bibtex with official info

SimBiber: A tool for simplifying bibtex with official info. We often need to sim

336 Jan 02, 2023
Check a discord message and give it a percentage of scamminess

scamChecker Check a discord message and give it a percentage of scamminess Run the bot, and run the command !scamCheck and it will return a percentage

3 Sep 22, 2022
AdventOfCode 2021 solutions from the Devcord server

adventofcode-21 Ein Sammel-Repository für Advent of Code 2021-Lösungen der deutschen DevCord-Community. A repository collecting Advent of Code 2021 so

Devcord 12 Aug 26, 2022
InfiniPy has some neat features - like the endpoint for function

InfiniPy has some neat features - like the endpoint for function

ZeroTwo 7 Nov 20, 2022
Repository to store sample python programs for python learning

py Repository to store sample Python programs. This repository is meant for beginners to assist them in their learning of Python. The repository cover

codebasics 5.8k Dec 30, 2022
Shell Trality API for local development.

Trality Simulator Intro This package is a work in progress. It allows local development of Trality bots in an IDE such as VS Code. The package provide

CrypTrality 1 Nov 17, 2021
A streamlit app for exploring image search results from HuggingPics

title emoji colorFrom colorTo sdk app_file pinned huggingpics-explorer 🤗 blue red streamlit app.py false huggingpics-explorer A streamlit app for exp

Nathan Raw 4 Sep 10, 2022
Experiments with Tox plugin system

The project is an attempt to add to the tox some missing out of the box functionality. Basically it is just an extension for the tool that will be loa

Volodymyr Vitvitskyi 30 Nov 26, 2022
Experimental proxy for dumping the unencrypted packet data from Brawl Stars (WIP)

Brawl Stars Proxy Experimental proxy for version 39.99 of Brawl Stars. It allows you to capture the packets being sent between the Brawl Stars client

4 Oct 29, 2021
This module is for finding the execution time of a whole python program

exetime 3.8 This module is for finding the execution time of a whole program How to install $ pip install exetime Contents: General Information Instru

Saikat Das 4 Oct 18, 2021
python for windows extensions

This is the readme for the Python for Win32 (pywin32) extensions source code. See CHANGES.txt for recent changes. 'setup.py' is a standard distutils

27 Dec 08, 2022
A simple Python script for generating a variety of hashes from safe urandom entropy.

Hashgen A simple Python script for generating a variety of hashes from safe urandom entropy. For whenever you need a random hash (e.g. generating an a

Xanspie 1 Feb 17, 2022
eyes is a Public Opinion Mining System focusing on taiwanese forums such as PTT, Dcard.

eyes is a Public Opinion Mining System focusing on taiwanese forums such as PTT, Dcard. Features 🔥 Article monitor: helps you capture the trend at a

Sean 116 Dec 29, 2022
An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to art and design.

Awesome AI for Art & Design An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to a

Margaret Maynard-Reid 20 Dec 21, 2022
SEH-Helper - Binary Ninja plugin for exploring Structured Exception Handlers

SEH Helper Author: EliseZeroTwo A Binary Ninja helper for exploring structured e

Elise 74 Dec 26, 2022
A tool for checking if the external data used in Flatpak manifests is still up to date

Flatpak External Data Checker This is a tool for checking for outdated or broken links of external data in Flatpak manifests. Motivation Flatpak apps

Flathub 76 Dec 24, 2022
aaencode for python,把python代码转换为颜文字

py-aaencode aaencode for python,把python代码转换为颜文字 compile.py: 将python编译成颜文字,编译结果有随机性,可以选择BPE词表压缩代码 compile_min.py: 最小化的编译器 compiled_min.txt: 编译得到的最小的com

11 Dec 30, 2021
Simple Python-based web application to allow UGM students to fill their QR presence list without having another device in hand.

Praesentia Praesentia is a simple Python-based web application to allow UGM students to fill their QR presence list without having another device in h

loncat 20 Sep 29, 2022
An example project which contains the Unity components necessary to complete Navigation2's SLAM tutorial with a Turtlebot3, using a custom Unity environment in place of Gazebo.

Navigation 2 SLAM Example This example provides a Unity Project and a colcon workspace that, when used together, allows a user to substitute Unity as

Unity Technologies 183 Jan 04, 2023
UF3: a python library for generating ultra-fast interatomic potentials

Ultra-Fast Force Fields (UF3) S. R. Xie, M. Rupp, and R. G. Hennig, "Ultra-fast interpretable machine-learning potentials", preprint arXiv:2110.00624

Ultra-Fast Force Fields 24 Nov 13, 2022