explaingit

alwank/etfray

2PythonAudience · developerComplexity · 3/5ActiveLicenseSetup · moderate

TLDR

Terminal app that researches ETFs from SEC filings and checks your live Interactive Brokers portfolio, with local SQLite cache and CSV export.

Mindmap

mindmap
  root((etfray))
    Inputs
      ETF ticker
      IB Gateway
      SEC filings
    Outputs
      Holdings tables
      Margin warnings
      CSV export
    Use Cases
      Research ETFs
      Track portfolio
      Check margin
    Tech Stack
      Python
      Textual
      SQLite

Things people build with this

USE CASE 1

Look up an ETF by ticker and page through its holdings, sectors, and fees

USE CASE 2

Connect to a local TWS or IB Gateway and watch live positions in a terminal

USE CASE 3

Get an alert when your IB margin cushion drops below a safe level

USE CASE 4

Export the current view as CSV or JSON for a spreadsheet

Tech stack

PythonTextualSQLite

Getting it running

Difficulty · moderate Time to first run · 30min

Needs Python 3.11 plus a running TWS or IB Gateway on the same machine for portfolio features.

MIT license, so you can use, modify, and redistribute it freely as long as you keep the copyright notice.

In plain English

etfray is a small program you run in a terminal window to research ETFs and check the state of your investment portfolio. An ETF is a fund that holds a basket of other assets, and the tool pulls the underlying holdings of those funds directly from filings published by the United States Securities and Exchange Commission, the official regulator. The data is free and public, so you do not need a paid data subscription to use the app. The research side lets you search for an ETF by ticker, then page through tabs that show its holdings, sector and country exposure, fee information, and concentration figures such as how much of the fund sits in its top 10 or top 50 positions. The portfolio side talks to a piece of software from Interactive Brokers called TWS or IB Gateway, which has to be running on the same machine, to read your live positions and warn you if your margin cushion is thin. Everything runs locally. Your account credentials never travel to a third party, and fetched data is cached in a SQLite file in your home directory so the app keeps working offline after the first download. There is also an export button that writes the current view to a CSV or JSON file for use in a spreadsheet or another tool. The interface is built with a Python library called Textual that draws menus, tables, and tabs inside the terminal, and it is designed for people who prefer keyboard shortcuts over a mouse. Installation is a single pip command, Python 3.11 or newer is required, and the project is released under the permissive MIT license.

Copy-paste prompts

Prompt 1
Install etfray with pip and search for SPY to see its top 50 holdings
Prompt 2
Show me how to wire TWS to etfray so it reads my paper trading account
Prompt 3
Add a new tab that shows year-over-year expense ratio history for an ETF
Prompt 4
Help me write a query against the local SQLite cache to compare two ETFs by sector exposure
Prompt 5
Walk me through the Textual layout code so I can add a new keyboard shortcut
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.