No project description provided
Project description
prql-python
prql-python
offers Rust bindings to the prql-compiler
Rust library. It
exposes a Python method compile(query: str) -> str
.
This is consumed by PyPrql & dbt-prql.
The crate is not published to crates.io; only to PyPI at https://pypi.org/project/prql-python/.
Installation
pip install prql-python
Usage
import prql_python as prql
prql_query = """
from employees
join salaries [==emp_id]
group [employees.dept_id, employees.gender] (
aggregate [
avg_salary = average salaries.salary
]
)
"""
options = prql.CompileOptions(
format=True, signature_comment=True, target="sql.postgres"
)
sql = prql.compile(prql_query)
sql_postgres = prql.compile(prql_query, options)
Relies on pyo3 for all the magic.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.
See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for prql_python-0.8.1-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dd2f8705aec3c318564d06a7d75333b0e4bfdb2cfbcc2a21ac2efe3bcfbb2f4 |
|
MD5 | f9b32209f330a76608e58b2042103438 |
|
BLAKE2b-256 | 3172776ab1a8541fdfd02873df7896d1f45521a1c7d133ca861988d5efa5163e |
Close
Hashes for prql_python-0.8.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddbd51a956f8072c9dc009ae9602fe960f7e81410ae9704a2e923c44f4c7b606 |
|
MD5 | 04af7aa985caa8fcc2fa873e892e2074 |
|
BLAKE2b-256 | d0357105c88bf9dee4013ea6e5d217992d387bf0fc5ae5bc39ac6ef57db46bf1 |
Close
Hashes for prql_python-0.8.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f0bd1dff1d1dda2607572cb6073e3ed767c5a0c106983a73cdf1c2253c04c52 |
|
MD5 | d2ebdbed61fc15a76ed8753f89ba44c0 |
|
BLAKE2b-256 | c7410a8dedcf671566e197b9e8c25d356aa21f0dc2b1e1b0e39f8e1972eec6c5 |