prql-python


Nameprql-python JSON
Version 0.11.2 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-02-08 00:52:54
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/prql/pyprql) &
[dbt-prql](https://github.com/prql/dbt-prql).

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

## Installation

`pip install prql-python`

## Usage

```python
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](https://github.com/PyO3/pyo3) for all the magic.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "prql-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4a/fd/4925e221ca85fdee1024a72db67a5caae2bfffe2cadad2ca467782ad19d2/prql_python-0.11.2.tar.gz",
    "platform": null,
    "description": "# prql-python\n\n`prql-python` offers Rust bindings to the `prql-compiler` Rust library. It\nexposes a Python method `compile(query: str) -> str`.\n\nThis is consumed by [pyprql](https://github.com/prql/pyprql) &\n[dbt-prql](https://github.com/prql/dbt-prql).\n\nThe crate is not published to crates.io; only to PyPI at\nhttps://pypi.org/project/prql-python/.\n\n## Installation\n\n`pip install prql-python`\n\n## Usage\n\n```python\nimport prql_python as prql\n\nprql_query = \"\"\"\n    from employees\n    join salaries (==emp_id)\n    group {employees.dept_id, employees.gender} (\n      aggregate {\n        avg_salary = average salaries.salary\n      }\n    )\n\"\"\"\n\noptions = prql.CompileOptions(\n    format=True, signature_comment=True, target=\"sql.postgres\"\n)\n\nsql = prql.compile(prql_query)\nsql_postgres = prql.compile(prql_query, options)\n```\n\nRelies on [pyo3](https://github.com/PyO3/pyo3) for all the magic.\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": null,
    "version": "0.11.2",
    "project_urls": {
        "Source Code": "https://github.com/PRQL/prql"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5ea362cf5378fd1fb153fda4aa8a101af65b1bd2f20462a35a1cb240cbb10afa",
                "md5": "10d6a09130fbb4c91984db6354f56655",
                "sha256": "77472d54e40920012465170d2c18e55f968ef242051411f963358aa64fe8a707"
            },
            "downloads": -1,
            "filename": "prql_python-0.11.2-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "has_sig": false,
            "md5_digest": "10d6a09130fbb4c91984db6354f56655",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.8",
            "size": 5309443,
            "upload_time": "2024-02-08T00:52:45",
            "upload_time_iso_8601": "2024-02-08T00:52:45.467950Z",
            "url": "https://files.pythonhosted.org/packages/5e/a3/62cf5378fd1fb153fda4aa8a101af65b1bd2f20462a35a1cb240cbb10afa/prql_python-0.11.2-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a72f4e5723a0e10999e452509ef349a0850ebc54dbe77fdf34299a25b43a2394",
                "md5": "71048b993dbd3d311e72cdfaba482175",
                "sha256": "7df71fb962c6fbd65bd28555f46a1d20d3b7c5aa684989c3351822e6d10e9228"
            },
            "downloads": -1,
            "filename": "prql_python-0.11.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "71048b993dbd3d311e72cdfaba482175",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.8",
            "size": 3964007,
            "upload_time": "2024-02-08T00:52:48",
            "upload_time_iso_8601": "2024-02-08T00:52:48.089920Z",
            "url": "https://files.pythonhosted.org/packages/a7/2f/4e5723a0e10999e452509ef349a0850ebc54dbe77fdf34299a25b43a2394/prql_python-0.11.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "626c5a67c02f4cf12b830656b3719f53452d7a73aebcdddef43abf4e3af12665",
                "md5": "f0bd764e1a7ead0845456af7d9490fcd",
                "sha256": "8b3d2b3a0fc88f5b5f2d84ed625ee5636ca1d2f19c4c3c5ce0efd5e7b3dc25b5"
            },
            "downloads": -1,
            "filename": "prql_python-0.11.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f0bd764e1a7ead0845456af7d9490fcd",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.8",
            "size": 4004740,
            "upload_time": "2024-02-08T00:52:49",
            "upload_time_iso_8601": "2024-02-08T00:52:49.860347Z",
            "url": "https://files.pythonhosted.org/packages/62/6c/5a67c02f4cf12b830656b3719f53452d7a73aebcdddef43abf4e3af12665/prql_python-0.11.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3cf2675108d49f39fa017abd6324bb49881646e1106a77bf6f7068a5ce969525",
                "md5": "4ef32367274865f329dc86e8b21b9ad6",
                "sha256": "78bf105a542421251463b33e2026ffb9dca6cdf0cc8a2194734cc57558513192"
            },
            "downloads": -1,
            "filename": "prql_python-0.11.2-cp37-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "4ef32367274865f329dc86e8b21b9ad6",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.8",
            "size": 2187438,
            "upload_time": "2024-02-08T00:52:52",
            "upload_time_iso_8601": "2024-02-08T00:52:52.612990Z",
            "url": "https://files.pythonhosted.org/packages/3c/f2/675108d49f39fa017abd6324bb49881646e1106a77bf6f7068a5ce969525/prql_python-0.11.2-cp37-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4afd4925e221ca85fdee1024a72db67a5caae2bfffe2cadad2ca467782ad19d2",
                "md5": "e2c232769dc821785916f073d67f9312",
                "sha256": "79924121c1cf4ae3b96a23753851f84ec0bf69f84524867ab17875d4657cd7e9"
            },
            "downloads": -1,
            "filename": "prql_python-0.11.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e2c232769dc821785916f073d67f9312",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 440065,
            "upload_time": "2024-02-08T00:52:54",
            "upload_time_iso_8601": "2024-02-08T00:52:54.655674Z",
            "url": "https://files.pythonhosted.org/packages/4a/fd/4925e221ca85fdee1024a72db67a5caae2bfffe2cadad2ca467782ad19d2/prql_python-0.11.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-08 00:52:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PRQL",
    "github_project": "prql",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "prql-python"
}
        
Elapsed time: 0.19232s