edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

Feature Request: ETF Series Search

Open kalavrcom opened this issue 1 year ago • 4 comments

I really appreciate the functionality to search for the ETF fund issuer via the ETF symbol. However, I haven't been able to find a way to locate the series of the specific ETF symbol once I have the NPORT-P downloaded -- the only way has been to either manually locate the series.

Sample code:

ticker = 'GRID' # First Trust NASDAQ® Clean Edge® Smart Grid Infrastructure Index Fund
ff = funds.Fund(ticker).get_filings(form="NPORT-P", year=[2025])

This gives the following list of NPORT-P forms for the year 2025, each of which corresponds to a series that the issuer (in this case, First Trust) manages.

Image

The annoyance is that while I have been able to search for the specific series (in this case, GRID is series number 2), I was hoping that there was a way to return the series for the specific ETF symbol I originally referenced from the funds.Fund().get_filings() method.

kalavrcom avatar Aug 29 '25 10:08 kalavrcom

Thanks for this excellent feature request! You've identified a real gap in the current ETF/mutual fund workflow that would significantly improve the user experience.

Problem Understanding

You're absolutely right - when you search for an ETF like GRID and get NPORT-P filings, there's currently no programmatic way to identify which series in the filing list corresponds to your original ticker. Having to manually identify that GRID = series 2 defeats the purpose of automation.

Current State Analysis

I've examined the current architecture and confirmed that:

  1. ✅ Ticker Resolution Works: funds.Fund('GRID') successfully resolves to First Trust (the fund company)
  2. ✅ NPORT-P Retrieval Works: get_filings(form="NPORT-P") returns all filings from the company
  3. ❌ Series Mapping Missing: No connection between your original 'GRID' ticker and which specific series it represents
  4. ✅ Data Available: The SEC provides ticker-to-series mappings via their mutual fund ticker API that we already use

Planned Solution Approach

The fix involves three key enhancements:

1. Smart Ticker Resolution

When you call Fund('GRID'), the system will:

  • Resolve 'GRID' to its specific series ID (S000071967 in this case)
  • Maintain context that you're interested in that specific series
  • Still provide access to the full fund company hierarchy

2. Series-Aware Filing Retrieval

New optional parameter for targeted filing retrieval:

fund = funds.Fund('GRID')

# Get all NPORT-P filings (current behavior, unchanged)
all_filings = fund.get_filings(form="NPORT-P", year=[2025])

# NEW: Get only filings for GRID's specific series
grid_filings = fund.get_filings(form="NPORT-P", year=[2025], series_only=True)

3. Series Discovery Methods

New methods to explore the ticker-series relationship:

fund = funds.Fund('GRID')

# Get the specific series for your ticker
grid_series = fund.get_series()  # Returns FundSeries for GRID
print(f"GRID corresponds to: {grid_series.name} [{grid_series.series_id}]")

# Still get all series for the fund company if needed
all_series = fund.list_series()  # All series managed by First Trust

Implementation Plan

This will be implemented in phases to ensure stability:

  1. Phase 1: Core ticker-to-series resolution infrastructure
  2. Phase 2: Enhanced filing filtering with series context
  3. Phase 3: User-friendly APIs and error handling
  4. Phase 4: Performance optimization and edge case handling

Backward Compatibility

All existing code will continue to work unchanged. New features are additive with optional parameters that default to current behavior.

Timeline

This is a substantial enhancement that touches several core components. I estimate 1-2 weeks for full implementation including comprehensive testing across different fund companies and edge cases.

Would you be interested in testing early versions as they become available? Also, are there any specific fund companies or tickers beyond GRID that you work with regularly that should be included in testing?

dgunning avatar Sep 05 '25 19:09 dgunning

I would absolutely be interested in testing any early versions!

Specific funds and tickers we're working with regularly at the moment that could be used in the test covering 6 funds could be:

iShares - ARTY (originally named IROB but renamed so good test), IXC, IDRV, SOXX, IBB VanEck - SMH, PPH First Trust - GRID, FAN SPDR - XAR, XBI, XLE Global X - BOTZ Investco - TAN, FAN

kalavrcom avatar Sep 09 '25 15:09 kalavrcom

🎉 Feature Implementation Complete!

Great news! FEAT-417 has been fully implemented and committed to the etf-features branch. Your request for ETF series search functionality is now working perfectly!

What's Been Implemented

Fund("GRID") Series Resolution: The system now automatically resolves GRID to its specific series with full context. When you call Fund("GRID").get_filings(form="NPORT-P"), it will:

  • Automatically identify the correct series (series number 2 for GRID)
  • Return filings specific to that ETF series
  • Provide full context about which series matches your ticker

Bonus Enhancement: ETF Company Fallback

As an additional improvement, we've added ETF company fallback support that makes popular ETFs work seamlessly:

  • Popular ETFs like SPY, QQQ now work perfectly via Fund("SPY")
  • Automatic resolution when direct ticker lookup doesn't find the ETF
  • Falls back to company-level search and resolves to the correct fund

Implementation Details

  • 100% backward compatibility maintained - existing code continues to work
  • Enhanced ETF support with intelligent series matching
  • Comprehensive test coverage with 40+ new tests
  • Robust error handling for edge cases

Testing the Features

The implementation will be included in a release in a couple of days. If you want early access to test these features:

git checkout etf-features
pip install -e .

Then you can test:

from edgar import Fund

# This now works perfectly - resolves to correct series
ticker = 'GRID'
fund = Fund(ticker)
filings = fund.get_filings(form="NPORT-P", year=[2025])

# Popular ETFs also work seamlessly now
spy = Fund("SPY") 
qqq = Fund("QQQ")

Thanks for the excellent feature request! The implementation addresses exactly what you needed.

dgunning avatar Sep 26 '25 03:09 dgunning

✅ COMPLETED in EdgarTools v4.15.0

This feature has been successfully implemented and released! 🎉

🚀 What's Available Now

  • Enhanced Fund class with ticker-to-series resolution
  • fund.get_series() method for ticker-specific series identification
  • fund.get_resolution_diagnostics() for troubleshooting
  • Smart ETF fallback for popular ETFs (SPY, QQQ) via company ticker resolution

📦 Installation

pip install edgartools==4.15.0

🔧 Usage Example

from edgar.funds import Fund

# ETF series resolution now works seamlessly
spy_fund = Fund("SPY")  # Now works perfectly!
series = spy_fund.get_series()  # Get ticker-specific series
diagnostics = spy_fund.get_resolution_diagnostics()  # See resolution method

📝 Documentation

  • Full implementation details in CHANGELOG.md
  • Complete feature documentation in completed-features archive
  • GitHub release notes: https://github.com/dgunning/edgartools/releases/tag/v4.15.0

Thank you for the feature request! This enhancement significantly improves ETF analysis workflows in EdgarTools.

dgunning avatar Sep 26 '25 18:09 dgunning