Skip to content

Spring Boot Example

Demonstrates Spring Boot 3.x auto-configuration with PythonEmbed starter. Shows zero-code integration, REST endpoint serving Python evaluation, and Actuator health checks.

View source - Application View source - Controller

Key Points

  • Zero-code setup: just add the starter dependency and configure application.yml
  • SINGLE mode injects PythonEmbed bean via @Autowired
  • REST endpoint evaluates arbitrary Python expressions
  • Actuator health endpoint at /actuator/health
  • Random port configuration (server.port=0) to avoid conflicts

Run It

./gradlew :python-embed-examples:spring-boot-example:run