drumilpatel/cftc-dashboard
0
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
CFTC Commitments of Traders Viewer
A Streamlit application to explore and visualize CFTC Commitments of Traders (COT) reports for futures markets.
Overview
This application fetches, parses, and visualizes the CFTC's weekly Commitments of Traders reports, specifically focusing on the "Long Report - Other (Combined)" format. The app provides an interactive interface to:
- Browse commodities across different exchanges
- Search for specific commodities
- Visualize market positions and concentration
- Examine detailed data tables
- Track changes from previous reports
Features
- Live Data: Fetches current data directly from the CFTC website
- Interactive Filtering: Search and filter by commodity name or exchange
- Comprehensive Visualizations:
- Net positions by trader category
- Market composition pie charts
- Market concentration analysis
- Detailed data tables
- Debug Mode: Optional debugging tools for development
Project Structure
The project is organized into modular components:
main.py: Main application entry point and UI definitiondata_fetcher.py: Functions for fetching data from CFTC websitedata_parser.py: Functions for parsing raw text datadata_processor.py: Functions for processing and transforming parsed datavisualizations.py: Functions for creating charts and visualizations
Requirements
- Python 3.7+
- Required packages: streamlit, requests, beautifulsoup4, pandas, plotly
Installation
- Clone the repository
- Install dependencies:
pip install -r requirements.txtUsage
- Start the Streamlit app:
streamlit run main.py- Open your browser to the URL displayed in the terminal (typically http://localhost:8501)
- Use the sidebar to search and select commodities
- Explore the different tabs to view visualizations and data tables
Data Sources
This application uses data from the U.S. Commodity Futures Trading Commission (CFTC):
License
MIT License
