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

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.5.1-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.1-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.1-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for prql_python-0.5.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c4190765f2f6e4e2871bd6bf9c41052ba528586e084150b3b7632bebf041389c
MD5 2bc3929768018ec7b748ca917673544f
BLAKE2b-256 24ccf6fc15736b25d9270d0c6b5e611a0e52a9d91743f78b116c3914b799393c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.5.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db0f9de549c99f352f459660d524f2e0f5ef26f0cedf43da7f9adf8e6b82ad86
MD5 3bd6c1ebf1c859e958b2140954538bb0
BLAKE2b-256 79b347da3e5ebc1692e1b4d16ed7ed8f00534e84295bad72df26e96df1b0df9a

See more details on using hashes here.

File details

Details for the file prql_python-0.5.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.5.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 de2663272ef21db0716ca10a72f4917e7f500c7b04afe6b5ccd18e6bdcf9a4d0
MD5 7087c694bca3b52dc6b4b1150dc7ff2c
BLAKE2b-256 3f2c28e346e02c4877d31cb83d1e5a249aee934fc4cb355efaa36b2d37422058

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