Takk
Define your architecture in pure Python-servers, workers, scheduled jobs, and databases connect automatically through type hints.
Overview
Takk is a Python framework that eliminates configuration overhead by using type hints to automatically wire up your infrastructure. Write pure Python code and let Takk handle the connections between servers, workers, databases, and scheduled jobs.
No YAML. No configuration files. Just Python.
Features
- Type-hint driven - Your type annotations define your architecture
- Automatic dependency injection - Components connect without manual wiring
- Pure Python - Everything is code, nothing is configuration
- Full IDE support - Autocomplete and type checking work out of the box
- Minimal boilerplate - Focus on your logic, not setup
Installation
uv add takk
Quick Start
from takk.models import Project, FastAPIApp, Worker
from takk.secrets import SlackWebhook
from my_app.settings import AppSettings
from my_app import app
background_worker = Worker("background")
project = Project(
name="my-custom-server",
shared_settings=[AppSettings],
background_worker=background_worker,
my_server=FastAPIApp(app),
)
How It Works
Takk uses Python type hints to understand your application's resources and automatically creates the necessary connections. When you annotate a settings class with a type like PostgresDsnor RedisDsn, Takk:
- Detects the dependency through type
- Instantiates the component with appropriate configuration
- Injects it into your environment
Read the full article to see how we built this approach.
Core Components
Server
from takk.models import Project, FastAPIApp, Worker
from takk.secrets import SlackWebhook
project = Project(
name="my-custom-server",
custom_network_app=NetworkApp(
command=["/bin/bash", "-c", "uv run main.py"],
port=8000,
),
)
Worker
from takk import Worker
worker = Worker("name-of-worker")
worker.run(function, Args(...))
Database
from pydantic import PostgresDsn, RedisDsn, BaseModel
from takk import Database
class MyAppSettings(BaseModel):
redis_url: RedisDsn
psql_db: PostgresDsn
Scheduled Jobs
from takk.models import Compute, Project, Job
from my_app.train import train_model, TrainConfig
project = Project(
name="ml-example",
train_pokemon_model=Job(
train_model,
cron_schedule="0 3 * * *", # Runs daily at 3 AM
arguments=TrainConfig(...),
),
)
Requirements
- Python 3.10+
- Type hints support
Examples
Check out the examples directory for complete applications:
Learn More
Metadata
Release files for takk 0.1.40
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| takk-0.1.40.tar.gz | 67.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| takk-0.1.40-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 145.6 kB
Release files / takk-0.1.40.tar.gz
| Download URL | takk-0.1.40.tar.gz |
|---|---|
| Size | 67.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
271664247302467c249f7eae40f7460bffe2e122d301f3048af5fa10041a9bd2
|
|
BLAKE2b-256 checksum How to use checksums |
8a931b9996a80d403da600afb8f2e232704b1074802b882351305b6bae0aeca5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / takk-0.1.40-py3-none-any.whl
| Download URL | takk-0.1.40-py3-none-any.whl |
|---|---|
| Size | 77.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a247b18a4df877bb57f974fc15b89b84fd179cb1e6f5c3ea8996451a7f0a28df
|
|
BLAKE2b-256 checksum How to use checksums |
a588eae8d097725239fe443183d3e68d981e0989de05f3cbff34f766e7c2aac7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for takk 0.1.40
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.