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
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
Parametric Bottle in CADQuery

Parametric Bottle using CADQuery The proposed code makes it possible to generate different types and sizes of 3D bottles in order to train Pixel2mesh

Ayoub EL HOUDRI 1 May 22, 2022
ioztat is a storage load analysis tool for OpenZFS

ioztat is a storage load analysis tool for OpenZFS. It provides iostat-like statistics at an individual dataset/zvol level.

Jim Salter 116 Nov 25, 2022
Security-related flags and options for C compilers

Getting the maximum of your C compiler, for security

135 Nov 11, 2022
Prometheus exporter for Spigot accounts

SpigotExporter Prometheus exporter for Spigot accounts What it provides SpigotExporter will output metrics for each of your plugins and a cumulative d

Jacob Bashista 5 Dec 20, 2021
A fluid medium for storing, relating, and surfacing thoughts.

Conceptarium A fluid medium for storing, relating, and surfacing thoughts. Read more... Instructions The conceptarium takes up about 1GB RAM when runn

115 Dec 19, 2022
PyMedPhys is an open-source Medical Physics python library

PyMedPhys is an open-source Medical Physics python library built by an open community that values and prioritises code sharing, review, improvement, and learning from each other. I

PyMedPhys 238 Dec 27, 2022
WATTS provides a set of Python classes that can manage simulation workflows for multiple codes where information is exchanged at a coarse level

WATTS (Workflow and Template Toolkit for Simulation) provides a set of Python classes that can manage simulation workflows for multiple codes where information is exchanged at a coarse level.

13 Dec 23, 2022
Tool to generate wrappers for Linux libraries allowing for dlopen()ing them without writing any boilerplate

Dynload wrapper This program will generate a wrapper to make it easy to dlopen() shared objects on Linux without writing a ton of boilerplate code. Th

Hein-Pieter van Braam 25 Oct 24, 2022
EFB Docker image with efb-telegram-master and efb-wechat-slave

efb-wechat-docker EFB Docker image with efb-telegram-master and efb-wechat-slave Features Container run by non-root user. Support add environment vari

Haukeng 1 Nov 10, 2022
Convert your Gyrosco.pe travels to GPX files

gyroscope2gpx This little python joint will do you a favor of taking your "Travel" export from Gyroscope (https://gyrosco.pe) and turn it into a bunch

nick g 4 Oct 02, 2022
The goal of this program was to find the most common color in my living room.

The goal of this program was to find the most common color in my living room. I found a dataset online with colors names and their corr

1 Nov 09, 2021
The tool helps to find hidden parameters that can be vulnerable or can reveal interesting functionality that other hunters miss.

The tool helps to find hidden parameters that can be vulnerable or can reveal interesting functionality that other hunters miss. Greater accuracy is achieved thanks to the line-by-line comparison of

197 Nov 14, 2022
A Python script to parse Fortinet products serial numbers, and detect the associated model and version.

ParseFortinetSerialNumber A Python script to parse Fortinet products serial numbers, and detect the associated model and version. Example $ ./ParseFor

Podalirius 10 Oct 28, 2022
Data repo for one-among.us

Our Data Data repo for one-among.us File Structure Directory /people/userid/: Data for a specific person info.json5: Profile information page.md: Pr

Hykilpikonna 55 Dec 30, 2022
Python decorator for `TODO`s

Python decorator for `TODO`s. Don't let your TODOs rot in your python projects anymore !

Klemen Sever 74 Sep 13, 2022
MIB2 STD ZR Firmware Upgrade

Upgrade MIB2 STD ZR Firmware (without Navigation) About This repository contains some scripts and documentation how to upgrade the MIB2 firmware to a

Fabian 18 Dec 29, 2022
Python library for creating PEG parsers

PyParsing -- A Python Parsing Module Introduction The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the t

Pyparsing 1.7k Jan 03, 2023
A Guide for Feature Engineering and Feature Selection, with implementations and examples in Python.

Feature Engineering & Feature Selection A comprehensive guide [pdf] [markdown] for Feature Engineering and Feature Selection, with implementations and

Yimeng.Zhang 968 Dec 29, 2022
Manjaro CN Repository

Manjaro CN Repository Automatically built packages based on archlinuxcn/repo and manjarocn/docker. Install Add manjarocn to /etc/pacman.conf: Please m

Manjaro CN 28 Jun 26, 2022