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!
java - Running a Python script from Spring-Boot Web Application on embedded Tomcat - Stack Overflow
Execute Python script from Spring boot
java - How to call a python program from spring boot? - Stack Overflow
What is the standard framework used in the Python world for Kubernetes, similar to Spring Boot in Java?
Videos
ยป pip install pyctuator
A recommended way would be to convert your Python code in a REST microservice and then use that in your Java program.
//u can use ProcessBuilder to load python function which have model call
@Service
public class PythonService {
/**
* Executes a Python script to predict a value based on the given input.
*
* @param input The input value for the prediction.
* @return The predicted result as a double.
*/
public double predict(double input) {
double result = 0;
try {
ProcessBuilder pb = new ProcessBuilder("python3", "train-model.py", String.valueOf(input));
Process process = pb.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
if ((line = reader.readLine()) != null) {
result = Double.parseDouble(line);
} else {
throw new RuntimeException("No output from Python script.");
}
process.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
Hello all,
I come from the Java world, where the norm for deploying applications to Kubernetes (K8s) is to use the Spring Boot framework.
What is the equivalent framework or standard in the Python world, if any?
Thanks
Everyone needs a job to pay for bills and buy stuff. So I have been driving into python and it's libraries and got started with flask and django. Also it is quite useful in AI as well, so that's also a reason. (I could just import libraries and do stuff and learn and build along the way)
It is not a matter of whether I should I do django or springboot but of to which to dedicate the most time so that my learning could be the most fruitful. I'm 21 of age.
I'm working on a project that involves utilizing React for the frontend, Spring Boot for the backend, Spring Security for authentication, and Python Flask for machine learning functionalities. I'm considering creating Flask APIs for the machine learning tasks, but I also want to leverage Spring Security for authorization purposes. However, I'm unsure if it's a good practice to have Spring Boot communicate with Flask APIs. Your insights or suggestions would be appreciated!