PyPRQL contains these tools:
- pyprql.pandas_accessor - Pandas integration for PRQL
- pyprql.magic - IPython magic for connecting to databases using
%%prql
- pyprql.cli - TUI for databases using PRQL
For docs, Check out the PyPRQL Docs, and the PRQL Book.
This project is maintained by @charlie-sanders and @rbpatt2019
pip install pyprql
import pandas as pd
import pyprql.pandas_accessor
df = (...)
results_df = df.prql.query('select [age,name,occupation] | filter age > 21')
In [1]: %load_ext pyprql.magic
In [2]: %prql postgresql://user:password@localhost:5432/database
In [3]: %%prql
...: from p
...: group categoryID (
...: aggregate [average unitPrice]
...: )
In [4]: %%prql results <<
...: from p
...: aggregate [min unitsInStock, max unitsInStock]
With a CSV file:
curl https://people.sc.fsu.edu/~jburkardt/data/csv/zillow.csv
pyprql zillow.csv
With a Database:
pyprql 'postgresql://user:password@localhost:5432/database'
PRQL> show tables