Skip to content

d-one/python_cli_template

Repository files navigation

Python CLI Template

This is a simple template for a Python CLI tool. It relies on a couple of packages:

  • omegaconf to handle the configuration
  • click is used to create the CLI and to combine the different commands
  • poetry is used to package the tool and for dependency management.
  • pytest is used for testing.

It does not use setuptools for now.

Overview

├── .python-version                  Used by pipx to use the correct Python version 
├── CHANGELOG.md
├── config                           Sample location for a yaml-based config file.
├── Dockerfile
├── LICENSE
├── pyproject.toml                   
├── README.md
├── template
│   ├── client.py                    The entrypoint of the client.
│   ├── commands                     All the commands.
│   │   ├── cli.py                   Main command.
│   │   └── some_other_command.py
│   └── utils
│       ├── config.py
│       └── logging.py
└── tests
    └── some_test.py

Setup

We recommend using pyenv to manage the different Python versions. Then it's just a pipx installation and command away to set up poetry.

Mac

brew install pyenv pipx
pyenv install 3.13
pipx install poetry
poetry install

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published