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.18.tar.gz (30.3 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.18-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: takk-0.1.18.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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.18.tar.gz
Algorithm Hash digest
SHA256 75a95e1ec9e9f6950fdb3fbe1b2bbae973e1216b3f29dfea61a47179c1d589ec
MD5 86bcab3c53bef60f1b14b2e7dd38e4c3
BLAKE2b-256 3e187ab238c4a3c0a27d9a15d81d4f521e92d923004c0c341454fbea2620d925

See more details on using hashes here.

File details

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

File metadata

  • Download URL: takk-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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.18-py3-none-any.whl
Algorithm Hash digest
SHA256 bdcf4f988b8013803dd4da3b27bca65e52ef96936fa2782c28c700ca809acf75
MD5 fa7482b9dcf4c33f8f1be1836781a457
BLAKE2b-256 fbf233a58c6e7dc3b5563961c3ae1bbe733c9349c9d0edd76f76d43f7602fc84

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