Skip to main content

python-starter

A straightforward starter template for Python packages.

Includes things like:

  • All necessary files and paths in .gitignore
  • setup.cfg configuration
  • Local development using requirements.txt and requirements-dev.txt
  • Tools like mypy, black and pytest set up out of the box

Setup

  • Clone this repo and delete .git
  • Rename src/sample_package folder to your package name
  • Rename the package import in tests/sample_test.py
  • Edit the marked fields in setup.cfg, and remove comments
  • Edit LICENSE
  • Setup and activate a virtualenv
  • Run pip install -r requirements-dev.txt
  • That's it! See if it worked by running mycommand and python -m <package name>

Testing

Run pytest

Type Checking

Run mypy .

Create and upload a package to PyPI

Make sure to bump the version in setup.cfg.

Then run the following commands:

rm -rf build dist
python setup.py sdist bdist_wheel

Then upload it to PyPI using twine:

twine upload dist/*

Metadata

Release files for indentify 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for indentify 0.0.1
File Size Uploaded
indentify-0.0.1.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for indentify 0.0.1
File Interpreter ABI Platform
indentify-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / indentify-0.0.1.tar.gz

Download URL indentify-0.0.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
eaeb008c82927557ac0920e67d358fa3930a161d3404343697de6f540c776c00
BLAKE2b-256 checksum
How to use checksums
e7a439821c7cd213e6009493050c1ff1a6f5a9b3dff2008d39cc1f0cb653396f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.7

Release files / indentify-0.0.1-py3-none-any.whl

Download URL indentify-0.0.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1314abd9f95ace98b6f056a543d8dced36529812277b38490759b6860e5c4b3
BLAKE2b-256 checksum
How to use checksums
2b970d1f71732e562ca7a15941136cad1c2684ea8c8ccf80e55af15223ab6885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page