Skip to main content

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


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

prql_python-0.5.2-cp37-abi3-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.5.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

prql_python-0.5.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (4.0 MB view details)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

File details

Details for the file prql_python-0.5.2-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for prql_python-0.5.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 075ca947b9b6c40f67f240acf939a146b742926377e65d369529facd8593b97c
MD5 86ef8328a8e1e6e0569cefcebc20b82d
BLAKE2b-256 d4435d932dbe22d646ff912887f8115ac874d414be116ab96ac6b17509c6f81b

See more details on using hashes here.

File details

Details for the file prql_python-0.5.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for prql_python-0.5.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d46bd2d0fb6728cf3c8a19ae40279ad6c1159d8f8d129bdb2dc9cfc5268af84
MD5 f04969bc397bf9809104b7545b1b5801
BLAKE2b-256 b00c1f26be8758a582e33bfc416d9f273e208e07e55c92c8d616b9dde35b8c0b

See more details on using hashes here.

File details

Details for the file prql_python-0.5.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for prql_python-0.5.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d865934608a4f33b023ebf5c03a6db8433f0eab0e7879a0776aeccf09dbdbfca
MD5 42d713e2da32a85977fc276306d70a80
BLAKE2b-256 a04eb738eca4d8b045c86c7e459ca990aaf3be76f047b6ea2bf53c4ffa96a465

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page