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.7.1-cp37-abi3-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.7.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

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

prql_python-0.7.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (4.9 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.7.1-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for prql_python-0.7.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 60be19174eec321b1fca28ee2df57657006a2e7e2b59da6abab2f5f049760889
MD5 825be1fda8014dd7d9f70c4b50348ffa
BLAKE2b-256 f596ec6d1dce83ae3c381bf4a018ee25b33be7ee513ec82327d55360a59d30eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.7.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1dbd055af07e525f9dec344babd65a3aee42ebbde4a95e972bd9789b52e02025
MD5 711bb03edade1d81860445324d789d56
BLAKE2b-256 230a751af04a8069fcde70571093b27c297547d5145080240680dbfcd5a8bb7d

See more details on using hashes here.

File details

Details for the file prql_python-0.7.1-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.7.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ac1ebd2e92463d27609d149f81fcfd3986e0e97e30d11811b357a9019ae966ac
MD5 51f4f3efa7e206624f4296c5400d4fae
BLAKE2b-256 d4333e6244e464f1069be4f435f130df79f80fb84a3a533bfb49241791eceec1

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