Home

Awesome

<!--lint ignore--> <!--lint disable double-link--> <!-- markdownlint-disable --> <p align="center"> <!-- github-banner-start --> <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only" alt="Litestar Logo - Light" width="100%" height="auto" /> <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only" alt="Litestar Logo - Dark" width="100%" height="auto" /> <!-- github-banner-end --> </p> <!-- markdownlint-restore --> <div align="center"> <!-- prettier-ignore-start --> <!-- markdown-link-check-disable -->
ProjectStatus
CI/CDci Documentation Building
QualityCoverage Quality Gate Status Maintainability Rating Reliability Rating Security Rating
PackagePyPI - Version PyPI - Support Python Versions Starlite PyPI - Downloads Litestar PyPI - Downloads
CommunityReddit Discord Matrix Twitter Blog
MetaLitestar Project types - Mypy License - MIT Litestar Sponsors linting - Ruff code style - Black All Contributors
<!-- prettier-ignore-end --> </div> <hr>

litestar-hello-world

Minimal Litestar Implementation.

Install PDM

Linux/Mac

curl -sSL https://pdm.fming.dev/install-pdm.py | python3 -

Windows

(Invoke-WebRequest -Uri https://pdm.fming.dev/install-pdm.py -UseBasicParsing).Content | python -

Install litestar

pdm install
pdm venv activate
litestar run --reload
curl localhost:8000/sync -w "\n" && curl localhost:8000/async -w "\n"

Litestar Development

If you want to use this app to test a local version of Litestar, change the litestar dependency in pyproject.toml to:

dev = [
    ...
    "litestar @ git+https://github.com/litestar-org/litestar.git",
]

...or you can add it manually with:

pdm add "git+https://github.com/litestar-org/litestar.git" --dev

[!NOTE]
See PDM - Editable Dependencies for more info.

Run uvicorn or any other ASGI-compliant server from the root of this app:

[!IMPORTANT]
This assumes that Litestar and this app exist in the same directory.

pdm run uvicorn app:app --reload --reload-dir .

Code Quality

After cloning:

pre-commit install

Run on all files:

pre-commit run --all-files

Run a specific hook:

pre-commit run mypy --all-files

Docs

[!IMPORTANT]
TODO