semvec/pypi-packages huggingface dataset:
odex 0.0.7
Python object index for fast, declarative retrieval
License: MIT
Requires Python: <4.0,>=3.7

# odex

Python object index for fast, declarative retrieval

## Install

```
pip install odex
```

## Usage

Odex provides a set-like collection called `IndexedSet`:

```python
from odex import IndexedSet, attr, and_

class X:
    def __init__(self, a, b):
        self.a = a
        self.b = b

iset = IndexedSet(
    [
        X(a=1, b=4),
        X(a=2, b=5),
        X(a=2, b=6),
        X(a=3, b=7),
    ], 
    indexes=["a"]
)

# Filter objects with SQL-like expressions:
iset.filter("a = 2 AND b = 5") == {X(a=2, b=5)}

# Or, using the fluent interface:
iset.filter(
    and_(
        attr("a").eq(2),
        attr("b").eq(5)
    )
) == {X(a=2, b=5)}
```

`IndexedSet` maintains indexes on the given attributes. There are three index types:
- `HashIndex` - based on `dict`. Only supports exact value queries (e.g. `a = 1`).
- `SortedDictIndex` - based on [Sorted Containers](https://github.com/grantjenks/python-sortedcontainers). Supports exact value _and_ range queries (e.g. `a > 1`), but has slower updates.
- `InvertedIndex` - based on `dict`, but supports collection attributes and queries like `'foo' IN tags`

When attribute names are given as indexes, the index type will be inferred from the given objects. Otherwise, explicit indexes can be given.

## Related projects

- [sqlglot](https://github.com/tobymao/sqlglot) - odex uses sqlglot for expression parsing
- [ducks](https://github.com/manimino/ducks) - similar project with different tradeoffs

## Benchmarks

See [comparisons.ipynb](benchmarks/comparisons.ipynb) for more.
sql-querify 0.1.2
An SQL interface for your everyday data
License: MIT
Requires Python: <4.0,>=3.11
Keywords: cli, sql, query

# Querify
![Build Status](https://github.com/badihio/querify/actions/workflows/deploy.yml/badge.svg)

Querify is a CLI tool that provides SQL interface for data sources.
It is useful for data manipulation using a standard interface for various data sources, and provides an SQL features that allows to query the data in a more convenient way, like `WHERE`, `GROUP BY`, `ORDER BY` and `LIMIT`.

## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.

```bash
pip install sql-querify
```
## Usage

```bash
qy <query>
```

## Examples
#### List all tables
```bash
qy "SHOW tables"
```
| table_name |
| ------ |
| dirs | 
| files |
| processes |

#### Describe a table
```bash
qy "DESC processes"
```
| field_name | data_type |
| ------ | ------ |
| pid| int |
| name| str|
| cmdline| str|
| status| str|
| username | str |
| cpu_pct | float|
| memory_pct | float |
| create_time| datetime |

#### Count processes by username
```bash
qy "SELECT username, COUNT(1) AS count FROM processes GROUP BY username ORDER BY count DESC"
```
| username | count |
| ------ | ------ |
| user1 |443 |
| root|215 |

#### Top 5 directories by size
```bash
qy "SELECT name, size_in_bytes/1024/1024 AS size_mb FROM dirs ORDER BY size_mb DESC LIMIT 5"
```
| name | size_mb |
| ------ | ------ |
| pydantic_core|4 |
| chardet|1 |
| distlib|1 |
| _vendor/rich/__pycache__ |1 |
| pip/_vendor/chardet|1 |

## Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.