How did you come to decide on Spring Python as your API of choice? Spring works well on Java where there's a tradition of declarative programming; defining your application primarily using XML to control a core engine is a standard pattern in Java.

In Python, while the underlying patterns like Inversion of Control are still apposite (depending on your use case), the implementation chosen by Spring looks like a classic case of something produced by a Java programmer who doesn't want to learn Python. See the oft-referenced article Python is Not Java.

I applaud your decision to introduce order and thoughtfulness to your codebase, but you may wish to evaluate a number of options before making your decision. In particular, you may find that using Spring Python will make it difficult to hire good Python programmers, many of whom will run the other way when faced with 1000-line XML files describing object interactions.

Perhaps start by re-examining what you really want to accomplish. The problem cannot simply be that "you need a framework". There are lots of frameworks out there, and it's hard to evaluate a) if you truly need one and b) which one will work if you haven't identified what underlying software problems you need to solve.

If the real problem is that your code is an unmaintainable mess, introducing a framework probably won't fix the issue. Instead of just messy code, you'll have code that is messy in someone else's style :-) Perhaps rigour in the dev team is where you should recommend starting first: good planning, code reviews, stringent hiring practices, a "cleanup" release, etc...

Good luck with the research.

Answer from Jarret Hardie on Stack Overflow
🌐
Packt
packtpub.com › en-us › learning › how-to-tutorials › getting-started-spring-python
Getting started with Spring Python
Python is one of the most popular and technically powerful dynamic languages to develop software. Spring Python makes it easier to solve common problems encountered by Python developers every day. Let's learn about the non-invasive nature of spring python, template solutions, and object-relational ...
🌐
Spring
docs.spring.io › spring-python › 1.2.x › sphinx › html › overview.html
1. Overview — Spring Python v1.2.1.FINAL documentation
DatabaseTemplate - Reading from the database requires a monotonous cycle of opening cursors, reading rows, and closing cursors, along with exception handlers. With this template class, all you need is the SQL query and row-handling function. Spring Python does the rest.
Top answer
1 of 2
11

How did you come to decide on Spring Python as your API of choice? Spring works well on Java where there's a tradition of declarative programming; defining your application primarily using XML to control a core engine is a standard pattern in Java.

In Python, while the underlying patterns like Inversion of Control are still apposite (depending on your use case), the implementation chosen by Spring looks like a classic case of something produced by a Java programmer who doesn't want to learn Python. See the oft-referenced article Python is Not Java.

I applaud your decision to introduce order and thoughtfulness to your codebase, but you may wish to evaluate a number of options before making your decision. In particular, you may find that using Spring Python will make it difficult to hire good Python programmers, many of whom will run the other way when faced with 1000-line XML files describing object interactions.

Perhaps start by re-examining what you really want to accomplish. The problem cannot simply be that "you need a framework". There are lots of frameworks out there, and it's hard to evaluate a) if you truly need one and b) which one will work if you haven't identified what underlying software problems you need to solve.

If the real problem is that your code is an unmaintainable mess, introducing a framework probably won't fix the issue. Instead of just messy code, you'll have code that is messy in someone else's style :-) Perhaps rigour in the dev team is where you should recommend starting first: good planning, code reviews, stringent hiring practices, a "cleanup" release, etc...

Good luck with the research.

2 of 2
1

I won't go so far as to suggest that Spring Python is bad (because I don't know enough about it). But, to call Spring Python the "gold standard for Python APIs" is a stretch. To me, it seems that Spring Python is more of a way to allow Python apps to interact with Java Apps using Spring.

At any rate, after taking a precursory glance at the official documentation, it seems fairly easy to understand for me having decent knowledge of Python but no knowledge of spring. Aside from the fact that it almost looks like Java code where the author forgot the typenames, semicolons, and curly braces. :-)

🌐
Medium
jxausea.medium.com › spring-boot-integrated-python-engine-quick-start-demo-24d3f96cc4aa
Spring boot integrated python engine quick start demo | by Harries | Medium
March 12, 2024 - Spring boot integrated python engine quick start demo 一、Python introduction Python is a high-level scripting language that combines interpreted, compiled, interactive and object-oriented …
🌐
Baeldung
baeldung.com › home › java › how to call python from java
How to Call Python From Java | Baeldung
August 27, 2025 - Once we have an endpoint we can access, we can use any one of several Java HTTP libraries to invoke our Python web service/application implementation. In this tutorial, we’ve learned about some of the most popular technologies for calling Python code from Java.
🌐
SlideShare
slideshare.net › gturnquist › intro-to-spring-python
Client Challenge
June 2, 2010 - JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
Find elsewhere
🌐
GitHub
github.com › springpython
SpringPython · GitHub
Spring Python is an offshoot of the Java-based Spring Framework and Spring Security, targeted for Python. - SpringPython
🌐
Spring
docs.spring.io › spring-python › 1.2.x › sphinx › html › objects.html
3. The IoC container — Spring Python v1.2.1.FINAL documentation
In fact, this container is capable of receiving object definitions from multiple sources, each of differing types such as XML, YAML, Python code, and other future formats. The following block of code shows an example of creating an object container, and then pulling an object out of the container.: # TODO: Use YUI here from springpython.context import ApplicationContext from springpython.config import XMLConfig container = ApplicationContext(XMLConfig("app-context.xml")) service = container.get_object("sampleService")
🌐
Dreamix
dreamix.eu › home › insights › tech › how to use jython with spring boot
How to use Jython with Spring Boot - Dreamix
July 16, 2024 - I used the first one in the Spring tutorial - https://spring.io/guides/gs/spring-boot/ 2.Then we need Jython (https://www.jython.org/ ). I installed version 2.7.1 to my PC and added the dependency to the pom.xml like that: <dependency> <groupId>org.python</groupId> <artifactId>jython</artifactId> <version>2.7.1</version> </dependency> An easier way would be to use jython-standalone artifact here which doesn’t require Jython installation and keeps most of the libraries in the JAR but it has limited functionality and doesn’t allow you to use external modules available through pip.
🌐
GitHub
github.com › spring-attic › spring-python
GitHub - spring-attic/spring-python: This project has moved to https://github.com/springpython/springpython. This repo is an archived fork and will not see more updates.
May 4, 2022 - This project has moved to https://github.com/springpython/springpython. This repo is an archived fork and will not see more updates. - spring-attic/spring-python
Starred by 52 users
Forked by 38 users
Languages   Python 97.7% | Java 1.8% | Shell 0.5% | Python 97.7% | Java 1.8% | Shell 0.5%
🌐
Medium
medium.com › @kiarash.shamaii › integrating-a-simple-python-model-with-a-spring-boot-application-ddaf372831a7
Integrating a Simple Python Model with a Spring Boot Application | by kiarash shamaii | Medium
September 1, 2024 - Integrating a Simple Python Model with a Spring Boot Application In this article, I’ll create a simple linear regression model in Python, separating the model definition from the prediction logic …
🌐
Reddit
reddit.com › r/python › pyspring - a python web framework inspired by spring boot.
r/Python on Reddit: PySpring - A Python web framework inspired by Spring Boot.
June 15, 2025 -

I've been working on something exciting - PySpring, a Python web framework that brings Spring Boot's elegance to Python. If you're tired of writing boilerplate code and want a more structured approach to web development, this might interest you!

- What's cool about it:

  • Auto dependency injection (no more manual wiring!)

  • Auto configuration management

  • Built on FastAPI for high performance

  • Component-based architecture

  • Familiar Spring Boot-like patterns

    • Recent PRs:

      • Route Mapping Decorators Implementation #3

      • Add Support for Qualifiers and Component Registration Validation

  • GitHub: https://github.com/PythonSpring/pyspring-core

  • Example Project: https://github.com/NFUChen/PySpring-Example-Project

Note: This project is in active development. I'm working on new features and improvements regularly. Your feedback and contributions would be incredibly valuable at this stage!If you like the idea of bringing Spring Boot's elegant patterns to Python or believe in making web development more structured and maintainable, I'd really appreciate if you could:

  • Star the repository

  • Share this with your network

  • Give it a try in your next project

Every star and share helps this project grow and reach more developers who might benefit from it. Thanks for your support! 🙏I'm actively maintaining this and would love your feedback! Feel free to star, open issues, or contribute. Let me know what you think!

Top answer
1 of 3
27

Dependency injection frameworks are not nearly as useful in a dynamically typed language. See for example the presentation Dependency Injection: Vitally important or totally irrelevant? In Java the flexibility provided by a dependency injection framework is vital, while in Python it usually results in unneeded complexity.

This doesn't mean that the principles are wrong. See this example how to achieve loose coupling between classes by using simple idioms:

# A concrete class implementing the greeting provider interface
class EnglishGreetingProvider(object):
    def get_greeting(self, who):
        return "Hello %s!" % who

# A class that takes a greeting provider factory as a parameter
class ConsoleGreeter(object):
    def __init__(self, who, provider=EnglishGreetingProvider):
        self.who = who
        self.provider = provider()
    def greet(self):
        print(self.provider.get_greeting(self.who))

# Default wiring
greeter = ConsoleGreeter(who="World")
greeter.greet()

# Alternative implementation
class FrenchGreetingProvider(object):
    def get_greeting(self, who):
        return "Bonjour %s!" % who
greeter = ConsoleGreeter(who="World", provider=FrenchGreetingProvider)
greeter.greet()
2 of 3
23

DISCLOSURE: I am the project lead for Spring Python, so you can consider my opinion biased.

I find that several of the options provided by Spring Python are useful including: aspect oriented programming, dependency injection, remoting, security, and easy database access.

Aspect oriented programming is, as they say, easier to implement off the cuff with python than java. But Spring Python makes it easy enough to add to existing python modules without editing their source code. The other solutions require meta-programming or modifying the original source code. I've already had one person visit our forums asking how to add an interceptor to a PyGame application, so he could unobtrusively "tap" some code.

Many people quickly assume "dependency injection" or "IoC" instantly means "XML configuration files". Not the case. While we support an XML configuration, just leap directly into using python decorators.

I already know about one company that is using Spring Python as a key piece of their system. They are interested in making improvements, adding new features, and generally using it as a piece of their solution. They have also experimented with running it inside jython, in case that piques your interest.

At the end of the day, my suggestion is to examine all the features, and see if any of them suit your needs. Whether this is adding needless complexity or succinct value can only be determined by you. You don't have to use everything; only what you need. To get some more info on what is available, I invite you to view Introduction to Spring Python, that I presented at SpringOne Americas 2008 conference.

🌐
TutorialsPoint
tutorialspoint.com › spring › index.htm
Spring Tutorial
Python TechnologiesDatabasesComputer ProgrammingWeb DevelopmentJava TechnologiesComputer ScienceMobile DevelopmentBig Data & AnalyticsMicrosoft TechnologiesDevOpsLatest TechnologiesMachine LearningDigital MarketingSoftware QualityManagement Tutorials View All Categories ... Spring framework is an open source Java platform that provides comprehensive infrastructure support for developing robust Java applications very easily and very rapidly.
🌐
Medium
medium.com › @springtutorials › how-to-get-started-with-spring-framework-1253232d538e
How to get started with Spring Framework | by Amit Sharma | Medium
September 24, 2017 - Python frameworks and their usage. Credits: JetBrains · Sitepoint shows Laravel in PHP world is growing fast. ... Now that we have gone through our litmus test and Spring Framework shows promise, we can proceed.
🌐
Tpoint Tech
tpointtech.com › spring-tutorial
Spring Framework Tutorial - Tpoint Tech
March 17, 2025 - Python · Java · JavaScript · SQL · C · C++ HTML · CSS · React · Node.js · Spring Boot · C# PHP · MySQL · MongoDB · AI · ML · DSA · DBMS · OS · Spring Framework Tutorial · Spring Modules · Spring Application · Spring CronExpression Class in Java ·
🌐
GeeksforGeeks
geeksforgeeks.org › advance java › spring
Spring Tutorial - Learn Spring - GeeksforGeeks
September 13, 2025 - Modular Design: Spring is highly modular, so you only use the parts you need without unnecessary overhead.
🌐
SourceForge
sourceforge.net › projects › springpython
Spring Python download | SourceForge.net
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss.