wrds-psql

Query WRDS data via psql and export Parquet with metadata.

58|10|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/Alexander-M-Dickerson/ai-asset-pricing --skill wrds-psql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wrds-psql
Source: https://github.com/Alexander-M-Dickerson/ai-asset-pricing/tree/main/.claude/skills/wrds-psql
Command: npx skills add https://github.com/Alexander-M-Dickerson/ai-asset-pricing --skill wrds-psql

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables efficient querying of WRDS data from a local machine using PostgreSQL, via psql with service file authentication (.pgpass), and supports CSV and Parquet exports along with best practices for large extractions across CRSP, OptionMetrics, and Compustat.

Core Features & Use Cases

  • Local psql connections using service file authentication (.pgpass) and a standard PostgreSQL client.
  • Flexible query patterns: inline SQL and file-based queries with a deterministic pipeline.
  • Data export pipeline: default to Parquet with metadata, typically piping psql output to Python to generate Parquet files and metadata.json.
  • Best practices for large extractions: chunk by date ranges, use COPY for bulk export, and validate data with minimal intermediate files.

Quick Start

Ask the tool to run a WRDS query against crsp.dsf_v2 and export the results as Parquet with metadata.

Frequently Asked Questions about wrds-psql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query WRDS data locally using psql and export to Parquet?

Query WRDS data locally using psql with .pgpass service file authentication, then pipe output through a Python pipeline to generate Parquet files and metadata.json. This enforces single-line psql commands and returns structured results suitable for analysis across datasets like CRSP and Compustat.

What is the best way to extract large datasets from WRDS via PostgreSQL?

The best way to extract large WRDS datasets via PostgreSQL is to chunk queries by date ranges, use the COPY command for bulk export, and validate data with minimal intermediate files. This approach maintains efficiency when pulling from OptionMetrics or Compustat.

Do I need a .pgpass file to connect to WRDS with psql?

Yes, local psql connections to WRDS require a .pgpass service file for authentication. You also need a standard PostgreSQL client installed locally to execute the deterministic query pipeline and export data.

Can I export WRDS query results as CSV instead of Parquet?

Yes, CSV export is supported alongside Parquet. The pipeline defaults to Parquet with metadata, piping psql output to Python to generate both Parquet files and metadata.json, but you can also extract CSV outputs depending on your analysis needs.

Why does my WRDS psql command need to be on a single line?

WRDS psql commands must be on a single line because the skill enforces single-line psql commands to ensure deterministic execution within the local PostgreSQL service file pipeline. This prevents parsing errors during automated data extraction.

Does this approach support file-based SQL queries or only inline SQL?

This approach supports both inline SQL and file-based queries for WRDS data extraction. The deterministic pipeline processes either query pattern using local psql connections and exports structured results to Parquet with metadata.