MCPcopy Index your code
hub / github.com/brad-darksbian/commodities-dashboard

github.com/brad-darksbian/commodities-dashboard @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
40 symbols 54 edges 4 files 0 documented · 0% updated 4y ago★ 91
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

commodities-dashboard

A simple dashboard to view commodities position data based on CFTC reports.

This system is configured to pull one or multiple years of reports from the government website and process them into a consolidated view of several useful chart types. I regualrly use this for my own analytics work so the repository will update as needs change. However, I am treating this mostly as a teaching tool, so I will endeavor to keep the code clean and approachable by any skill level.

Within the code, you will find a number of examples of various plotly chart types with ways to lay them out and call them. Addtionally, there are several examples of Dash configuration such as various call backs and other elements that provide decent examples into the system. Some of the examples include:

  • Basic construction of a Dash application
  • Bootstrap components
  • Drop Down lists
  • Range Sliders
  • 3D Plots
  • Line and Bar charts
  • Layout configurations
  • Call backs for dynamic updates
  • Modals and associated call backs
  • Data Processing
  • Retreiving online data files
  • Processing files in a dataframe

This is a python project using Dash and plotly to contextualize the content of the DEACOT and Disaggregation reports on futures trading activity provided weekly by the CFTC.

Details about these reports can be found at: https://www.cftc.gov/MarketReports/CommitmentsofTraders/index.htm

To use:

  1. Download the files in the repository to a directory.
  2. In the support_functions.py file, ensure your paths are correct.

NOTE - I developed this on a Mac and run it on a Linux machine. Files are set to reside in /tmp. Windows users will need to set an appropriate path.

  1. Review the requirements.txt and make sure all libraries are installed. These are relatively minimal and easily obtained.
  2. Run the main.py file using 'python /path/to/directory/main.py'
  3. Navigate your browser to the ip address of the machine (perhaps 127.0.0.1 or other if installed remotely) on port 8050.
  4. Enjoy!

Use the code how you please. If you use it as a basis for your own project, be cool and give me a shout out.

Any questions, comments, or concerns - create an issue or just shoot me an email brad@darksbian.com

Brad

Addendum - Some users have pointed out to me that when running this code on OSX, you can sometimes get an error like "[SSL: CERTIFICATE_VERIFY_FAILED]".

This is a known issue with python >=3.6 and OSX. The fix is simple and outlined here: https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error

Core symbols most depended-on inside this repo

get_COT
called by 2
support_functions.py
process_reports
called by 2
support_functions.py
display_page
called by 0
main.py
toggle_modal
called by 0
main.py
deacot_sentiment
called by 0
main.py
all_positions_da
called by 0
main.py
net_positions_actual_da
called by 0
main.py
net_positions_pct_da
called by 0
main.py

Shape

Function 28
Route 12

Languages

Python100%

Modules by API surface

main.py24 symbols
support_functions.py16 symbols

For agents

$ claude mcp add commodities-dashboard \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact