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.2.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

python_cli_app_template-0.2.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for python_cli_app_template-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3a55e9a65179857e700356450a3565c9019353e7a4925d996a3e1c3355c16238
MD5 954d13bdd7fc85fd732574723b2297eb
BLAKE2b-256 8bbef1ceeef0f602ab01157afe85151663f9a45b4a1dd4e7452db7f5ffbf5a89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_cli_app_template-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6aa46d8c92028ea800194e3d1fe8fa995e9a7f57402ce769d9739cd22f11c228
MD5 3c94ac534bee151335d4575e8c437438
BLAKE2b-256 d24ace1b410fc7d50616ca20d564d32df87b06813d5dd6212f5f29d6dd1f3757

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