A comprehensive crypto analytics platform for monitoring asset health, liquidity risk, and investor behavior analysis with an interactive Streamlit dashboard.
- A streamlit application (MainApp) is included to make the whole process of downloading, querying and visualizing more simple.
- The final report can be read in REPORT.md with insights from the generated visualizations.
- Visualizations used in the report are the ones coming from the 03_eda_analysis.py file. The interactive visualizations inside the streamlit app are just added as a plus... might be buggy.
- Python = 3.12.11
- uv package manager
-
Clone the repository
git clone https://github.com/irenedecesare/Fintech_project.git cd Fintech_project -
Install dependencies
# Using uv uv venv --python python3.12 ./venv/Scripts/activate uv sync uv pip install streamlit uv pip install plotly
Install errors 'uv sync' should automatically download all required packages. If it does not, probably it is missing STREAMLIT and PLOTLY. Just add them.
The main application provides a user-friendly web interface to run the complete analytics pipeline. Press each botton in sequence to:
- Download data
- Perform SQL queries on downloaded data, and calculate metrics
- Generate visualizations
The application also allow the user to real-time monitor and play with interactive visualizations (only after the second button is activated).
First activate the venv
.venv/Scripts/activate# Using uv
uv run streamlit run MainApp.py
# On Windows, you can also double-click run_app.batThe dashboard will open in your browser at http://localhost:8501
- π ETL Pipeline: Extract crypto data from CoinMetrics and load into database
- π SQL Queries: Perform analytical queries on the loaded data
- π EDA Analysis: Generate exploratory data analysis and visualizations
- Live Logs: Real-time log capture and display during process execution
- Status Indicators: Visual status showing "Running", "Completed", or "Ready"
- Auto-Refresh: Automatic log updates during execution
- ποΈ Database Tab: View database tables and preview raw data
- π Analytics Data Tab: Browse CSV files organized by category
- π Visualizations Tab: Interactive charts and graphs
- Extracts crypto data from CoinMetrics GitHub repository
- Transforms and cleans the data
- Loads data into SQLite database
- Supports multiple crypto assets (configurable)
- Performs analytical queries on the crypto data
- Calculates moving averages, volatility, and lag features
- Generates aggregated statistics
- Exports results to CSV files for visualization
- Creates comprehensive visualizations
- Generates reports on asset health and investor behavior
- Saves charts and plots to the data directory
Fintech_project/
βββ MainApp.py # Streamlit dashboard
βββ run_app.bat # Windows batch file for easy launching
βββ etl/
β βββ 01_etl_pipeline.py # ETL pipeline
βββ sql/
β βββ 02_sql_queries.py # SQL analytics
βββ analysis/
β βββ 03_eda_analysis.py # EDA and visualizations
βββ utils/
β βββ config.py # Configuration settings
βββ data/ # Processed data and outputs
β βββ csv/ # CSV analytics files
β βββ eda/ # Generated visualizations
β βββ finbankiq_analytics.db # SQLite database
βββ logs/ # Generated log files
βββ requirements.txt # Python dependencies
-
Activate the virtual environment:
.venv/Scripts/activate
-
Start the Streamlit app:
uv run streamlit run MainApp.py
-
Run ETL Pipeline:
- Click "π Run ETL Pipeline" button
- Monitor progress in the Live Logs section
- Wait for completion status
-
Run SQL Queries:
- Click "π Run SQL Queries" button
- This generates CSV files with analytics data
- Wait for completion status
-
Run EDA Analysis :
- Click "π Run EDA Analysis" button
- Generates visualizations as png files in data/eda
- Generated plots are used in the REPORT.md
-
Explore Data via Streamlit (Optional):
- Go to "π Data Preview" section
- Use the three tabs to explore different data views
-
Create Visualizations via Streamlit (Optional):
- In the "π Visualizations" tab
- Select CSV files from the dropdown
- Choose metrics to visualize
- View interactive charts
- Time Series Plots: Show trends over time
- Multi-Metric Charts: Compare different metrics simultaneously
- Custom Selections: Choose which metrics to visualize
- Responsive Design: Adapts to different screen sizes
The system automatically categorizes CSV files into:
- Moving Averages: Price and activity moving averages
- Lag & Volatility: Lag features and volatility analysis
- Rolling Deltas: Delta calculations and trends
- File Selector: Choose any CSV file to visualize
- Metric Multi-Select: Select specific metrics to plot
- Data Information: Shows file stats, date range, memory usage
- Summary Statistics: Statistical overview of key metrics
- Real-time capture of process output
- Timestamped entries for easy tracking
- Auto-refresh during execution
- Manual refresh button available
- Persistent log storage in
logs/directory - Separate logs for each module:
etl_pipeline.logSQL_queries.logeda_analysis.log
- Browse historical logs in the dashboard
- Select different log files to view
- Full log content display
- Location:
data/finbankiq_analytics.db - Format: SQLite database
- Content: Raw crypto metrics data
- Tables: One table per crypto asset
- Location:
data/csv/ - Types: Moving averages, lag/volatility, rolling deltas
- Format: Time-series data with calculated metrics
- Usage: Input for visualizations and further analysis
- Location:
data/eda/ - Types: Charts, plots, statistical summaries
- Format: PNG, PDF, and interactive HTML files
- Content: EDA analysis results and insights
- Location:
logs/ - Types: Process execution logs
- Format: Text files with timestamps
- Content: Detailed execution information
# ETL Pipeline
python etl/01_etl_pipeline.py
# SQL Queries
python sql/02_sql_queries.py
# EDA Analysis
python analysis/03_eda_analysis.pyEdit utils/config.py to modify:
- Target crypto assets: Add/remove assets to analyze
- Data sources: Change data repository URLs
- Analysis parameters: Adjust moving average windows, volatility periods
- Output directories: Customize where files are saved
# Assets to analyze
target_assets: List[str] = ['btc'] # Add 'eth', 'ada', etc.
# Lookback period (days)
lookback_days: int = 365 * 2 # 2 years of data
# Moving average windows
win_avg = [7, 30, 90] # 7-day, 30-day, 90-day averages
# Volatility window
vol_window = 30 # 30-day volatility calculation
# Lag window
lag = 1 #1 day lag
# Window (days) to check anomalies in data
cons_window = 7-
Streamlit not found:
uv pip install streamlit
-
Database not found:
- Run the ETL Pipeline first
- Check if
data/directory exists
-
No CSV files for visualization:
- Run SQL Queries first
- Check if
data/csv/directory exists
-
Process stuck in "Running" state:
- Refresh the page
- Check the log files for errors
- Restart the Streamlit app
-
Large datasets:
- Reduce
lookback_daysin config - Use fewer assets in
target_assets
- Reduce
-
Memory usage:
- Close unused browser tabs
- Restart Streamlit app periodically
-
Visualization performance:
- Select fewer metrics at once
- Use shorter date ranges
- pandas>=2.0.0: Data manipulation and analysis
- numpy>=1.24.0: Numerical computing
- sqlalchemy>=2.0.0: Database operations
- requests>=2.28.0: HTTP requests for data fetching
- matplotlib>=3.6.0: Static plotting
- seaborn>=0.12.0: Statistical visualizations
- plotly>=5.15.0: Interactive charts
- streamlit>=1.28.0: Dashboard framework
- Fork the repository
- Create a feature branch
- Make your changes
- Test with the Streamlit dashboard
- Submit a pull request
For issues and questions:
- Check the log files in
logs/directory - Review the configuration in
utils/config.py - Ensure all dependencies are installed
- Check the troubleshooting section above