A project that makes it easier to develope and deploy Python projects
Project description
NoBS Python
Define your architecture in pure Python-servers, workers, scheduled jobs, and databases connect automatically through type hints.
Overview
NoBS is a Python framework that eliminates configuration overhead by using type hints to automatically wire up your infrastructure. Write pure Python code and let NoBS 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
pip install nobs
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
NoBS 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, NoBS:
- 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
Development
Setup
git clone https://gitlab.com/MatsMoll/nobs.git
cd nobs
python -m venv .venv
source .venv/bin/activate
uv sync
Running Tests
pytest
Type Checking
mypy nobs
Examples
Check out the examples directory for complete applications:
Why nobs?
Traditional frameworks require configuration files, manual wiring, and boilerplate code. nobs leverages Python's type system to eliminate this overhead:
Before (traditional approach):
# config.yaml
database:
host: localhost
port: 5432
After (takk):
class MyApp(BaseModel):
psql_uri: PostgresDsn
Contributing
Contributions are welcome! Please read our Contributing Guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add tests for your changes
- Ensure all tests pass (
pytest) - Submit a pull request
Learn More
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file takk-0.1.16.tar.gz.
File metadata
- Download URL: takk-0.1.16.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5e9a6f5575995c06ed64d15786279340e4597802593f8e277cc4b4b075efb60
|
|
| MD5 |
e7ddadf644821dd3e6bf67fdc1209cf7
|
|
| BLAKE2b-256 |
b732aa41bddd076ba9a32fc3cc607f14f8de6dc0d90627b6d04ae898e5440520
|
File details
Details for the file takk-0.1.16-py3-none-any.whl.
File metadata
- Download URL: takk-0.1.16-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c9185fca94e5ad5ce2ec4a8fd09a3acf0da5c5b240776e9cbbb28e5a2e8b618
|
|
| MD5 |
f12c4c50c42daa934679a133465beeee
|
|
| BLAKE2b-256 |
ecd2101b05400bb9509927d90221c8a895162a74ee400e9b67e0d6908c76b39c
|