Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/daily-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Drop, Create, and Backfill Database Tables
working-directory: notebooks
working-directory: database/setup
env:
DB_HOSTNAME: ${{ secrets.DB_HOSTNAME }}
DB_USER: ${{ secrets.DB_USER }}
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/run-python-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,28 @@ jobs:
echo "Using current date: $CURRENT_DATE"
echo "date=$CURRENT_DATE" >> $GITHUB_OUTPUT
fi
- name: Run Portfolio.py Script
run: python Portfolio.py ${{ matrix.fund }}
- name: Run PerformanceTracker.py Script
run: python PerformanceTracker.py ${{ matrix.fund }}
# - name: Run portfolio_csv_builder.py Script
# run: python portfolio_csv_builder.py ${{ matrix.fund }}
# - name: Run generate_performance_reports.py Script
# run: python generate_performance_reports.py ${{ matrix.fund }}
# Disabled Frontier Analysis due to yfinance rate limiting
# - name: Run Frontier Analysis.py Script
# run: python FrontierAnalysis.py ${{ matrix.fund }}
- name: Run Performance.py Script
if: ${{ github.ref == 'refs/heads/main' }}
env:
DB_HOSTNAME: ${{ secrets.DB_HOSTNAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_PORT: ${{ secrets.DB_PORT }}
run: python Performance.py ${{ matrix.fund }} ${{ steps.determine_date.outputs.date }}
- name: Upload Output Files to Main Branch
if: ${{ github.ref == 'refs/heads/main' }}
uses: EndBug/add-and-commit@v9
with:
pull: '--rebase --autostash' # Pull latest changes before committing (since matrix is used)
add: 'data/${{ matrix.fund }}/**'
message: "Actions daily upload data for ${{ matrix.fund }} on ${{ steps.determine_date.outputs.date }}"
default_author: github_actor
committer_name: GitHub Actions
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
# - name: Run Performance.py Script
# if: ${{ github.ref == 'refs/heads/main' }}
# env:
# DB_HOSTNAME: ${{ secrets.DB_HOSTNAME }}
# DB_USER: ${{ secrets.DB_USER }}
# DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
# DB_PORT: ${{ secrets.DB_PORT }}
# run: python Performance.py ${{ matrix.fund }} ${{ steps.determine_date.outputs.date }}
# - name: Upload Output Files to Main Branch
# if: ${{ github.ref == 'refs/heads/main' }}
# uses: EndBug/add-and-commit@v9
# with:
# pull: '--rebase --autostash' # Pull latest changes before committing (since matrix is used)
# add: 'data/${{ matrix.fund }}/**'
# message: "Actions daily upload data for ${{ matrix.fund }} on ${{ steps.determine_date.outputs.date }}"
# default_author: github_actor
# committer_name: GitHub Actions
# committer_email: 41898282+github-actions[bot]@users.noreply.github.com
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
env
venv
__pycache__
.vscode/
.vscode/
legacy/data/
*.csv
139 changes: 0 additions & 139 deletions DBUtils.py

This file was deleted.

71 changes: 0 additions & 71 deletions MetricCalculator.py

This file was deleted.

9 changes: 0 additions & 9 deletions Trade.py

This file was deleted.

26 changes: 26 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from flask import Flask
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import os
from dotenv import load_dotenv

db = SQLAlchemy()
migrate = Migrate()

def create_app():
app = Flask(__name__)

# Database config
app.config['SQLALCHEMY_DATABASE_URI'] = f"mysql://{os.getenv('DB_USER')}:{os.getenv('DB_PASSWORD')}@{os.getenv('DB_HOSTNAME')}:{os.getenv('DB_PORT')}/Fund"

# Initialize extensions
db.init_app(app)
migrate.init_app(app, db)

# Register blueprints
from .api.routes import health_bp, holdings_bp
app.register_blueprint(health_bp)
app.register_blueprint(holdings_bp)

return app
2 changes: 1 addition & 1 deletion api/APIdocs.txt → app/api/APIdocs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HTTPS Cert:

sudo certbot --nginx -d api.degrootefinance.com

systemd for continuous uptime:
systemid for continuous uptime:

sudo nano /etc/systemd/system/fund-monitor-api.service

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions api/api_app.py → app/api/api_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import yaml

from health_routes import health_bp
from holdings_routes import holdings_bp
from api.routes.health_routes import health_bp
from api.routes.holdings_routes import holdings_bp

load_dotenv()

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import yaml
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from utils.db_utils import get_db_connection
from database.connection import get_db_connection

holdings_bp = Blueprint('holdings', __name__)

Expand Down
4 changes: 4 additions & 0 deletions app/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .auth_service import generate_session, session_exists, verify_password
from ...database.connection import get_db_connection

__all__ = ["generate_session", "session_exists", "verify_password", "get_db_connection"]
2 changes: 1 addition & 1 deletion utils/login_utils.py → app/auth/auth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from dotenv import load_dotenv

from utils.db_utils import get_db_connection
from database.connection import get_db_connection

load_dotenv()

Expand Down
Loading
Loading