This project provides tools for financial data analysis using the Financial Modeling Prep API. The main notebook demonstrates how to fetch and analyze financial data such as market capitalization, financial ratios, earnings, and dividends for a given stock ticker. The notebook also provides a simple implementation of Benjamin Graham’s criteria for defensive investors, which can be used to identify potentially undervalued stocks.
.
├── api_utils.py # API utility functions for fetching financial data
├── main.ipynb # Main Jupyter notebook for data analysis
├── .gitignore # Git ignore file
└── README.md # Project README file
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your API key:
- Create a
.env
file in the project root directory. - Add your Financial Modeling Prep API key to the
.env
file:API_KEY=your_api_key_here
- Create a
-
Start Jupyter Notebook:
jupyter notebook
-
Open
main.ipynb
in the Jupyter interface. -
Follow the instructions in the notebook to fetch and analyze financial data.
This project is licensed under the MIT License. See the LICENSE
file for more details.