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.9.0.tar.gz
(335.0 kB
view hashes)
Built Distributions
Close
Hashes for prql_python-0.9.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1a51525b84309b1128e42c9f0012254dbf05ae404ebf387b4308ec6c314003a |
|
MD5 | ec8a7e7e2ba02ec2319fb8bb21dc567c |
|
BLAKE2b-256 | 88c843968d690cdebd137960635d1009d0236a0704d880f814b0da6cbb992730 |
Close
Hashes for prql_python-0.9.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f24edaab972451ebe52e8776a2b4fc387ca32974df5c3fc4f303dffe9185e5e0 |
|
MD5 | cbc0ca5f912c76007c383fc533c2bc23 |
|
BLAKE2b-256 | a30ddbba731d40fe5eba6f878d51138d7ad43c7916e7a9ac822aa97e69f67194 |
Close
Hashes for prql_python-0.9.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc1ce2ab2e628773a38c00a952ed38374ef771729607140f5330bd8a651f727a |
|
MD5 | 1884a1f6b74a844b2fe5a4347f8f2bd5 |
|
BLAKE2b-256 | 9540a5843690c54ff091160f224edffd3cd2c485e0161a8b5f80191339b7e8b1 |
Close
Hashes for prql_python-0.9.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ff0f698b378eee676aeb002801ba12c424cd4ab75f89e0508415ed28436d7eb |
|
MD5 | a4785121b21ad57b75c52ae8cde46247 |
|
BLAKE2b-256 | b6f4cfafd47e00ec8c6c89b9a38347dc3c79f18a74897fdac9a7731fe3b5d3a8 |