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.
In this repository16 other files it gives its agents.
- debug-remote-pipelineSkill
- dictateSkill
- dtcatSkill
- dtdiffSkill
- dtfilterSkill
- dtsetSkill
- esync-setupSkill
- hathifilesSkill
- hathitrust-lookupSkill
- julia-releaseSkill
- marginSkill
- mint-gh-tokenSkill
- nclqSkill
- pr-walkthroughSkill
- rendering-spec-docsSkill
- wrds-downloadSkill
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
- Very specific: line 21
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.
- Very specific: line 23
If wrds-dl is not found and uv is available, install it:
- Distinctive: line 30
Follow these steps for every download request:
- Very specific: line 53
If unsure which table, ask the user or use wrds-dl info to explore.
- Very specific: line 57
Always run wrds-dl info first to understand the table structure:
- Distinctive: line 63
Use the output to:
- Distinctive: line 66
Check the estimated row count to warn about large downloads
- Distinctive: line 96
Format: Use Parquet unless the user asks for CSV.
- Very specific: line 99
Limit: Use --limit for testing. Suggest --limit 1000 if the user is exploring.
- Distinctive: line 109
After download completes, confirm the file was created and report its size:
- Very specific: line 118
Table not found: Use wrds-dl info to check schema/table names.
≈ “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.
Files
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:
uvinstalled (https://docs.astral.sh/uv/)- WRDS credentials configured via one of:
- Environment variables:
PGUSERandPGPASSWORD - Saved credentials at
~/.config/wrds-dl/credentials - Standard
~/.pgpassfile
- Environment variables:
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/pythonWorkflow
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:
| Dataset | Schema | Key Tables |
| CRSP daily stock | crsp | dsf (daily), msf (monthly), dsi (index) |
| CRSP events | crsp | dsedelist, stocknames |
| Compustat annual | comp | funda |
| Compustat quarterly | comp | fundq |
| Compustat global | comp_global_daily | g_funda, g_fundq |
| IBES | ibes | statsum_epsus, actu_epsus |
| OptionMetrics | optionm | opprcd (prices), secprd (security) |
| TAQ | taqmsec | ctm_YYYYMMDD |
| CRSP/Compustat merged | crsp | ccmxpf_linktable |
| BoardEx | boardex | na_wrds_company_profile |
| Institutional (13F) | tfn | s34 |
| Audit Analytics | audit | auditnonreli |
| Ravenpack | ravenpack | rpa_djnw |
| Bank Regulatory | bank | call_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-runShow 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.parquetorcomp_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
--limitfor testing. Suggest--limit 1000if 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/PGPASSWORDor configure~/.config/wrds-dl/credentials. - Table not found: Use
wrds-dl infoto check schema/table names. WRDS schemas and table names are lowercase. - Timeout on large tables: Suggest adding a
--wherefilter or--limitto 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.
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
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.

