DECODE is an AI-powered code analysis tool designed to help beginners understand programs more easily.
It analyzes the submitted code, divides it into meaningful logical segments, explains what each section does, identifies important functions and variables, and provides time and space complexity analysis.
- 🔍 Breaks code into meaningful logical segments
- 💡 Provides beginner-friendly explanations
- 🐛 Detects common syntax and logical issues
- 📊 Analyzes time complexity
- 💾 Analyzes space complexity
- 🔑 Identifies important functions and variables
- 🏷️ Identifies important programming keywords
- ⚡ Provides code improvement suggestions
- 📚 Gives line-by-line explanations
- 🤖 Uses Google Gemini AI for intelligent analysis
- 🎨 Interactive Streamlit interface
- 🧑💻 Designed especially for programming beginners
- Python – Core programming language
- Streamlit – Web application interface
- Google Gemini API – AI-powered code analysis
- python-dotenv – Environment variable management
DECODE uses the Google Gemini API to analyze and explain user-submitted code.
The application sends the user's code and analysis instructions to the Gemini model and displays the generated explanation through the Streamlit interface.
The model can be selected from the application's settings.
DECODE requires a Google Gemini API key to perform AI-based analysis.
The API key can be entered directly through the application's sidebar.
For local development, the API key can also be stored in a .env file:
GEMINI_API_KEY=your_api_key_hereThe application was tested during development using multiple Python programs and different types of code inputs.
Tests performed ✅ Simple Python programs ✅ Programs containing loops ✅ Conditional statements ✅ Functions ✅ Variables and data structures ✅ Different code lengths ✅ Time complexity analysis ✅ Space complexity analysis ✅ Invalid/problematic code inputs ✅ Gemini API connectivity ✅ Streamlit deployment
The Gemini API was tested multiple times during development to verify that the application could successfully send code, receive an AI response, and display the result.
API availability and usage limits depend on the Gemini model and the limits associated with the user's Google AI account.
The response time depends mainly on:
Internet connection Gemini API response time Size and complexity of the submitted code Current API/server load Selected Gemini model
Short programs generally receive responses faster than large programs.
DECODE currently has some limitations:
Requires an internet connection AI analysis depends on the Gemini API. Requires a valid Gemini API key Without an API key, AI-powered analysis cannot be performed. API usage limits Free Gemini API usage is subject to Google's current rate limits and quotas. Limits may vary depending on the selected model and account. AI-generated explanations Explanations are generated by an AI model and may occasionally contain mistakes. Very large programs Extremely large code inputs may take longer to process or may exceed model input limits. Programming language support Analysis quality depends on the selected language and the Gemini model's ability to understand that language. Response speed The application may appear slow when the Gemini API takes longer to respond.
- Clone the repository git clone https://github.com/TSsanjayy/Decode.git
- Open the project cd Decode
- Create a virtual environment python -m venv venv
- Activate the virtual environment
Windows:
venv\Scripts\activate 5. Install dependencies pip install -r requirements.txt 6. Add your Gemini API key
Create a .env file:
GEMINI_API_KEY=your_api_key_here 7. Run the application streamlit run app.py
The application will open in your browser.
DECODE can be deployed using Streamlit Community Cloud.
The application is connected to the GitHub repository and uses requirements.txt to install the required Python packages.
For deployment, the Gemini API key should be added through the application's deployment secrets/settings rather than being uploaded to GitHub.
The main objective of DECODE is to make programming easier for beginners by transforming complicated source code into simple, understandable explanations.
Instead of only showing the final output of a program, DECODE focuses on explaining:
What the code does Why each section is present How the logic works Which functions and variables are important How efficient the algorithm is
Possible future improvements include:
🌐 Support for more programming languages 📈 Improved complexity analysis 🐞 More advanced error detection 📝 Automatic code documentation 💬 Improved AI chat-based code tutoring 📊 Visual representation of algorithms ⚡ Faster response processing 🔄 Multiple AI model support 📥 Export analysis as PDF or document