Skip to content

Commit 75eb2c2

Browse files
committed
Initial commit
1 parent 1eca582 commit 75eb2c2

22 files changed

Lines changed: 1373 additions & 0 deletions

.dockerignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Python
6+
__pycache__
7+
*.pyc
8+
*.pyo
9+
*.pyd
10+
.Python
11+
env
12+
venv
13+
pip-log.txt
14+
pip-delete-this-directory.txt
15+
.tox
16+
.coverage
17+
.coverage.*
18+
.cache
19+
nosetests.xml
20+
coverage.xml
21+
*.cover
22+
*.log
23+
.mypy_cache
24+
.pytest_cache
25+
.hypothesis
26+
27+
# Environments
28+
.env
29+
.venv
30+
env/
31+
venv/
32+
ENV/
33+
34+
# IDEs
35+
.vscode
36+
.idea
37+
38+
# OS generated files
39+
.DS_Store
40+
.DS_Store?
41+
._*
42+
.Spotlight-V100
43+
.Trashes
44+
ehthumbs.db
45+
Thumbs.db
46+
47+
# Project specific
48+
tests/
49+
*.md
50+
LICENSE
51+
.github/
52+
docker-compose.yml
53+
54+
# DuckDB
55+
*.duckdb
56+
57+
# Jupyter Notebook
58+
.ipynb_checkpoints
59+
60+
# uv specific
61+
.uv/

.github/workflows/ci_cd.yml

Whitespace-only changes.

.gitignore

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Environment variables
24+
.env
25+
.venv
26+
venv/
27+
env/
28+
ENV/
29+
30+
# IDEs and editors
31+
.idea/
32+
.vscode/
33+
*.swp
34+
*.swo
35+
*~
36+
37+
# Operating System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
# Jupyter Notebook
42+
.ipynb_checkpoints
43+
44+
# pytest
45+
.pytest_cache/
46+
47+
# Coverage reports
48+
htmlcov/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
53+
# Logs
54+
*.log
55+
56+
# uv specific
57+
.uv/
58+
59+
# DuckDB
60+
*.duckdb

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Dockerfile

Whitespace-only changes.

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Stock Valuation Dashboard
2+
3+
## Overview
4+
5+
This project is a web-based stock valuation dashboard that helps investors analyze dividend growth stocks. It provides insights into stock quality and valuation based on historical financial data.
6+
7+
Key features:
8+
- Fetches financial data from Financial Modeling Prep API
9+
- Calculates growth rates for revenue, dividends, cash flow, and other metrics
10+
- Determines if a stock is a quality dividend growth stock
11+
- Assesses whether a stock is undervalued or reasonably valued
12+
- Visualizes key metrics and growth rates
13+
14+
## Tech Stack
15+
16+
- Python 3.11+
17+
- FastAPI: Web framework for building APIs
18+
- Dash: React-based framework for building analytical web applications
19+
- Polars: Fast DataFrame library for data manipulation
20+
- Pydantic: Data validation using Python type annotations
21+
- PyArrow: Efficient data interchange format
22+
- DuckDB: Embedded analytical database
23+
- uv: Python packaging and dependency management tool
24+
- Docker: Containerization
25+
- GitHub Actions: CI/CD pipeline
26+
27+
## Project Structure
28+
29+
stock_valuation_app/
30+
├── .github/workflows/ # CI/CD configuration
31+
├── src/
32+
│ └── stock_valuation_app/
33+
│ ├── api/ # FastAPI routes
34+
│ ├── data/ # Data fetching and processing
35+
│ ├── models/ # Pydantic models
36+
│ ├── services/ # Business logic
37+
│ └── ui/ # Dash dashboard
38+
├── tests/ # Unit and integration tests
39+
├── Dockerfile
40+
├── docker-compose.yml
41+
├── pyproject.toml # Project metadata and dependencies
42+
├── README.md
43+
└── uv.lock # Dependency lock file
44+
45+
46+
47+
## Setup and Installation
48+
49+
1. Clone the repository:
50+
git clone https://github.com/dimtics/stock_valuation_app.git
51+
cd stock_valuation_app
52+
53+
2. Install uv and project dependencies:
54+
pip install uv
55+
uv pip install -e .
56+
57+
3. Set up environment variables:
58+
Create a `.env` file in the project root and add your Financial Modeling Prep API key:
59+
FMP_API_KEY=your_api_key_here
60+
61+
4. Run the application:
62+
uvicorn stock_valuation_app:app --reload
63+
64+
5. Open your browser and navigate to `http://localhost:8000/dashboard` to view the dashboard.
65+
66+
67+
## Docker Deployment
68+
69+
To run the application using Docker:
70+
71+
1. Build the Docker image:
72+
docker build -t stock-valuation-app .
73+
docker run -p 8000:8000 -e FMP_API_KEY=your_api_key_here stock-valuation-app
74+
75+
Alternatively, use Docker Compose:
76+
docker-compose up
77+
78+
79+
80+
## Usage
81+
82+
1. Enter a stock symbol in the input field on the dashboard.
83+
2. Click the "Analyze" button to fetch and analyze the stock data.
84+
3. View the growth rates, quality assessment, and valuation results.
85+
86+
## Contributing
87+
88+
Contributions are welcome! Please feel free to submit a Pull Request.
89+
90+
## License
91+
92+
This project is licensed under the MIT License - see the LICENSE file for details.

config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
api:
2+
base_url: "https://financialmodelingprep.com/api/v3"
3+
4+
valuation:
5+
default_pe_ratio: 15
6+
quality_threshold:
7+
revenue_growth: 0.05
8+
dividend_growth: 0.05
9+
10+
dashboard:
11+
refresh_interval: 300 # in seconds
12+
13+
database:
14+
type: "duckdb"
15+
file: "stock_data.duckdb"
16+
17+
logging:
18+
level: "INFO"
19+
file: "app.log"

docker-compose.yml

Whitespace-only changes.

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[project]
2+
name = "stock-valuation-app"
3+
version = "0.1.0"
4+
description = "A single-page web app displaying stock data, growth charts, and valuation insights."
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Dimeji Salau", email = "dimejisalau@protonmail.com" }
8+
]
9+
requires-python = ">=3.12"
10+
dependencies = [
11+
"dash>=2.18.2",
12+
"duckdb>=1.1.3",
13+
"fastapi>=0.115.4",
14+
"httpx>=0.27.2",
15+
"polars>=1.12.0",
16+
"pyarrow>=18.0.0",
17+
"pydantic>=2.9.2",
18+
]
19+
20+
[project.scripts]
21+
stock-valuation-app = "stock_valuation_app:main"
22+
23+
[build-system]
24+
requires = ["hatchling"]
25+
build-backend = "hatchling.build"
26+
27+
[dependency-groups]
28+
dev = [
29+
"ipykernel>=6.29.5",
30+
"mypy>=1.13.0",
31+
"pytest>=8.3.3",
32+
"ruff>=0.7.3",
33+
]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main() -> None:
2+
print("Hello from stock-valuation-app!")

0 commit comments

Comments
 (0)