Skip to main content

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

Project description

NoBS

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 nobs.models import Project, FastAPIApp, Worker
from nobs.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:

  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 nobs.models import Project, FastAPIApp, Worker
from nobs.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 nobs import Worker

worker = Worker("name-of-worker")

worker.run(function, Args(...))

Database

from pydantic import PostgresDsn, RedisDsn, BaseModel
from nobs import Database

class MyAppSettings(BaseModel):
    redis_url: RedisDsn
    psql_db: PostgresDsn

Scheduled Jobs

from nobs.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 (nobs):

class MyApp(BaseModel):
    psql_uri: PostgresDsn

Contributing

Contributions are welcome! Please read our Contributing Guidelines.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Add tests for your changes
  4. Ensure all tests pass (pytest)
  5. Submit a pull request

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

nobspy-0.1.14.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

nobspy-0.1.14-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file nobspy-0.1.14.tar.gz.

File metadata

  • Download URL: nobspy-0.1.14.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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 nobspy-0.1.14.tar.gz
Algorithm Hash digest
SHA256 e22c53974cf1515cfb6cab967336c18a8aa17d8587e103eddd1044fc2576e38d
MD5 b8d526cc502d1d9a479be96a352cead6
BLAKE2b-256 9be16a7fd03126639d65681826598cb975c46486425fda990cc0f0e44008dc9b

See more details on using hashes here.

File details

Details for the file nobspy-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: nobspy-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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 nobspy-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 112a7c60b7c6148cb2e4322ea23608936025fa06adf64345785fcedb7c9a50c4
MD5 317f23ee5392946f8e9942fff6868572
BLAKE2b-256 d77250105ff414c389268d554c229a3647b1d2a98e716373203f2bb4565639fb

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