Registry / web-framework / spring-py-core

spring-py-core

JSON →
library0.1.5pypypi✓ verified 79d ago

A Python implementation of the Spring Framework Inversion of Control (IoC) container, providing dependency injection, bean management, and configuration support. Currently at version 0.1.5, released with a monthly cadence. Requires Python 3.11+.

pip install spring-py-core
INSTALL
IMPORT
SIG · SPRING-PY-CORE
S
spring-py-core
web-frameworkpythonv0.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SpringApplication
from spring_py import SpringApplication
from spring_py_core import SpringApplication
ApplicationContext
from spring_py import ApplicationContext
Autowired
from spring_py import Autowired

Create two components with dependency injection and run the application.

from spring_py_core import SpringApplication from spring_py_core.annotations import Component, Autowired @Component class Greeter: def greet(self): return "Hello, Spring!" @Component class App: @Autowired def __init__(self, greeter: Greeter): self.greeter = greeter def run(self): print(self.greeter.greet()) if __name__ == "__main__": SpringApplication.run(App)
Debug
Known issues
gotchaThe package name on PyPI is 'spring-py-core' but the import module uses underscores: 'spring_py_core'. Common installation mistake leads to ImportError.
fix
Use 'import spring_py_core' (underscores) after pip installing 'spring-py-core' (hyphens).
affects: all
gotchaOnly Python 3.11+ is supported. Installing on older Python versions will fail.
fix
Ensure Python 3.11 or higher is used.
affects: all
breakingIn version 0.1.5, the 'SpringApplication.run()' method no longer accepts a class as a string; it must be a class reference.
fix
Pass the class object directly: SpringApplication.run(App)
affects: >=0.1.5
deprecatedThe 'XmlBeanFactory' is deprecated in 0.1.5. Use 'AnnotationConfigApplicationContext' instead.
fix
Replace 'XmlBeanFactory' with 'AnnotationConfigApplicationContext' and use annotations for configuration.
affects: >=0.1.5
Upgrade
Version history
0.1.5latest on PyPI · released Aug 14, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Resources
spring-py-core — pip install spring-py-core · libregistry