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-hypernode.com/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 Distribution
prql_python-0.11.0.tar.gz
(361.7 kB
view hashes)
Built Distributions
Close
Hashes for prql_python-0.11.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80fd966448031fd44918c03fdcf61278662c3153685a39b8605bb1737d984eaf |
|
MD5 | 9108c1ba5ad201f3341bbb164bcbc377 |
|
BLAKE2b-256 | a4f674183e0cb5382452787c8337d358c29b5c80a85efdeab542d9d778d46e43 |
Close
Hashes for prql_python-0.11.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffcc9384e4682e6e318306bad069009ece0209fbe81bab265f431f70b1c9f10c |
|
MD5 | b2147f69e8822f882abde0be01a171c9 |
|
BLAKE2b-256 | a08ae4bf124f70e28141f68aea3f34da03b7783566d7868d56efced138f002a9 |
Close
Hashes for prql_python-0.11.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f45547407996b0b26d292ce92174dc3f59344a06ca975bca6446139fb5df629 |
|
MD5 | 8515106768bf993526a79eced3b3ffe3 |
|
BLAKE2b-256 | f9456205101b9510a73380723934c19b154350354782e62445189adf0a6b9a24 |
Close
Hashes for prql_python-0.11.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3a1bbfdc1c454a04468e1e9d18bd1f02e62a2acc70a0400d8363b6bd429cfb3 |
|
MD5 | 6978fbd939934517a237e4b3effa04b5 |
|
BLAKE2b-256 | 143b77465bfffcecdba100c355e57eb9f0f7487b1c132c9cf2f03c772484b889 |