This repository contains my Forage project submission, split into two parts:
- Task 1: EDGAR data analysis in Jupyter Notebook
- Task 2: FastAPI-based financial chatbot using predefined query-response mapping
- Forage Completion Certificate (PDF): View Certificate
Task 1/:- Financial analysis notebook
- Raw extracted data files (CSV/XLSX)
Task 2/:- Chatbot API code
- Query-response JSON file
- Tests
- Documentation and test results
requirements.txt:- Python dependencies for running and testing
Task 1 is the financial data analysis part of the project. It analyzes EDGAR extracted data for selected companies and summarizes key financial metrics and trends.
- Notebook:
Task 1/edgar_data_analysis.ipynb - Data file (CSV):
Task 1/data/EDGAR Entity Extracted Data.csv
Task 2 is the implementation part where the predefined financial Q&A chatbot is built. The chatbot reads supported queries from JSON and returns mapped responses through an API.
- Main API file:
Task 2/main.py - Query/response mapping:
Task 2/chatbot_responses.json - Tests:
Task 2/tests/test_main.py - Task documentation:
Task 2/chatbot_documentation.md - Test output:
Task 2/test_results.txt
- Create and activate a virtual environment:
python -m venv .venvWindows PowerShell:
.venv\Scripts\Activate.ps1- Install dependencies:
pip install -r requirements.txt- Run the FastAPI app:
uvicorn "Task 2.main:app" --reload- Open in browser:
- Swagger docs:
http://127.0.0.1:8000/docs - Health check:
http://127.0.0.1:8000/test
Run automated tests:
python -m pytest "Task 2/tests/test_main.py" -qPOST /chat with JSON body:
{
"message": "what is the total revenue in 2025 (all companies combined)?"
}Example response:
{
"response": "Total revenue in 2025 is $792,712,000,000."
}This project is licensed under the MIT License.
