Fast, batteries-included, business-oriented, opinionated REST APIs framework
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kwik-1.7.0.tar.gz.
File metadata
- Download URL: kwik-1.7.0.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c42e80ac7209037d94adfacbccbea2fab9eeccc3293421563024941f67161cdd
|
|
| MD5 |
036266eb6dbe6338c4e4062eb61fef9f
|
|
| BLAKE2b-256 |
a53cf7f47053b9049610e7b04848d60fd4ebcf34d887a7a120ac0ede02d3e963
|
File details
Details for the file kwik-1.7.0-py3-none-any.whl.
File metadata
- Download URL: kwik-1.7.0-py3-none-any.whl
- Upload date:
- Size: 58.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
346f6fda44b05bc9df14a658853f83b9a326af7a8e7c873c1768fb3f9931776b
|
|
| MD5 |
ae7144c1d952196b45a101e2a0c9c610
|
|
| BLAKE2b-256 |
796305d0be922f7fc3c920534e9e5372dafc849cb3be93fc561607cf25064394
|