This guide will help you download WRDS data and store it locally as Parquet files using the db2pq Python package.
No administrator privileges are required for these steps.
As a side-effect, after running the following, you will have a working installation of Python on your system.
- Credentials may be stored in a
.pgpassfile for future use - No administrator privileges are required
- Start small and work up to bigger files. If you are far from the WRDS server or have a slow internet connection, download times can be longer.
Run commands in:
- Terminal (macOS or Linux)
- PowerShell (Windows)
Open Terminal and run:
curl -LsSf https://astral.sh/uv/install.sh | sh(If you don't have curl, you can use wget -qO- instead.)
After installation, restart Terminal or run:
source ~/.zshrcVerify installation:
uv --version-
Open PowerShell:
- Click Start Menu
- Type:
PowerShell - Click Windows PowerShell (or PowerShell)
-
Paste and run:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"-
Close PowerShell and open a new one.
-
Verify installation:
uv --versionCreate a folder where you will store scripts.
Example:
mkdir ~/scripts
cd ~/scriptsThis should be a directory where you are comfortable storing a few gigabytes of data.
Example:
mkdir ~/dataCreate a file named .env (no extension) inside your script folder.
touch .envEdit the .env file and add:
WRDS_ID=your_wrds_id
DATA_DIR=~/data
Replace:
your_wrds_idwith your WRDS login~/datawith the location of the data directory you created above
Windows example:
DATA_DIR=C:\Users\YourName\data
From inside your script folder:
uv init
uv add db2pqThis creates a Python project and virtual environment in the current folder.
Start a Python session:
uv run pythonYou should see some information about Python on your system followed by the Python prompt (>>>) where you can enter Python commands.
Here's what I see:
Python 3.14.3 (main, Mar 3 2026, 15:46:55) [Clang 21.1.4 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> Suppose you want crsp.wrds_dailyindexret_query, where crsp is the PostgreSQL schema (SAS library) and wrds_dailyindexret_query is the table (this appears to be the "new" version of crsp.dsi).
In Python, run:
from db2pq import wrds_update_pq
wrds_update_pq("wrds_dailyindexret_query", "crsp")You may be prompted to:
- Enter your WRDS password (first time only)
- Approve a 2FA request (e.g., on your phone)
Enter your WRDS PostgreSQL password:
Saved WRDS PostgreSQL credentials to /Users/username/.pgpass.
Updated crsp.wrds_dailyindexret_query is available.
Beginning file download at 2026-03-31 20:51:24 UTC.
Writing crsp.wrds_dailyindexret_query: 100.0% ββββββββββββββββββββββββββββββββββββββββ ETA <1s
Completed file download at 2026-03-31 20:51:26 UTC.
'/Users/igow/Dropbox/far_data/crsp/wrds_dailyindexret_query.parquet'You now have the crsp.wrds_dailyindexret_query table stored locally as a Parquet file.
You can replace "wrds_dailyindexret_query" and "crsp" in wrds_update_pq() with any table you have access to on WRDS.
Even fairly large tables can be quite quick to download.
For example, crsp.msf_v2 is 1.26 GB in WRDS PostgreSQL, but downloads in ~30 seconds for me.
The resulting Parquet file is 207 MB.
>>> wrds_update_pq("msf_v2", "crsp")
Updated crsp.msf_v2 is available.
Beginning file download at 2026-03-30 15:14:33 UTC.
100% ββββββββββββββββββββββββββββββββββββββββ (00:00:31.25 elapsed)
Completed file download at 2026-03-30 15:15:06 UTC.
'/Users/igow/data/crsp/msf_v2.parquet'