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 to_sql(query: str) -> str.

This is consumed by PyPrql & dbt-prql.

The crate is not published to crates.io; only to PyPI.

Installation

pip install prql-python

Usage

import prql_python as prql

prql_query = """
    from employees
    join salaries [emp_id]
    group [dept_id, gender] (
      aggregate [
        avg_salary = average salary
      ]
    )
"""

sql = prql.to_sql(prql_query)

Relies on pyo3 for all the magic.

#[pyfunction]
pub fn to_sql(query: &str) -> PyResult<String> {}
fn prql_python(_py: Python, m: &PyModule) -> PyResult<()> {}

Project details


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.2.4.tar.gz (572.7 kB view hashes)

Uploaded Source

Built Distributions

prql_python-0.2.4-cp37-abi3-win_amd64.whl (715.6 kB view hashes)

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.2.4-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view hashes)

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

prql_python-0.2.4-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.7 MB view hashes)

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

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