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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

prql_python-0.3.0-cp37-abi3-win_amd64.whl (940.1 kB view details)

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

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

prql_python-0.3.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.2 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.3.0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for prql_python-0.3.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3ae2637f538c973ce594aa1da7ec20b411e678bda03c2d7490186b59530a671d
MD5 6ed0bbfbf1a04dd9877467ab746baeaf
BLAKE2b-256 0e601d9fc05a1619e1c8c0bdb18c2a049552fbc40b3117ad287d356adebdbe1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f92372cfd1b7e1c91f9c7b7a6ff4d4ecd3493203a3139e45fdfbb5d3524fbff1
MD5 3e0b1c8b5c2e8f50850a2deb440516d6
BLAKE2b-256 f286b2ec520160880437693204aa5521453fdd6aa550373ecc171ac08c9c1a84

See more details on using hashes here.

File details

Details for the file prql_python-0.3.0-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.3.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5167e352336931e32dd0b91d7fabbd673d435fcb6f34961e955ee5846f681495
MD5 e6df9e0d13179d530aecccabbbfd8cbb
BLAKE2b-256 8cc34dc028408447b9acaffd81d676e9f152b44d656f7b568276ca4cf6faeca8

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