Skip to main content

A project that makes it easier to develope and deploy Python projects

Project description

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],

    workers=[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:

  1. Detects the dependency through type
  2. Instantiates the component with appropriate configuration
  3. 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

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

takk-0.1.19.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

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

takk-0.1.19-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file takk-0.1.19.tar.gz.

File metadata

  • Download URL: takk-0.1.19.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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}

File hashes

Hashes for takk-0.1.19.tar.gz
Algorithm Hash digest
SHA256 4c3ac5afedd5c4fe99e03624889b000aab9fd26c8851207803b227ca74abae76
MD5 d21d7d79453e94b94f7ff772d52d978e
BLAKE2b-256 60189b73bcde0db2b7d525f5c87dbbd07f18deb6b76c45d068224179f04ca805

See more details on using hashes here.

File details

Details for the file takk-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: takk-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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}

File hashes

Hashes for takk-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 f3c166fab59236c423f8c2e75ebd934c27aa0328881d5e8d52445b9740719002
MD5 82a27e3a344d45d40d0ce3ccc79105a7
BLAKE2b-256 89eb4a366470e4056d1f71dbf4bee8c3bde4349c8d76d7d1e37d4338254e9489

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