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

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.6.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.6.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.6.1-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for prql_python-0.6.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e19cd311ab630a6cf9498da459ac3c7b998d9db0cd1d8b3d29a270fb763fa811
MD5 4850a30e96ab4c83f08f2ee46cc42123
BLAKE2b-256 ec52e354def070aad0aa7a20ba2170017ed3a0192c0ca2d351e540150416ea76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.6.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad57445e0184a55c0b9a693e4d2673ab9f79ecd09e317395515b36ae35b0b5aa
MD5 531149fd9a357a2c32621db786bb46f0
BLAKE2b-256 9f627c0bdb2c080463bb106137a7ad89654e2882dd4fc32022111c01e9922403

See more details on using hashes here.

File details

Details for the file prql_python-0.6.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.6.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 94967a14e717046a1f5bf5d36a12d76c4b3044b01f7d58c6b96883a18955def9
MD5 ef0f0b0f534f1ccaf5e671ebe976610e
BLAKE2b-256 a84279b330dd4b34bdfccdbfa8de6f0c6f9c536d69caef0d823e4ea84c3b70e1

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