agentsclimarketplace

Run3 get fund holdings

Skill cxcscmu/SkillLearnBench/skills/b3-teacher-feedback-claude-sonnet-4-6/financial-analysis/run3_get-fund-holdings

Load the INFOTABLE (holdings) parquet for a given quarter and filter by accession_number to get a specific fund's holdings. Handles column name variations. Use this after obtaining an accession_number from the coverpage.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run3_get-fund-holdings

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.8 KB, 407 tokens by cl100k_base, as published. Nobody here has run it

Load Fund Holdings from INFOTABLE

import pandas as pd
from pathlib import Path

def load_infotable(quarter: str) -> pd.DataFrame:
    """Load INFOTABLE parquet for a given quarter ('q2' or 'q3')"""
    base = Path(f"/root/2025-{quarter}")
    for fname in ["INFOTABLE.parquet", "infotable.parquet", "INFOTABLE.csv", "infotable.csv"]:
        fpath = base / fname
        if fpath.exists():
            if fname.endswith(".parquet"):
                return pd.read_parquet(fpath)
            else:
                return pd.read_csv(fpath)
    files = list(base.iterdir())
    print(f"Files in {base}: {files}")
    raise FileNotFoundError(f"No INFOTABLE file found in {base}")

def get_fund_holdings(quarter: str, accession_number: str) -> pd.DataFrame:
    """
    Get holdings for a specific fund by accession_number.
    Returns filtered DataFrame with all holdings rows.
    """
    df = load_infotable(quarter)
    print(f"INFOTABLE columns: {df.columns.tolist()}")
    print(f"INFOTABLE shape: {df.shape}")
    
    # Find accession number column
    acc_col = None
    for col in df.columns:
        if "ACCESSION" in col.upper():
            acc_col = col
            break
    if acc_col is None:
        raise ValueError(f"No accession column found. Columns: {df.columns.tolist()}")
    
    holdings = df[df[acc_col] == accession_number].copy()
    print(f"Holdings rows for {accession_number}: {len(holdings)}")
    return holdings

# Usage:
# holdings = get_fund_holdings("q3", "0001037389-25-000001")
# print(holdings.head())
# print(holdings.columns.tolist())

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.