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 Distribution

prql_python-0.11.2.tar.gz (440.1 kB view details)

Uploaded Source

Built Distributions

prql_python-0.11.2-cp37-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.11.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

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

prql_python-0.11.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.0 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

prql_python-0.11.2-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (5.3 MB view details)

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

File details

Details for the file prql_python-0.11.2.tar.gz.

File metadata

  • Download URL: prql_python-0.11.2.tar.gz
  • Upload date:
  • Size: 440.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.4.0

File hashes

Hashes for prql_python-0.11.2.tar.gz
Algorithm Hash digest
SHA256 79924121c1cf4ae3b96a23753851f84ec0bf69f84524867ab17875d4657cd7e9
MD5 e2c232769dc821785916f073d67f9312
BLAKE2b-256 4afd4925e221ca85fdee1024a72db67a5caae2bfffe2cadad2ca467782ad19d2

See more details on using hashes here.

File details

Details for the file prql_python-0.11.2-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for prql_python-0.11.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 78bf105a542421251463b33e2026ffb9dca6cdf0cc8a2194734cc57558513192
MD5 4ef32367274865f329dc86e8b21b9ad6
BLAKE2b-256 3cf2675108d49f39fa017abd6324bb49881646e1106a77bf6f7068a5ce969525

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.11.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b3d2b3a0fc88f5b5f2d84ed625ee5636ca1d2f19c4c3c5ce0efd5e7b3dc25b5
MD5 f0bd764e1a7ead0845456af7d9490fcd
BLAKE2b-256 626c5a67c02f4cf12b830656b3719f53452d7a73aebcdddef43abf4e3af12665

See more details on using hashes here.

File details

Details for the file prql_python-0.11.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for prql_python-0.11.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7df71fb962c6fbd65bd28555f46a1d20d3b7c5aa684989c3351822e6d10e9228
MD5 71048b993dbd3d311e72cdfaba482175
BLAKE2b-256 a72f4e5723a0e10999e452509ef349a0850ebc54dbe77fdf34299a25b43a2394

See more details on using hashes here.

File details

Details for the file prql_python-0.11.2-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for prql_python-0.11.2-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 77472d54e40920012465170d2c18e55f968ef242051411f963358aa64fe8a707
MD5 10d6a09130fbb4c91984db6354f56655
BLAKE2b-256 5ea362cf5378fd1fb153fda4aa8a101af65b1bd2f20462a35a1cb240cbb10afa

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