CoolFace
Apppublic

drumilpatel/cftc-dashboard

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

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 definition
  • data_fetcher.py: Functions for fetching data from CFTC website
  • data_parser.py: Functions for parsing raw text data
  • data_processor.py: Functions for processing and transforming parsed data
  • visualizations.py: Functions for creating charts and visualizations

Requirements

  • Python 3.7+
  • Required packages: streamlit, requests, beautifulsoup4, pandas, plotly

Installation

  1. 1.Clone the repository
  2. 2.Install dependencies:
   pip install -r requirements.txt

Usage

  1. 1.Start the Streamlit app:
   streamlit run main.py
  1. 1.Open your browser to the URL displayed in the terminal (typically http://localhost:8501)
  2. 2.Use the sidebar to search and select commodities
  3. 3.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