wrds

Solid

Connect to and query WRDS (Wharton Research Data Services) from any research project. Use this skill whenever the user needs to download, query, or explore data from WRDS — including Compustat, CRSP, FactSet, I/B/E/S, or any other WRDS-hosted database. Also trigger when the user mentions WRDS tables, WRDS libraries, or wants to look up variable definitions or coverage in WRDS datasets. Do NOT trigger for general SQL or database questions unrelated to WRDS.

Data & Documents 28 stars 0 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
49
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# WRDS (Wharton Research Data Services) Reusable patterns for connecting to WRDS and querying its databases from Python. ## Prerequisites 1. Install the client library: ```bash pip install wrds ``` 2. Credentials live in a libpq `.pgpass` file with the line format: ``` wrds-pgdata.wharton.upenn.edu:9737:wrds:your_wrds_username:PASSWORD ``` Point the environment variable `PGPASSFILE` at that file, or place it at the OS-default libpq location (`%APPDATA%\postgresql\pgpass.conf` on Windows, `~/.pgpass` elsewhere). Set `$WRDS_USERNAME` (or `$PGUSER`) to your account. 3. **Never hardcode passwords** in scripts, CLAUDE.md, or any version-controlled file. The `.pgpass` mechanism handles authentication automatically. ## Authentication: fail fast, never retry WRDS locks an account after a few consecutive failed logins, and unlocking it requires a request to WRDS support. The `wrds` package makes this easy to trigger by accident. `wrds.Connection()` authenticates through the `.pgpass` file, and when that file is missing or its password has expired, the package silently falls back to an interactive `input()`/`getpass()` prompt and then retries. In an unattended agent session the prompt has no human to answer it, so the run either hangs on stdin or the attempt fails and gets repeated, where each repeat is another failed login against the account. To prevent that, **always connect through the bundled guard `scripts/wrds_connect.py`, and never call `wrds.Connec...

Details

Author
kennethkhoocy
Repository
kennethkhoocy/applied-micro-skills
Created
1 months ago
Last Updated
6 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category