Spring-Ready Python

Table of Contents
github logo spring_ready_python

I run a microservices architecture built on Spring Boot — Eureka for discovery, Config Server for configuration, Spring Boot Admin for monitoring, Prometheus for metrics. It works great. But then I needed to add a Python service, and suddenly nothing worked together.

The Python service couldn’t register with Eureka. It couldn’t pull config from Config Server. It didn’t show up in Spring Boot Admin. I was writing boilerplate HTTP calls to Eureka’s REST API, manually handling heartbeats, and it was getting messy fast.

So I built a library that makes any FastAPI app behave like a Spring Boot service — register, discover, configure, and monitor — with a single line of code.

What it does

from spring_ready import SpringReadyApp
from fastapi import FastAPI

app = FastAPI()
spring_app = SpringReadyApp(app)
spring_app.start()

That’s it. Your Python app now:

The problem it solves

If you have a Spring Boot ecosystem and want to add a Python service, you usually have two options: rewrite everything in Python (no thanks), or manually wire up every integration point. Neither is great.

graph TD
    subgraph spring ["Spring Boot Ecosystem"]
        E[Eureka]
        C[Config Server]
        A[Spring Boot Admin]
        P[Prometheus]
    end

    subgraph services ["Services"]
        J1[Java Service ✅]
        J2[Kotlin Service ✅]
        PY[Python Service ❓]
    end

    J1 --> E
    J2 --> E
    PY -.->|"manual HTTP calls?"| E

    style PY fill:#ffcdd2

With spring-ready-python, the Python service gets the same treatment:

graph TD
    subgraph spring ["Spring Boot Ecosystem"]
        E[Eureka]
        C[Config Server]
        A[Spring Boot Admin]
        P[Prometheus]
    end

    subgraph services ["Services"]
        J1[Java Service ✅]
        J2[Kotlin Service ✅]
        PY[Python Service ✅]
    end

    J1 --> E
    J2 --> E
    PY --> E
    E --> C
    E --> A
    PY --> P

    style PY fill:#c8e6c9

Behavior matching

I wanted the Python service to behave exactly like a Spring Boot app would. Not “close enough” — actually the same:

Feature Spring Boot spring-ready-python
Fail-fast on startup
Exponential backoff retry
Eureka heartbeat (30s)
Config Server discovery via Eureka
Actuator endpoints
Graceful shutdown + deregister

The startup sequence matches Spring Boot’s: register with Eureka first, discover Config Server from Eureka, load configuration into environment, expose actuator endpoints, start heartbeat. If Eureka is down and fail_fast=True, the service won’t start — just like Spring Boot.

Configuration

Everything follows Spring Boot conventions, configured through environment variables:

SPRING_APPLICATION_NAME=my-python-service
EUREKA_SERVER_URL=http://eureka:8761/eureka/
SPRING_PROFILES_ACTIVE=production

It even supports Config Server auth, custom instance IPs for Docker/K8s, and HTTPS registration. The env var names match what a Spring Boot developer would expect.

The Config Client

github logo spring-config-client-python

Before building spring-ready-python, I needed to solve a simpler problem first — loading config from Spring Cloud Config Server into a Python app. The existing Python clients were either outdated or way too complicated for what should be a straightforward task.

So I built spring-config-client-python as a standalone library. It does one thing: fetch config from your Config Server and load it into os.environ. No magic, no runtime refresh, no hidden complexity.

from spring_config_client import SpringConfigClient

client = SpringConfigClient(
    server_url="https://config.example.com",
    app_name="my-service",
    profile="production"
)
client.fetch_and_load()

# Done — all your config is now in os.environ

It handles property source precedence (profile-specific overrides defaults), resolves Spring-style ${PLACEHOLDER} interpolation, and loads dotted keys like spring.datasource.url as-is. Fails fast if the server is unreachable — your service shouldn’t start without proper configuration.

spring-ready-python uses this under the hood for its Config Server integration. But you can use it standalone too if you just need config loading without the full Eureka/Actuator setup.

Install

# Full Spring integration
pip install spring-ready-python

# Just the config client
pip install spring-config-client-python

What’s next?

Both libraries are intentionally simple and focused. They cover the 90% case — a Python service that needs to live in a Spring Boot world. I might add config refresh support at some point, but for now they do exactly what they need to do. PRs welcome!