Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate TUI #93

Merged
merged 2 commits into from
Dec 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ coverage.xml
.coverage
.ipynb_checkpoints
dist
.dmypy.json
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,44 @@
![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)
[![CI/CD](https://github.com/prql/PyPrql/actions/workflows/pull-request.yaml/badge.svg?branch=main)](https://github.com/prql/PyPrql/actions/workflows/pull-request.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/)

PyPRQL contains these tools:
PyPRQL contains

- pyprql.pandas_accessor - Pandas integration for PRQL
- pyprql.magic - IPython magic for connecting to databases using `%%prql`
- pyprql.cli - TUI for databases using PRQL

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

This project is maintained by [@charlie-sanders](https://github.com/charlie-sanders/) and [@rbpatt2019](https://github.com/rbpatt2019)
This project was created by
[@charlie-sanders](https://github.com/charlie-sanders/) &
[@rbpatt2019](https://github.com/rbpatt2019) and is now maintained by the
broader PRQL team.

## Installation

```bash
pip install pyprql
```

### Try out the Pandas integration
## Examples

### Pandas integration

```python
import pandas as pd
import pyprql.pandas_accessor

df = (...)
results_df = df.prql.query('select [age,name,occupation] | filter age > 21')

```

### Try out the Jupyter Magic
### Jupyter Magic

```python
In [1]: %load_ext pyprql.magic
Expand All @@ -59,20 +63,4 @@ In [4]: %%prql results <<

```

### Try out the TUI

With a CSV file:

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

With a Database:

```bash
pyprql 'postgresql://user:password@localhost:5432/database'
PRQL> show tables
```

[prql_docs]: https://prql-lang.org/reference
6 changes: 0 additions & 6 deletions mypy.ini

This file was deleted.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ profile = "black"
skip_gitignore = true

[tool.mypy]
disable_error_code = ["union-attr", 'operator']
exclude = "/tests/"
files = "pyprql"
# TODO: ideally we would list the modules that aren't yet typed
ignore_missing_imports = true

[build-system]
build-backend = "poetry.core.masonry.api"
Expand Down
13 changes: 13 additions & 0 deletions pyprql/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
"""The command line interface implementation for PyPRQL."""
import sys
import warnings
from typing import List, Optional

from pyprql.cli.cli import CLI

warnings.warn(
"""
Currently the is unfortunately deprecated, since the original creators are no
longer actively maintaning it. It was a valiant effort, and of the first things that
was built on top of PRQL. But it's a big project that requires work to keep it
current.

If anyone would be interested in taking it over, please feel free to start contributing.
""",
DeprecationWarning,
)


def main(params: Optional[List[str]] = None) -> None:
"""Serve the CLI entrypoint.
Expand Down