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.26.tar.gz (42.9 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.26-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: takk-0.1.26.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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.26.tar.gz
Algorithm Hash digest
SHA256 ae30412915425a28e037d357d0d04423b4769deecb2fdf5accf288f44a92e8dc
MD5 deb49f2883bcb58fe1520b7915bbd07e
BLAKE2b-256 a77ce49f36e26f6ef87f4eda897624300e1eeb922565cc5bf4f2ae5a0d874b41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: takk-0.1.26-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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.26-py3-none-any.whl
Algorithm Hash digest
SHA256 715ed6b30fed1681c09bc24e157f9fdb00b6240de8eff6f0246259a87c51466e
MD5 ded0ceb0d75728d6e7df36998faad68a
BLAKE2b-256 2558eb509caaefee5fe5a5994dbeede2169f8e11a2c074ece9f2e3f37fc53312

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