Skip to main content

alt text

Preql (pronounced: Prequel) is an interpreted relational query language.

It is designed for use by data engineers, analysts and data scientists.

  • Compiles to SQL at runtime. It has the performance and abilities of SQL, and much more.

    • Support for Postgres, MySQL and Sqlite. (more planned!)

    • Escape hatch to SQL, for all those database-specific features we didn't think to include

  • Programmer-friendly syntax and semantics, with gradual type-checking, inspired by Typescript and Python

  • Interface through Python, HTTP or a terminal environment with autocompletion

Note: Preql is still work in progress, and isn't ready for production use, or any serious use yet

Documentation

Read here

Get started

Simply install via pip:

    pip install -U prql

Then just run the interpreter:

    preql

Requires Python 3.8+

Read more

Quick Example

// Sum up all the squares of an aggregated list of numbers
// Grouped by whether they are odd or even
func sqrsum(x) = sum(x * x)
func is_even(x) = x % 2 == 0

print [1..100]{
        is_even(item) => sqrsum(item)
      }
// Result is:
┏━━━━━━━━━┳━━━━━━━━┓
┃ is_even ┃ sqrsum ┃
┡━━━━━━━━━╇━━━━━━━━┩
│       0 │ 166650 │
│       1 │ 161700 │
└─────────┴────────┘

In the background, this was run by executing the following SQL code (reformatted):

  WITH range1 AS (SELECT 1 AS item UNION ALL SELECT item+1 FROM range1 WHERE item+1<100)
     , subq_3(is_even, sqrsum) AS (SELECT ((item % 2) = 0) AS is_even, SUM(item * item) AS sqrsum FROM range1 GROUP BY 1)
  SELECT * FROM subq_3

License

Preql uses an “Interface-Protection Clause” on top of the MIT license.

See: LICENSE

In simple words, it can be used for any commercial or non-commercial purpose, as long as your product doesn't base its value on exposing the Preql language itself to your users.

If you want to add the Preql language interface as a user-facing part of your commercial product, contact us for a commercial license.

Metadata

Release files for prql 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prql 0.1.10
File Size Uploaded Provenance Actions
prql-0.1.10.tar.gz 66.8 kB Without provenance Details for prql-0.1.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prql 0.1.10
File Interpreter ABI Platform Actions
prql-0.1.10-py3-none-any.whl Python 3 none any Details for prql-0.1.10-py3-none-any.whl

Total release size: 142.8 kB

Release files / prql-0.1.10.tar.gz

Download URL prql-0.1.10.tar.gz
Size 66.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a1c269b0ac04e49e35957c6ab31e0deafdfdd68a921f850517b740b2e0f5babe
BLAKE2b-256 checksum
How to use checksums
f37d1ffe6c89520c2c4e11e16dd5d10370263d6f4597ce62aeab2a22a044f2d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.2 CPython/3.8.2 Windows/10

Release files / prql-0.1.10-py3-none-any.whl

Download URL prql-0.1.10-py3-none-any.whl
Size 75.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ceda2dd1b75946aae1665bf62c78c64132f0a1c5ac6dcaee53bc45d98c0b244
BLAKE2b-256 checksum
How to use checksums
72cc0e8fc442911e2f31bf1abe0088e6b8d77f5f962f63fb255a27ace18a2bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.2 CPython/3.8.2 Windows/10

Security for prql 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page