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()
Answer from Ants Aasma on Stack Overflow
🌐
Spring
docs.spring.io › spring-python › 1.2.x › sphinx › html › overview.html
1. Overview — Spring Python v1.2.1.FINAL documentation
This is not a direct port of existing ... idioms, and overall user community of Python. ... Spring Python is an offshoot of the Java-based Spring Framework and Spring Security Framework, targeted for Python....
🌐
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!

🌐
Packt
packtpub.com › en-us › learning › how-to-tutorials › getting-started-spring-python
Getting started with Spring Python
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 mappers.
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.

🌐
GitHub
github.com › springpython
SpringPython · GitHub
Spring Python is an offshoot of the Java-based Spring Framework and Spring Security, targeted for Python. - SpringPython
🌐
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.
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%
🌐
GitHub
github.com › spring › Python
GitHub - spring/Python: Python AI Interface plugin for the Spring RTS engine · GitHub
Python AI Interface plugin for the Spring RTS engine - spring/Python
Starred by 15 users
Forked by 4 users
Languages   Python 59.1% | C 30.8% | CMake 7.0% | Lua 2.4% | Shell 0.7%
Find elsewhere
🌐
PyPI
pypi.org › project › springpython
Client Challenge
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
🌐
SourceForge
sourceforge.net › projects › springpython
Spring Python download | SourceForge.net
Download Spring Python for free. USAGE OF SOURCEFORGE IS DEPRECATED: Go to http://springpython.webfactional.com for current project development. Spring Python is an offshoot of the Java-based Spring Framework and Spring Security, targeted for Python.
🌐
StackShare
stackshare.io › stackups › python-vs-spring
Python vs Spring | What are the differences? | StackShare
Language Type: Python is a dynamically-typed programming language, whereas Spring is a Java-based framework. Python allows flexibility with its dynamic typing, allowing developers to change variable types easily.
🌐
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 - package com.et.python; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }
🌐
PyPI
pypi.org › project › pspring
pspring · PyPI
This is a lightweight framework to enable python developers to quickly develop apps with annotations/decorators. Inspired by Spring Framework of Java, the framework provides the ability for IOC ( Inversion of control ) and Autowiring the beans.
      » pip install pspring
    
Published   Jan 13, 2021
Version   0.0.39
🌐
Amazon
amazon.com › Spring-Python-1-1-Greg-Turnquist › dp › 1849510660
Spring Python 1.1: Turnquist, Greg Lee: 9781849510660: Amazon.com: Books
Spring Python 1.1 [Turnquist, Greg Lee] on Amazon.com. *FREE* shipping on qualifying offers. Spring Python 1.1
🌐
Baeldung
baeldung.com › home › java › how to call python from java
How to Call Python From Java | Baeldung
August 27, 2025 - Learn the most common ways of calling Python code from Java.
🌐
StackShare
stackshare.io › stackups › python-vs-spring-boot
Python vs Spring Boot | What are the differences? | StackShare
Development Paradigm: Python follows a more procedural and object-oriented programming paradigm, allowing developers to write code that is easier to understand and maintain. In contrast, Spring Boot follows a more declarative programming paradigm, providing developers with a higher level of abstraction and reducing the amount of boilerplate code.
🌐
Quora
quora.com › Are-there-any-application-framework-like-spring-Java-framework-for-python
Are there any application framework like spring (Java framework) for python? - Quora
Answer (1 of 2): Spring framework is a java based framework which uses MVC .Am assuming you want a similar kind of framework in Python ,if that being the case you should checkout Django framework , there are others see outline below. * CherryPy. * Django. * Quixote. * Zope. * Flask. * Grok...
🌐
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 - A Python script to load the model and make predictions. A Spring Boot application that interacts with this Python functionality.
🌐
Reddit
reddit.com › r/webdev › what's better, springboot aka java or python?
r/webdev on Reddit: What's better, SpringBoot AKA Java or Python?
July 15, 2021 -

Hi! I'm a webdev newbie and I'm currently looking for a good framework to try out. I'd like to know, regardless of my expertise and learning curve of either language, which would be a better choice for building a fast and reliable website? Java(SpringBoot) or Python(Flask/Django)? And can you give some examples of websites made with either language? If anybody has any other suggestions(like JS) besides these two languages/frameworks, feel free to tell me as well. Thanks in advance!! :D

Top answer
1 of 4
5
It depends what your aiming for, much of Enterprise Web based Applications run with Spring Boot. It's mostly used as Backend Only and a separate Frontend. I would recommend looking at HTMX + Spring Boot https://youtu.be/aGgWvwb5xUE Django is more Full Stack and probably easier to do fast development. I would recommend Dennis Ivy on YouTube
2 of 4
5
Like others have said already - It depends on what you're going to build... Java (spring/spring boot) - is an enterprise framework used mainly for managing heavy db transactions, mostly in financial industries like those corpo banks. Python(Flask/Django) - on the other hand, is more of general purpose lang (like swiss army knife).. Django is more common to hear on web dev due its out of box features included. Flask is easier to get into if you are just starting out. Few examples - reddit, airbnb, dropbox, instagram etc.. Let's try & level down a little bit here ye... In your post, you mentioned that you are new (to this sub? or web programming in general?)... Either way - Why are you jumping straight into web frameworks?? (this is like using a Ginsu knife while still learning how to cook OR getting a Lambo when you just passed your driving test yesterday) my point here is: do you understand different layers of a web app (business logic, presentation, data persistence/data storage etc.) do you have a fundamental knowledge of how web works (http get, event handlers, DOM elements, html/css, forms etc.) understanding of web servers & how they communicate w/ your website (networking/security)... and the list goes on Not saying you need to be proficient on all of the above, just an understanding will suffice then you can dig deeper into each parts & possibly specialise on one. Having said that, based on your post i will go for Flask as it is a good tool in learning fundamentals & has core pieces you need w/c is available on almost all other frameworks. If this was me (And I need to re-learn everything), I'd start w/ barebones html, css w/ vanilla JS. Then take next step with PHP & setup a LAMP stack locally. Anyways, I'm blaberring on about things now - I wish you goodluck on your webdev journey mate.
🌐
Flexiple
flexiple.com › compare › python-vs-spring
Python vs Spring - A Detailed Comparison | Flexiple - Flexiple
The active community of Python Developers provides a wealth of resources, including libraries, frameworks and tools. Spring is a widely-used, open-source and lightweight framework for building enterprise applications in Java.