Metadata-Version: 2.1
Name: LoQL
Version: 1.0.0
Summary: Terminal based SQL client for local data
Home-page: https://github.com/dannyboland/loql
License: MIT
Author: Danny Boland
Author-email: danny@boland.dev
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Dist: duckdb (>=1.0,<2.0)
Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
Requires-Dist: pandas (>=2.2,<3.0)
Requires-Dist: pyarrow (>=17.0,<18.0)
Requires-Dist: textual[syntax] (>=0.73.0,<0.74.0)
Requires-Dist: xlrd (>=2.0.1,<3.0.0)
Description-Content-Type: text/markdown

# LoQL

![screenshot](./img/loql_iris.png)

LoQL is a command line sql client for individual data files, allowing these to be queried (even joined) and viewed. It natively supports CSV, parquet and other formats.

## Data Formats
The following file types can be opened as views in LoQL:
- csv
- parquet(.gz)
- json(l)
- xls(x)
- clipboard
- ...

## Usage

This package can be installed with:

```bash
pipx install loql
```

and executed via:

```bash
loql
```

### Arguments

If a filename is supplied as an argument to LoQL then it will open the data file as a view.

If a directory is supplied then the open file view will start in that location.

For example:

```bash
loql data/iris.csv
```

The contents of the clipboard can be converted into a view (e.g. after copying from Google Sheets), using the `--clipboard` argument:

```bash
loql --clipboard
```

## Advanced Usage
New views can be created from an opened file. For example if `iris.csv` was opened as the view `iris`, then we could create a new view:
```sql
create view iris_variety as (
    select
        variety,
        avg("petal.length") as avg_petal_length
    from iris
    group by variety
)
```

![create view](./img/loql_iris_variety.png)

Views can be joined together, for example:
```sql
select * from iris natural join iris_variety
```

![join](./img/loql_iris_join.png)

