Giter Site home page Giter Site logo

template-python's Introduction

Python template repository

Imports: isort Code style: black pre-commit ci

Brendon Smith (br3ndonland)

Description

Welcome! This is a template repository for Python projects, engineered for use as a GitHub template repository. To use the template, click on "Use this template" or browse to template-python/generate. GitHub will create a new repository without the commit history from this one.

The template-python repo name can be replaced with a one-line terminal command: git grep -l 'template-python' | xargs sed -i '' 's/template-python/repo-name/g' (replace repo-name with the name of the repository you generate). There may also be a few edits to the pyproject.toml needed. See the quickstart section for more.

Another common approach, especially for Python, is to use cookiecutter. In a cookiecutter repo, the developer adds template variables throughout, like {{cookiecutter.repo_name}}. When a user runs cookiecutter using the template repository, the template variables are replaced with the information the user provides. This repo is simple enough that I haven't needed to add cookiecutter yet.

Copier is similar to cookiecutter, with some additional benefits. Copier is being refactored in preparation for version 6, and I may consider updating this repo for Copier 6.

Quickstart

cd path/to/repo
# Replace instances of template-python with new repo name
# In the command below, use your repo name instead of 'repo-name'
❯ git grep -l 'template-python' | xargs sed -i '' 's|template-python|repo-name|g'
❯ git grep -l 'templatepython' | xargs sed -i '' 's|templatepython|repo-name|g'
# Install virtual environment with poetry: https://python-poetry.org/docs/
❯ poetry install
❯ poetry shell
# Install pre-commit hooks
.venv ❯ pre-commit install
# Try running the tests
.venv ❯ pytest

Further information

See CONTRIBUTING.md.

template-python's People

Contributors

br3ndonland avatar dependabot[bot] avatar

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.