Production Python, working together.
Pyronaut brings dependency injection, validation, data access, observability, testing, and packaging into one application model.
High performance
Pyronaut shifts application work to build time, preparing dependency injection, serialization, routing, and more before startup. A JIT compiler optimizes hot Python code, while a non-blocking HTTP runtime handles concurrent requests.
Rich data access
Define data access declaratively in Python. Pyronaut generates repository implementations and precomputes queries at build time, with a consistent programming model across supported databases.
Production observability
Understand how your service behaves in production. Pyronaut brings together traces, correlated logs, health checks, and metrics with integrated Micrometer and OpenTelemetry support.
Cloud integrations
Make AWS, Azure, GCP, and Oracle Cloud services part of your Python application. Inject managed SDK clients, import cloud configuration and secrets, and work with messaging, storage, events, serverless workloads, and more through one application model.
Build-time validation
Catch configuration and dependency wiring problems at build time, giving coding agents and humans feedback before runtime.
Enterprise support
Enterprise support for teams running business-critical Pyronaut services in production.
Write Python. Get the platform around it.
Your Python types and annotations define routing, validation, serialization, dependency injection, OpenAPI, and tests.
Pyronaut processes the application model before startup, enabling earlier validation and carrying the same model through development, testing, and packaging.
- One type definition drives the application model
- Check configuration and dependency wiring before runtime
- One application model spans development, tests, and packaging
imports
from dataclasses import dataclass
from typing import Annotated, List
from jakarta.inject import Inject
from jakarta.validation import Valid
from jakarta.validation.constraints import NotBlank, Positive
from micronaut.data.annotation import GeneratedValue, Id, MappedEntity
from micronaut.data.jdbc.annotation import JdbcRepository
from micronaut.data.repository import CrudRepository
from micronaut.http import HttpResponse
from micronaut.http.annotation import Body, Get, Post
from micronaut.serde.annotation import Serdeable@dataclass
@MappedEntity
@Serdeable
class Rocket:
id: Annotated[int | None, Id, GeneratedValue]
name: str
thrust_kn: float
@Serdeable
@dataclass
class LaunchCommand:
name: Annotated[str, NotBlank]
thrust_kn: Annotated[float, Positive]
@JdbcRepository(dialect="MYSQL")
class RocketRepository(CrudRepository[Rocket, int]):
def findByNameContains(self, fragment: str) -> List[Rocket]: ...
rockets: Annotated[RocketRepository, Inject]
@Get("/rockets")
def fleet() -> List[Rocket]:
return rockets.findAll()
@Get("/rockets/search/{fragment}")
def search(fragment: str) -> List[Rocket]:
return rockets.findByNameContains(fragment)
@Post("/rockets")
def launch(command: Annotated[LaunchCommand, Body, Valid]) -> HttpResponse:
rocket = Rocket(None, command.name, command.thrust_kn)
return HttpResponse.created(rockets.save(rocket))Use Micronaut annotations directly from Python for data access, routing, dependency injection, validation, and serialization.
imports
from typing import Any
import pytest
import requests
from pyronaut.test import MicronautTest, micronaut_test_fixture@pytest.fixture
def application_context(request: Any) -> Any:
fixture = micronaut_test_fixture(request, MicronautTest())
yield fixture
fixture.stop()
@pytest.fixture
def client(application_context: Any) -> requests.Session:
return requests.with_context(application_context)
def test_launch(client: requests.Session):
rocket = {"name": "Ariane 7", "thrust_kn": 15000}
created = client.post("/rockets", json=rocket)
assert created.status_code == 201
assert created.json()["id"] is not None
found = client.get("/rockets/search/Ariane").json()
assert "Ariane 7" in [r["name"] for r in found]
def test_validation(client: requests.Session):
response = client.post(
"/rockets", json={"name": "", "thrust_kn": -1}
)
assert response.status_code == 400pytest runs against the same embedded server, DI context, and Test Resources database the application uses.
$ pip install pyronaut
$ pyronaut create rocket-service
Resolved Micronaut platform 5.x via Maven
Created rocket-service/ with pyproject.toml
$ pyronaut dev
Test Resources: mysql:8 ready on :3306
Server running on http://localhost:8080 (reload on)
$ pyronaut test
12 passed in 3.4s (JUnit XML + HTML report)
$ pyronaut validate-config --env production
Configuration OK · DI graph OK
$ pyronaut build --native-base
Native executable: build/rocket-serviceOne CLI coordinates creation, development, testing, validation, and production packaging.
From Python source to a production artifact.
One CLI coordinates creation, development, testing, validation, and packaging.
- Create- pyronaut create- Generate a project with platform dependencies resolved.
- Develop- pyronaut dev- Local server with automatic reload and managed Test Resources.
- Test- pyronaut test- Run pytest against the real application context and test infrastructure.
- Validate- pyronaut validate-config- Check configuration and DI wiring for dev, run, test, and production.
- Package- pyronaut build- Produce a wheel, container image, or native executable.
A representative FastAPI stack vs. Pyronaut
FastAPI is a strong HTTP framework. Pyronaut takes a different approach, combining high performance with data access, observability, build-time validation, testing, and production packaging.
For teams building production Python services.
Choose Pyronaut when your Python services need high performance and deeper production capabilities.
- Python developers
- Build with one consistent application model.
- Architects
- Standardize how teams build and run production Python services.
- Platform engineering
- Give teams one path from project creation to production artifact.
- Engineering leadership
- Adopt a high-performance Python framework with enterprise support.
Already building on Micronaut? Add Python without adding a second application platform. Use Python on the Micronaut platform you already know.