Skip to main content

Python CLI app template project featuring the modern and extensible Python project manager hatch.

Project description

python-cli-app-template

Boilerplate for Python CLI utility project.

Features

  • Uses Hatch - modern PEP-compliant project manager
  • Uses Typer framework for managing CLI commands
  • Uses Dynaconf for flexible management of configurations

Usage

pca --help

Development

To set up hatch and pre-commit for the first time:

  1. install hatch globally, e.g. with pipx or brew, i.e. pipx install hatch,
  2. make sure pre-commit is installed globally, e.g. with pipx install pre-commit.

A special feature that makes hatch very different from other familiar tools is that you almost never activate, or enter, an environment. Instead, you use hatch run env_name:command and the default environment is assumed for a command if there is no colon found. Thus you must always define your environment in a declarative way and hatch makes sure that the environment reflects your declaration by updating it whenever you issue a hatch run .... This helps with reproducability and avoids forgetting to specify dependencies since the hatch workflow is to specify everything directly in pyproject.toml. Only in rare cases, you will use hatch shell to enter the default environment, which is similar to what you may know from other tools.

To get you started, use hatch run test:cov or hatch run test:no-cov to run the unitest with or without coverage reports, respectively. Use hatch run lint:all to run all kinds of typing and linting checks. Try to automatically fix linting problems with hatch run lint:fix and use hatch run docs:serve to build and serve your documentation. You can also easily define your own environments and commands. Check out the environment setup of hatch in pyproject.toml for more commands as well as the package, build and tool configuration.

The environments defined by hatch are configured to generate lock files using hatch-pip-compile under locks. To upgrade all packages in an environment like test, just run hatch run test:upgrade-all. To upgrade specific packages, type hatch run test:upgrade-pkg pkg1,pkg2.

Credits

This package was created with The Hatchlor project template.

Project details


Download files

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

Source Distribution

python_cli_app_template-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

python_cli_app_template-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file python_cli_app_template-0.1.0.tar.gz.

File metadata

File hashes

Hashes for python_cli_app_template-0.1.0.tar.gz
Algorithm Hash digest
SHA256 040d58baa7ba84379cb9e142ec67f2de0b4f9a75b0930177832a306fb1f6ecc3
MD5 674f8c35253fa30edb5530114c3a8f01
BLAKE2b-256 5f7fb75b457d05ffcc26d082cd96a750ba8f50193c386db9bdf510d07c23e492

See more details on using hashes here.

File details

Details for the file python_cli_app_template-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_cli_app_template-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3af9ce9a73789145da985a9bea87eb4152435ea4e3b9b9f8163230eeeecc288
MD5 acd0d4e1ff363861f3b2b2f0adf69528
BLAKE2b-256 22a65280ae72aa80b42b8c563cf9ce6b4bcb1843e11b8653ea7ca37de73a9df7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page