agentleFS
LouLouLibsLouLouLibs/claude-skills/skills/wrds-download-py/SKILL.md

wrds-download

Skill1 starsChanged 2 months agoMITView on GitHub

Download data from the WRDS (Wharton Research Data Services) PostgreSQL database to local Parquet or CSV files. Use when the user asks to get data from WRDS, download financial data, or mentions WRDS schemas like crsp, comp, optionm, ibes, etc.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the CLI with uv run wrds-dl from the python/ directory of the wrds-download repo, or wrds-dl if installed via uv tool install.

    line 21
  2. Very specific:

    If wrds-dl is not found and uv is available, install it:

    line 23
  3. Distinctive:

    Follow these steps for every download request:

    line 30
  4. Very specific:

    If unsure which table, ask the user or use wrds-dl info to explore.

    line 53
  5. Very specific:

    Always run wrds-dl info first to understand the table structure:

    line 57
  6. Distinctive:

    Use the output to:

    line 63
  7. Distinctive:

    Check the estimated row count to warn about large downloads

    line 66
  8. Distinctive:

    Format: Use Parquet unless the user asks for CSV.

    line 96
  9. Very specific:

    Limit: Use --limit for testing. Suggest --limit 1000 if the user is exploring.

    line 99
  10. Distinctive:

    After download completes, confirm the file was created and report its size:

    line 109
  11. Very specific:

    Table not found: Use wrds-dl info to check schema/table names.

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WRDS Data Download (Python)

You help users download data from the Wharton Research Data Services (WRDS) PostgreSQL database using the wrds-dl Python CLI tool (via uv).

Prerequisites

The user must have:

  • uv installed (https://docs.astral.sh/uv/)
  • WRDS credentials configured via one of:
    • Environment variables: PGUSER and PGPASSWORD
    • Saved credentials at ~/.config/wrds-dl/credentials
    • Standard ~/.pgpass file

Run the CLI with uv run wrds-dl from the python/ directory of the wrds-download repo, or wrds-dl if installed via uv tool install.

If wrds-dl is not found and uv is available, install it:

uv tool install wrds-dl --from /path/to/wrds-download/python

Workflow

Follow these steps for every download request:

Step 1: Identify the table

Parse the user's request to determine the WRDS schema and table. Common mappings:

DatasetSchemaKey Tables
CRSP daily stockcrspdsf (daily), msf (monthly), dsi (index)
CRSP eventscrspdsedelist, stocknames
Compustat annualcompfunda
Compustat quarterlycompfundq
Compustat globalcomp_global_dailyg_funda, g_fundq
IBESibesstatsum_epsus, actu_epsus
OptionMetricsoptionmopprcd (prices), secprd (security)
TAQtaqmsecctm_YYYYMMDD
CRSP/Compustat mergedcrspccmxpf_linktable
BoardExboardexna_wrds_company_profile
Institutional (13F)tfns34
Audit Analyticsauditauditnonreli
Ravenpackravenpackrpa_djnw
Bank Regulatorybankcall_schedule_rc, bhck

If unsure which table, ask the user or use wrds-dl info to explore.

Step 2: Inspect the table

Always run wrds-dl info first to understand the table structure:

wrds-dl info --schema <schema> --table <table>

Use the output to:

  • Confirm the table exists and has the expected columns
  • Note column names for the user's requested variables
  • Check the estimated row count to warn about large downloads

For JSON output (useful for parsing): wrds-dl info --schema <schema> --table <table> --json

Step 3: Dry run

For tables with more than 1 million estimated rows, or when a WHERE clause is involved, always do a dry run first:

wrds-dl download --schema <schema> --table <table> \
  --columns "<cols>" --where "<filter>" --dry-run

Show the user the row count and sample rows. Ask for confirmation before proceeding if the row count is very large (>10M rows).

Step 4: Download

Build and run the download command:

wrds-dl download \
  --schema <schema> \
  --table <table> \
  --columns "<comma-separated columns>" \
  --where "<SQL filter>" \
  --out <output_file> \
  --format <parquet|csv>

Defaults and conventions

  • Format: Use Parquet unless the user asks for CSV. Parquet is smaller and faster.
  • Output path: Name the file descriptively, e.g., crsp_dsf_2020.parquet or comp_funda_2010_2023.parquet.
  • Columns: Select only the columns the user needs. Don't use * on wide tables — ask what variables they need.
  • Limit: Use --limit for testing. Suggest --limit 1000 if the user is exploring.

Common filters

  • Date ranges: --where "date >= '2020-01-01' AND date < '2021-01-01'"
  • Specific firms by permno: --where "permno IN (10107, 93436)"
  • Specific firms by gvkey: --where "gvkey IN ('001690', '012141')"
  • Fiscal year: --where "fyear >= 2010 AND fyear <= 2023"

Step 5: Verify

After download completes, confirm the file was created and report its size:

ls -lh <output_file>

Error handling

  • Authentication errors: Remind the user to set PGUSER/PGPASSWORD or configure ~/.config/wrds-dl/credentials.
  • Table not found: Use wrds-dl info to check schema/table names. WRDS schemas and table names are lowercase.
  • Timeout on large tables: Suggest adding a --where filter or --limit to reduce the result set.
  • Duo 2FA prompt: The connection triggers a Duo push. Tell the user to approve it on their phone.

Example interactions

User: "Download CRSP daily stock data for 2020" -> wrds-dl info --schema crsp --table dsf -> wrds-dl download --schema crsp --table dsf --where "date >= '2020-01-01' AND date < '2021-01-01'" --out crsp_dsf_2020.parquet

User: "Get Compustat annual fundamentals, just gvkey, datadate, and sales" -> wrds-dl info --schema comp --table funda -> wrds-dl download --schema comp --table funda --columns "gvkey,datadate,sale" --out comp_funda.parquet

User: "I need IBES analyst estimates" -> wrds-dl info --schema ibes --table statsum_epsus -> Ask what date range and variables they need, then download.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.