Skip to main content

No project description provided

Project description

Python bindings to prqlc

The prqlc-python crate offer Rust bindings to the prqlc Rust library, published to a python package named prqlc.

The main entry point is a Python method prqlc.compile(query: str) -> str.

The package is consumed by pyprql & dbt-prql.

The crate is not published to crates.io; only to PyPI at https://pypi.org/project/prql-python/.

Installation

pip install prqlc

Usage

import prqlc

prql_query = """
    from employees
    join salaries (==emp_id)
    group {employees.dept_id, employees.gender} (
      aggregate {
        avg_salary = average salaries.salary
      }
    )
"""

options = prqlc.CompileOptions(
    format=True, signature_comment=True, target="sql.postgres"
)

sql = prqlc.compile(prql_query)
sql_postgres = prqlc.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 Distribution

prqlc-0.11.3.tar.gz (442.8 kB view hashes)

Uploaded Source

Built Distributions

prqlc-0.11.3-cp37-abi3-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.7+ Windows x86-64

prqlc-0.11.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view hashes)

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

prqlc-0.11.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.0 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

prqlc-0.11.3-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (5.3 MB view hashes)

Uploaded CPython 3.7+ macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ 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