Kwik
⚠️ Pre-Release Software Warning
Kwik v1.0 has been released and is ready for production use. The internal APIs, data structures, and framework interfaces are now stable. While not guaranteed, we strive to maintain backward compatibility following semantic versioning principles.
Documentation: https://davide.mezzogori.com/kwik/
Fast, batteries-included, business-oriented, opinionated REST APIs framework
Acknowledgments
Python 3.12+
Kwik stands on the shoulder of a couple of giants:
- FastAPI: for the underlying REST API server.
- Pydantic: for the data validation and serialization.
- SQLAlchemy: for the ORM part.
Installation
$ pip install kwik
or
$ uv add kwik
It will install Kwik and all its dependencies.
Development
Setup
# Clone the repository
git clone https://github.com/dmezzogori/kwik.git
cd kwik
# Install dependencies using uv
uv sync
# Start development server with hot reload
kwik
Testing
# Run all tests with coverage (testcontainers automatically manages PostgreSQL)
pytest --cov=src/kwik --cov-report=term-missing
# Run tests in parallel (faster)
pytest -n auto
# Run specific test file
pytest tests/crud/test_crud_users.py
# Run only unit tests (skip integration tests)
pytest -m "not integration"
Note: Tests use testcontainers to automatically manage the PostgreSQL database. No manual database setup required (just docker).
Code Quality
# Run linter and formatter
ruff check
ruff format
Documentation
# Start documentation website locally
cd docs
docker compose up
# Access at http://localhost:8000
Listing queries (DX)
- Unified dependency
kwik.dependencies.ListQuerycombines pagination, sorting, and filtering for list endpoints. - Query params supported:
skipandlimitfor pagination (stable default ordering by primary key when no sort is provided)sortingas comma-separated fields with optional direction, e.g.?sorting=name:asc,id:descfilter_keyandvaluefor simple equality filters, e.g.?filter_key=is_active&value=true
- Example endpoint:
def list_users(q: ListQuery, context: UserContext) -> Paginated[UserProfile]: total, data = crud_users.get_multi(context=context, **q) return {"total": total, "data": data}
- Invalid filter/sort fields return HTTP 400 with a clear message.
Contributing
- Create a feature branch (
git checkout -b feature/your-feature-name) - Make your changes following the existing code style
- Add tests for new functionality
- Run tests and ensure they pass
- Run linting and fix any issues
- Commit your changes (
git commit -am '<Your commit message>') - Push to the branch (
git push origin feature/your-feature-name) - Create a Pull Request
License
This project is licensed under the terms of the MIT license.
Metadata
Release files for kwik 1.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kwik-1.13.0.tar.gz | 1.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kwik-1.13.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / kwik-1.13.0.tar.gz
| Download URL | kwik-1.13.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44a19e9760a40842f9c084b3ee2448bbd26c427ff75ce995b677aac1c1e18bec
|
|
BLAKE2b-256 checksum How to use checksums |
d30a9a2f6b7190493c8d286ca8e1ca050efa1c187ce338dc22aaa68d1ea72be8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.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}
|
Release files / kwik-1.13.0-py3-none-any.whl
| Download URL | kwik-1.13.0-py3-none-any.whl |
|---|---|
| Size | 71.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b822f10f824dec4e99e7cbfd159c9a9861e6f402cfc1eea7b1bcc7bf4d053af9
|
|
BLAKE2b-256 checksum How to use checksums |
946e623836533df9faea132c7f19604286287fca32e79445452b92e512d05954
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.0 {"installer":{"name":"uv","version":"0.13.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}
|