Installation
This page collects the practical getting-started material for installing db2pq, choosing optional extras, and seeing the main workflow paths.
Installation
pip install --upgrade db2pqOptional extras:
db2pq[sas]: WRDS SAS-side metadata checks for refresh logic such aswrds_update_pq(..., use_sas=True)
pip install --upgrade "db2pq[sas]"db2pq[pandas]: pandas DataFrame outputs from metadata helpers such aspq_last_modified(...)
pip install --upgrade "db2pq[pandas]"db2pq[ibis]: export PostgreSQL-backed Ibis expressions withibis_to_pq(...)
pip install --upgrade "db2pq[ibis]"db2pq[adbc]: use the Arrow-based export path withengine="adbc"
pip install --upgrade "db2pq[adbc]"Quick example
from db2pq import wrds_update_pq
wrds_update_pq("dsi", "crsp")This example uses the standard update-aware WRDS-to-Parquet path.
Main Paths
WRDS to Parquet
Export WRDS tables to Parquet files and update them only when the WRDS source is newer.
WRDS to PostgreSQL
Materialize WRDS tables into a local PostgreSQL database and manage indexes or derived tables there.
PostgreSQL to Parquet
Export local PostgreSQL tables or Ibis expressions into a Parquet repository.
Parquet to PostgreSQL
Load Parquet repository tables back into PostgreSQL and refresh them when the Parquet source is newer.
Learn More
- Authentication: how
db2pqfinds WRDS credentials, uses.env, and works with.pgpass - Data management ideas: how to think about general-purpose versus project-level Parquet data
- Using the WRDS web query: how to turn a WRDS web query into a cleaner SQL export workflow
- Using the Parquet repository with Polars: practical analysis patterns once the repository already exists
- API Reference: generated function reference from docstrings
Docs Build
This site uses quartodoc for API pages and Quarto for rendering.