Metadata-Version: 2.1
Name: pyprql
Version: 0.5.3
Summary: Python Implementation of Pipelined Relational Query Language (PRQL)
Home-page: https://github.com/prql/PyPrql
License: Apache-2.0
Author: qorrect
Author-email: charlie.fats@gmail.com
Requires-Python: >=3.7.1,<4.0.0
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Typing :: Typed
Requires-Dist: Pygments (>=2.11.2,<3.0.0)
Requires-Dist: SQLAlchemy (>=1.4.32,<2.0.0)
Requires-Dist: click (>=8.0.4,<9.0.0)
Requires-Dist: duckdb-engine (>=0.1.8,<0.2.0)
Requires-Dist: fuzzyfinder (>=2.1.0,<3.0.0)
Requires-Dist: icecream (>=2.1.2,<3.0.0)
Requires-Dist: ipython (>=7.33.0,<7.34.0); python_full_version >= "3.7.1" and python_full_version < "3.8.0"
Requires-Dist: ipython (>=8.0,<9.0); python_version >= "3.8" and python_version < "4.0"
Requires-Dist: ipython-sql (>=0.4.0,<0.5.0)
Requires-Dist: numpy (>=1.21,<1.22); python_full_version >= "3.7.1" and python_full_version < "3.8.0"
Requires-Dist: numpy (>=1.22.3,<2.0.0); python_version >= "3.8" and python_version < "4.0"
Requires-Dist: pandas (>=1.3,<1.4); python_full_version >= "3.7.1" and python_full_version < "3.8.0"
Requires-Dist: pandas (>=1.4,<2.0); python_version >= "3.8" and python_version < "4.0"
Requires-Dist: prompt-toolkit (>=3.0.28,<4.0.0)
Requires-Dist: prql-python (>=0,<1)
Requires-Dist: rich (>=12.0.0,<13.0.0)
Requires-Dist: traitlets (>=5.2.0,<6.0.0)
Project-URL: Repository, https://github.com/prql/PyPrql
Description-Content-Type: text/markdown

# PyPrql

[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
![PyPI - License](https://img.shields.io/pypi/l/pyprql)
![PyPI](https://img.shields.io/pypi/v/pyprql)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyprql)

[![Documentation Status](https://readthedocs.org/projects/pyprql/badge/?version=latest)](https://pyprql.readthedocs.io/en/latest/?badge=latest)
![Discord](https://img.shields.io/discord/936728116712316989)
![GitHub contributors](https://img.shields.io/github/contributors/prql/pyprql)
![GitHub Repo stars](https://img.shields.io/github/stars/prql/pyprql)

[![CI/CD](https://github.com/prql/PyPrql/actions/workflows/cicd.yaml/badge.svg?branch=main)](https://github.com/prql/PyPrql/actions/workflows/cicd.yaml)
[![codecov](https://codecov.io/gh/prql/PyPrql/branch/main/graph/badge.svg?token=C6J2UI7FR5)](https://codecov.io/gh/prql/PyPrql)

[![Codestyle: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

Python bindings to [PRQL][prql].  

For docs, Check out the [PyPRQL Docs](https://pyprql.readthedocs.io/), and the [PRQL Book][prql_docs].

This project is maintained by [@qorrect](https://github.com/qorrect/) and [@rbpatt2019](https://github.com/rbpatt2019)

## Installation

```bash
pip install pyprql
```

### Try it out

#### Database

```bash
curl https://github.com/qorrect/PyPrql/blob/main/resources/chinook.db?raw=true -o chinook.db
pyprql "sqlite:///chinook.db"

PRQL> show tables
```

#### CSV file

```bash
curl https://people.sc.fsu.edu/~jburkardt/data/csv/zillow.csv
pyprql zillow.csv
```

### The pyprql tool

* pyprql can connect to any database that SQLAlchemy supports, execute `pyprql` without arguments for docs on how to install drivers.
* pyprql can connect to CSV files,  replace the connection string with the file path and it will load the CSV into a temporary SQLite database.
* pyprql can save the results with a `| to csv ${filename}` transform at the end of the query
* pyprql has auto-completion on table names and table aliases with _tab_, and history-completion with _alt-f_

[prql]: https://github.com/prql/prql
[prql_docs]: https://prql-lang.org/reference

