Giter VIP home page Giter VIP logo

robs_awesome_python_template's Introduction

Rob's Awesome Python Template

Rob's Awesome Python Template is extremely customizable- it can work for the smallest library to the largest application.

Usage

  1. Install cookiecutter.
  2. Install pyenv if you haven't already.
  3. Run the cookiecutter command.
cookiecutter gh:tedivm/robs_awesome_python_template

The rest of the process is interactive- you'll be asked for a project name and about which features you want enabled, after which the project will be setup.

Core Functionality

Optional Libraries

This template can also configure and setup a variety of optional services. Each optional service adds its own dependencies, configuration, handlers, and everything else needed to jump right into development.

Features that are not selected get completely cleaned up and will not pollute the newly created project.

FastAPI

FastAPI is one of the easiest ways to develop REST Based APIs. When enabled a "Hello World" application will be setup.

Celery

Celery is the standard for Queue Management systems with Python.

Typer and Click

Typer, which is built on top of the Click Framework, is one of the easiest ways to build command line applications. When enabled this template will create an initial CLI handler and register it with python for easy installation.

SQLAlchemy and Alembic

SQLAlchemy is one of the most used SQL ORM frameworks in python. It is regularly paired with Alembic to handle database migrations.

This template configures SQLAlchemy and Alembic to work together using a unified configuration. Alembic will automatically discover all models in the models directory.

Projects with this template will have access to the Async SQLAlchemy engine.

Paracelsus

Paracelsus is a library that automatically generates diagrams of SQLAlchemy database schemas and injects them into documentation.

Docker

Docker Images are the standard for distributing and running applications. The Docker extensions to this project create containers for the other services that are enabled, such as FastAPI and Celery.

The images made by this template come from the Multi-Py project and support both AMD and ARM architectures.

Github Actions

Github Action Workflows are optionally created for a variety of tasks-

  • Formatting Python, JSON, YAML, and TOML
  • Testing
  • Typing
  • Publishing Packages to PyPI
  • Pushing Images to GHCR
  • Updating Dependency (requirements.txt) Files

Examples

Project examples are available in the example repository.

These are just some options, as features can be mixed and matched to create numerous permutations.

robs_awesome_python_template's People

Contributors

tedivm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

robs_awesome_python_template's Issues

Bug: Projects created with versions older than 3.10 fail at formatting

This is due to DapperData using features in 3.10.

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, 
    in _run_module_as_mainreturn _run_code(code, main_globals, None,File "/usr/lib/python3.8/runpy.py", line 87, 
    in _run_codeexec(code, run_globals)File "/home/archidit/ct_fastapi_backend/.venv/lib/python3.8/site-packages/dapperdata/cli.py", line 9, 
    in <module>from .formatters.yaml import yaml_formatterFile "/home/archidit/ct_fastapi_backend/.venv/lib/python3.8/site-packages/dapperdata/formatters/yaml.py", line 10, 
    in <module>class YAMLWithStrings(YAML):File "/home/archidit/ct_fastapi_backend/.venv/lib/python3.8/site-packages/dapperdata/formatters/yaml.py", line 11, 
    in YAMLWithStringsdef dump(self, data: Any, stream=None, **kw) -> None | str:TypeError: unsupported operand type(s) for |: 'NoneType' and 'type'make: *** [makefile:66: dapperdata_fixes] Error 1. .venv/bin/activate && python -m black .. .venv/bin/activate && python -m isort .Fixing /home/archidit/ct_fastapi_backend/ct_fastapi_backend/conf/settings.pyFixing /home/archidit/ct_fastapi_backend/db/env.pySkipped 1 files. .venv/bin/activate && python -m dapperdata.cli pretty . --no-dry-runFailed to run command 'make pretty': 2ERROR: Stopping generation because post_gen_project hook script didn't exit successfullyHook script failed (exit status: 2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.