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.21.tar.gz (35.4 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.21-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: takk-0.1.21.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.21.tar.gz
Algorithm Hash digest
SHA256 aeddd719139be12e3147cf5f1ecfdaeee45f2e1e8610853c073648bedeca0fc0
MD5 04848869dd1f8f9cabbb2d8e04524296
BLAKE2b-256 ccf36029edde3b1d8b4d95e5aa24a0cca6ba100a9b47ed1923153d2ea960a05a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: takk-0.1.21-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.21-py3-none-any.whl
Algorithm Hash digest
SHA256 7ebaedf336f10c94b5d33a327377f5018ac93e8fbe49b05235ab94b5f9bd1d3c
MD5 d0e379ac9a68ab8755604a049a87455c
BLAKE2b-256 3505d93a9d894018ff917412693fae7f5850ac123beb877a40f03d8d58c17e35

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