Skip to content

A quick-start Python project template with helpful functionality and common libraries.

Notifications You must be signed in to change notification settings

dylanhogg/python-project-template

Repository files navigation

Python project template

Latest Tag Build

A quick-start Python project template featuring:

  1. Useful functionality wrapped in a Makefile
  2. Helpful default packages (details below)
  3. Nicely configured JupyterLab for experiments with example notebook loading external scripts
  4. Separated app and dev requirements.txt files
  5. A Python .gitignore
  6. A GitHub build action
  7. Example app showing logging and CLI arg parsing

Makefile support for common tasks

  1. make venv - create an isolated virtual environment (using venv) and install common packages
  2. make run - run the main app in venv with appropriate paths set
  3. make jupyter - launch jubyter lab with /notebooks root folder but still retaining notebook access to the parent /src and /log folders
  4. make test - run unit tests
  5. make black - format code and make flake8 for linting
  6. make sync_data_to_s3 and make sync_data_from_s3 - sync data with an s3 bucket

Type make for all commands.

Application libraries included in template

  1. Python-dotenv for environment variable management
  2. Sphinx to create documentation
  3. Typer for building CLI applications
  4. tqdm for smart progress bar support
  5. Loguru for pleasant and powerful logging

Development libraries included in template

  1. pytest for writing your tests
  2. Black for code formatting
  3. Flake8 for code style linting
  4. JupyterLab for notebooks

Other Python templates for inspiration/alternatives

  1. https://github.com/tedivm/robs_awesome_python_template
  2. https://github.com/TezRomacH/python-package-template
  3. https://github.com/drivendata/cookiecutter-data-science
  4. https://github.com/crmne/cookiecutter-modern-datascience
  5. https://github.com/xinntao/ProjectTemplate-Python

Improvements

  1. More GitHub actions
  2. Replace requirements with Poetry
  3. Investigate adding static Typing checking, e.g. mypy
  4. Turn into a cookiecutter template
  5. Add more examples in /src/examples

About

A quick-start Python project template with helpful functionality and common libraries.

Topics

Resources

Stars

Watchers

Forks