Skip to content

Basics of Using Python on the WRDS Platform

This Jupyter notebook walks you through the essentials of connecting to WRDS and querying data using Python.

Topics Covered

  • Installing and connecting to WRDS with Python
  • Listing available databases and tables
  • Querying data with SQL (get_table() and raw_sql())
  • Joining multiple datasets
  • Exporting results to CSV, Excel, Stata, and pickle

Download

Prerequisites

Install the wrds package before running any code:

pip install wrds

On first use, you will be prompted for your WRDS username and password. See the Account & Setup page for registration instructions.