# Wrds Download

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-louloulibs-claude-skills-wrds-download`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [LouLouLibs](https://agentstack.voostack.com/s/louloulibs)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [LouLouLibs](https://github.com/LouLouLibs)
- **Source:** https://github.com/LouLouLibs/claude-skills/tree/main/skills/wrds-download

## Install

```sh
agentstack add skill-louloulibs-claude-skills-wrds-download
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# WRDS Data Download

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

## Prerequisites

The `wrds-dl` CLI must be installed and on the PATH. Either the Go binary or the Python version works — they have the same commands and flags. The user must have WRDS credentials configured via one of:
- Environment variables: `PGUSER` and `PGPASSWORD`
- Saved credentials at `~/.config/wrds-dl/credentials`
- Standard `~/.pgpass` file

If `wrds-dl` is not found, tell the user to install it:
- **Go binary**: download from https://github.com/LouLouLibs/wrds-download/releases
- **Python (via uv)**: `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:

| 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:

```bash
wrds-dl info --schema  --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  --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:

```bash
wrds-dl download --schema  --table  \
  --columns "" --where "" --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:

```bash
wrds-dl download \
  --schema  \
  --table  \
  --columns "" \
  --where "" \
  --out  \
  --format 
```

#### 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 = 2010 AND fyear 
```

## Error handling

- **Authentication errors**: Remind the user to set `PGUSER`/`PGPASSWORD` or run `wrds-dl tui` to save 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.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [LouLouLibs](https://github.com/LouLouLibs)
- **Source:** [LouLouLibs/claude-skills](https://github.com/LouLouLibs/claude-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-louloulibs-claude-skills-wrds-download
- Seller: https://agentstack.voostack.com/s/louloulibs
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
