// Private beta
Declare databases, Pub/Sub, object storage, caches, cron jobs, and secrets in your Python code. Encore provisions them locally and in your own AWS or GCP account.
Want to talk it through first? Get practical advice from an Encore engineer.
“What used to take days or weeks of back-and-forth between developers and infra teams is now automated and completed in minutes.”
Declare what your application needs directly in Python, and Encore automatically provisions it across local development, preview environments, and production.
from encore.storage import postgres
db = postgres.Database("users", migrations="./migrations")
async def get_user(user_id: int):
return await db.query(
"SELECT * FROM users WHERE id = $1", user_id
).one()from encore import pubsub
from pydantic import BaseModel
class SignupEvent(BaseModel):
user_id: str
email: str
signups = pubsub.Topic("signups")
async def send_welcome(msg: pubsub.Message[SignupEvent]) -> None:
await send_email(msg.data.email)
welcome = pubsub.Subscription[SignupEvent](
signups, "send-welcome", handler=send_welcome
)from encore.storage import objects
avatars = objects.Bucket("avatars", public=True)
async def save_avatar(user_id: str, image: bytes) -> str:
key = f"{user_id}.png"
await avatars.upload(key, image, content_type="image/png")
return avatars.public_url(key)from encore import cron
# Encore calls POST /internal/welcome-emails every 2 hours.
_ = cron.Job(
"welcome-email",
title="Send welcome emails",
path="/internal/welcome-emails",
every="2h",
)
@app.post("/internal/welcome-emails")
async def send_welcome_emails() -> None:
...from encore.secrets import Secret
stripe_key = Secret[str]("StripeSecretKey")
# Read the value at runtime, no .env files to manage
client = StripeClient(stripe_key.value)from encore.storage import redis
sessions = redis.Database("sessions")
async def track_visit(page: str) -> int:
return await sessions.string.incr(f"visits:{page}")from encore import metrics
orders_placed = metrics.Counter("orders_placed")
checkout_time = metrics.Histogram("checkout_duration", unit="seconds")
orders_placed.increment()
checkout_time.observe(0.42)encore run starts your Python app along with every database, topic, bucket, and cache it declares.
No Docker Compose. No config files. No manual setup.
Postgres, Redis, Pub/Sub, and object storage start automatically, with migrations applied
encore test runs your test suite against real local infrastructure, not mocks
Requests, queries, and messages are traced with OpenTelemetry from the first run
The same declarations run locally, in preview environments, and in production. Encore works out the infrastructure, so you and your team can focus on the product.
Encore.py handles infrastructure only. Routing, validation, and request handling stay in FastAPI, Django or whatever you already use, so adopting it doesn't mean a rewrite.
Encore provisions managed databases, queues, buckets, and caches in your own AWS or GCP account. Your data stays in your account.
Static analysis knows which service uses which resource, so each service gets only the IAM permissions it actually needs.
Every pull request gets an isolated environment with its own infrastructure, so changes are tested against the real thing before they merge.
Region, sizing, and scaling are set per environment in the Encore dashboard or your existing Terraform, not in application code.
Traces, logs, and metrics flow through OpenTelemetry, with each request connected to the queries and messages it caused.
Encore gives agents a structured model of your application and its infrastructure, so they can ship features in your Python systems without being handed the keys to your AWS or GCP account.
"Encore is our foundation for all new development. Since adopting it, we've seen a 2-3x increase in development speed and 90% shorter project lead times."
"Encore lets us go from idea to shipped product at least 3x faster and saves us hours of devops work every week."
"We've reduced time spent on DevOps by 95%, and we're now on track to save $60K annually in cloud costs."
"Encore is an unfair advantage. At Pave we've moved 2x faster than we did at Monzo."
"We're saving $200k+ annually compared to additional hiring. The ROI is outstanding, easily 10x."
"You define infrastructure in your code and it's automatically spun up for you. You can go from zero to a deployed service on GCP in an hour. I don't know how else to do it."
"Encore's inferred infrastructure has allowed us to move at unprecedented speed. Combined with database branching in Neon, we're able to spin ephemeral environments up and down with incredible ease. Stakeholders love preview app URLs."
The Encore.py beta is for teams already running Python on AWS or GCP. We’ll work with you directly on migration and deployment in your own cloud.