An intelligent code translation application built with Streamlit and powered by the Claude 3.5 Opus model. This tool automates the process of migrating Python logic into structured, compilable Java code.
As developers frequently switch between languages, manual migration is time-consuming. This project leverages Large Language Models (LLMs) to handle syntax translation, boilerplate generation (Classes/Main methods), and logical mapping between Python and Java.
- Automated Translation: Converts Python scripts into production-ready Java code.
- Smart Boilerplate: Automatically wraps converted logic in a
public class ConvertedCodeandmainmethod. - Instant Preview: View converted code with full syntax highlighting directly in the browser.
- One-Click Download: Export your result as a
.javafile immediately. - Secure API Integration: Supports dynamic API key input via the sidebar for privacy.
- Frontend: Streamlit
- AI Model: Anthropic Claude 3.5 Opus
- Backend: Python
- Deployment: Streamlit Cloud
You can access the live application here: Py2Java AI Migrator
Ensure you have Python installed on your system. You will also need an Anthropic API Key.
-
Clone the repository: git clone:
https://github.com/T786-eng/Py2Java-AI-Migrator--LLM-Powered-Python-to-Java-Converter.git
-
Install dependencies:
pip install -r requirements.txt
-
Run the Application:
streamlit run app.py
- Enter your Anthropic API Key in the sidebar.
- Paste your Python code into the text area.
- Click "Convert to Java".
- Preview the generated code and click "Download Java File" to save it.
- app.py: The main Streamlit interface and application logic.
- converter.py: Logic for communicating with the Claude API and post-processing the output.
- requirements.txt: List of necessary Python libraries including streamlit and anthropic.