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 Distribution
prql_python-0.11.2.tar.gz
(440.1 kB
view hashes)
Built Distributions
Close
Hashes for prql_python-0.11.2-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78bf105a542421251463b33e2026ffb9dca6cdf0cc8a2194734cc57558513192 |
|
MD5 | 4ef32367274865f329dc86e8b21b9ad6 |
|
BLAKE2b-256 | 3cf2675108d49f39fa017abd6324bb49881646e1106a77bf6f7068a5ce969525 |
Close
Hashes for prql_python-0.11.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3d2b3a0fc88f5b5f2d84ed625ee5636ca1d2f19c4c3c5ce0efd5e7b3dc25b5 |
|
MD5 | f0bd764e1a7ead0845456af7d9490fcd |
|
BLAKE2b-256 | 626c5a67c02f4cf12b830656b3719f53452d7a73aebcdddef43abf4e3af12665 |
Close
Hashes for prql_python-0.11.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7df71fb962c6fbd65bd28555f46a1d20d3b7c5aa684989c3351822e6d10e9228 |
|
MD5 | 71048b993dbd3d311e72cdfaba482175 |
|
BLAKE2b-256 | a72f4e5723a0e10999e452509ef349a0850ebc54dbe77fdf34299a25b43a2394 |
Close
Hashes for prql_python-0.11.2-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77472d54e40920012465170d2c18e55f968ef242051411f963358aa64fe8a707 |
|
MD5 | 10d6a09130fbb4c91984db6354f56655 |
|
BLAKE2b-256 | 5ea362cf5378fd1fb153fda4aa8a101af65b1bd2f20462a35a1cb240cbb10afa |