Skip to content

ldelarue/clue

Repository files navigation

Clue

My personal Python application template for my work. πŸ”
It helps me to remember how to bootstrap a common Python project such as a Python library, a Command Line Interface (CLI), or a REST API using FastAPI framework.

Clue left.
Unintended evidence.

Setup βš™οΈ

  1. This project uses mise as tool manager. Make sure to install the binary in your Linux/MacOS system.

    mise install
  2. This project uses uv as Python project manager.

    uv sync
  3. Configure your IDE and/or your shell prompt to use the dedicated Python virtual environement.

    source .venv/bin/activate
  4. Install developer tools.

    uv tool install ruff
    uv tool install mkdocs --with mkdocs-material
  5. Consider to install Docker.

  6. This project uses make to improve developer experience.

    make help

Code workflow ✨

This project uses mypy and ruff to check type consitency, format and lint Python files.

uv run mypy .
uvx ruff format
uvx ruff check --fix . 

Tests πŸ«—

This project uses pytest, and all test scripts are located in the tests folder.

uv run pytest .

Run locally ⚑

API using a Docker container 🐳

docker build -t clue:local .
docker run clue:local

Or alternatively using make:

make image

CLI mode

uv run cli_runner_writer.py -t text!

API mode

uv run api_runner_printer.py

Or alternatively using Docker after you built the image.

docker run -p 80:5000 clue:local

User documentation πŸ“‘

This project use mkdocs for its documentation.

uvx mkdocs serve

Static files are generated in /docs-dist folder using the following command.

uvx mkdocs build

Contribution πŸš€

Your contribution would be (obviously) welcomed!