Skip to main content

A minimal, strictly structured Python project template.

Project description

Python Project Template

After creating a new git repository copy over:
* docs
* poetry_template
* tests
* pyproject.toml
* setup.cfg

Go through the project and change the placeholder values. pyproject.toml contains the list of the most important values present throughout the project.

Finally, delete this note.
# Note: Install Python 3
# Update pip and install virtualenv (dependency encapsulator) and black (linter; IDE needs to be restarted)

# Note: install Poetry for Linux
$: curl -sSL | python

# Note: install Poetry for Windows
$: (Invoke-WebRequest -Uri -UseBasicParsing).Content | python
# Note: do NOT update Poetry, it will break itself

$: python --uninstall
# Note: `.toml` project name and package have to match (poetry-template; poetry_template)
$: poetry install  # install all dependencies


$: pip install dist/poetry_template-0.1.3-py3-none.any.whl

$: poetry-template


$: poetry shell
$: cd docs
# Note: review source/ and source/index.rst
$: make html
# Note: see docs in docs/build/apidocs/index.html


$: poetry run python ./poetry_template/


$: poetry run pytest --durations=0
$: poetry run pytest --cov=poetry_template --cov-report=html tests
#: Note: see coverage report in htmlcov/index.html


Dependencies, Python version and the virtual environment are managed by Poetry.

$: poetry search Package-Name
$: poetry add Package-Name[==Package-Version]


Define project entry point and metadata.


Configure Python libraries.


$: poetry run black .


$: poetry run python ./poetry_template/

Build and publish

$: poetry build

$: poetry config pypi-token.pypi PyPI-Api-Access-Token  # get the token from PiPy

$: poetry publish --build

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for poetry-template, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size poetry_template-0.1.3-py3-none-any.whl (5.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size poetry-template-0.1.3.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page