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.9.5.tar.gz (339.6 kB view details)

Uploaded Source

Built Distributions

prql_python-0.9.5-cp37-abi3-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.7+ Windows x86-64

prql_python-0.9.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

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

prql_python-0.9.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

prql_python-0.9.5-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (5.9 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.9.5.tar.gz.

File metadata

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

File hashes

Hashes for prql_python-0.9.5.tar.gz
Algorithm Hash digest
SHA256 d37eb2d8aca9a655efc234d0038799a9cd7449c23127bd6ee97c58d673df4c72
MD5 aad2735d78e17b8f63a8feff41ec23c0
BLAKE2b-256 f97508e7747ac58ee3d66636abcdb510cf323fd36723a0d9e084bdf2ee437d08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.9.5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c5327cbc550032be7bcad1ecdebea04487227e47c944d832e5a2998263165e9c
MD5 2c50b280209b9c114714a086acdd2128
BLAKE2b-256 64cf1423f917446a3c3fdfec4b3e3c514404e958bb53db7d460c58a7f45daa7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.9.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2856290eb8995728f5081bab0e80791b4a57eea70690668464ce3bdeca9b49af
MD5 0c43acc5237d48464cb933b5cdc96f83
BLAKE2b-256 640e46a52be66ddcfb42f4c437d3d3e117487edf5e6a58234a11eb911d16dedb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prql_python-0.9.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 072f040cc216389ed3ce9f1fde763ec25cfc609ec3554884ff850a8d02b6a61b
MD5 1310edb354d5ea5706cb4de63bf76a30
BLAKE2b-256 e60ea9ed6c3e5e39492b7d6b6ec1b6058590fd06c5a72f590ba604a693bb4723

See more details on using hashes here.

File details

Details for the file prql_python-0.9.5-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.9.5-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a9d13039f27b94c409e1da572e741764311a25557e33f1c9a350e6c06a76f38f
MD5 9b058a18614f8505ad17bd9e8263b43b
BLAKE2b-256 ed19aefe6bb1bb73bef83dab0783e956550d43d246f1b334914d132b08a7974b

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