Skip to main content

Generate a minimal FastAPI project for learning Docker and uv

Project description

fastapi-minimal-template

Uma pequena ferramenta CLI de código aberto que cria uma aplicação FastAPI deliberadamente mínima. Ela foi projetada para aulas práticas sobre Python, APIs REST, Docker, Docker Compose e gerenciamento de dependências com uv.

O projeto gerado contém dois endpoints, testes e arquivos opcionais para Docker. Intencionalmente, ele não inclui banco de dados, autenticação, ORM ou infraestrutura de produção.

Início rápido

Execute a versão mais recente publicada sem instalá-la:

uvx fastapi-minimal-template@latest new hello-api
cd hello-api
uv sync
uv run fastapi dev src/app/main.py

Acesse:

A forma abreviada também é aceita:

uvx fastapi-minimal-template@latest hello-api

Use --no-docker para omitir os arquivos do Docker. Um destino existente nunca será alterado, a menos que --force seja informado explicitamente:

fastapi-minimal-template new hello-api --no-docker
fastapi-minimal-template new hello-api --force

Outras opções de instalação

Execute uma versão específica:

uvx fastapi-minimal-template@0.1.0 new hello-api

Instale o comando permanentemente:

uv tool install fastapi-minimal-template
fastapi-minimal-template new hello-api

Desenvolvimento da CLI

git clone https://github.com/dirleiflsilva/fastapi-minimal-template.git
cd fastapi-minimal-template
uv sync
uv run fastapi-minimal-template new hello-api

Para reproduzir a experiência do uvx antes da publicação:

uvx --from . fastapi-minimal-template new hello-api

Um caminho absoluto pode ser usado após --from caso a forma com o diretório atual não seja resolvida por uma versão mais antiga do uv.

Execute todas as verificações de qualidade e construa a distribuição:

uv run ruff check .
uv run ruff format --check .
uv run pytest
uv build

Publicação

Depois de atualizar a única declaração de versão em src/fastapi_minimal_template/__init__.py, valide e construa o pacote:

uv sync
uv run ruff check .
uv run ruff format --check .
uv run pytest
uv build
uv publish

A publicação requer credenciais do PyPI e deve ser realizada a partir de um commit de release limpo e revisado.

Licença

MIT

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

fastapi_minimal_template-0.1.0.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_minimal_template-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_minimal_template-0.1.0.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastapi_minimal_template-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e0d19b4dc584d10649eb69c4fea538a04bfc6b2dd1b862e934619f867d5ddd8
MD5 5d2ea1d2ff3c061421c21d98c8142a5d
BLAKE2b-256 b02a45a7b4b52921e11a96e14b60aca7ba7f438a25ee16b6cc39a36a831e9275

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastapi_minimal_template-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fastapi_minimal_template-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4da71aee55368a940b66e1ccdd3e91a907a50adc50a9e630f6ab8fcbe10df946
MD5 09461e749ef574ce161c8ca5fb9b1655
BLAKE2b-256 adc9fc2cc05bc20f1899eac3cbddaab3ea317dbc595f32f56f46a4f4ddf14459

See more details on using hashes here.

Supported by

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