Skip to main content

No project description provided

Project description

prql-python

prql-python exposes the prql-compiler rust package via the python method to_sql(query:str)->str

Installation

pip install prql-python

Usage

import prql_python as prql
prql_query = '''
    from employees
    join salaries [emp_no]
    aggregate by:[emp_no, gender] [
      emp_salary: average salary
    ]
    join departments [dept_no]
'''
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.0.2.tar.gz (51.5 kB view hashes)

Uploaded Source

Built Distributions

prql_python-0.0.2-cp37-abi3-win_amd64.whl (506.7 kB view hashes)

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.0.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.5 MB view hashes)

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

prql_python-0.0.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.3 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