semvec/pypi-packages huggingface dataset:
redpanda 0.6.0
Pandas-ORM Integration.
Requires Python: >= 3.8

# RedPanda: Pandas & SQLAlchemy

![pypi](https://img.shields.io/pypi/v/redpanda?color=yellow&logo=python&logoColor=eee&style=flat-square)
![python](https://img.shields.io/pypi/pyversions/redpanda?logo=python&logoColor=eee&style=flat-square)
[![pytest](https://img.shields.io/github/actions/workflow/status/amancevice/redpanda/pytest.yml?logo=github&style=flat-square)](https://github.com/amancevice/redpanda/actions/workflows/pytest.yml)
[![coverage](https://img.shields.io/codeclimate/coverage/amancevice/redpanda?logo=code-climate&style=flat-square)](https://codeclimate.com/github/amancevice/redpanda/test_coverage)
[![maintainability](https://img.shields.io/codeclimate/maintainability/amancevice/redpanda?logo=code-climate&style=flat-square)](https://codeclimate.com/github/amancevice/redpanda/maintainability)

Two great tastes that taste great together.

Use RedPanda to add simple pandas integration into your declarative models.

## Installation

```bash
pip install redpanda
```

## Basic Use

Create a session from a SQLAlchemy engine:

```python
import redpanda

engine = redpanda.create_engine("sqlite://")
# => Engine(sqlite://)

Session = redpanda.orm.sessionmaker(bind=engine)
session = Session()
# => <sqlalchemy.orm.session.Session>
```

## Querying

Use the `frame()` method of RedPanda queries to return a DataFrame representation of the results instead of a collection of models.

```python
query = session.query(MyModel)
# => <redpanda.orm.Query>

query.frame()
# => <pandas.DataFrame>
```

### Querying with Filters

The `frame()` method that wraps the `pandas.read_sql()` function into a dialect-agnostic class-method for declarative SQLAlchemy models and can accept the same keyword arguments as `pandas.read_sql()`:

```python
query = session.query(MyModel).filter_by(my_attr="my_val")

query.frame(index_col="time")
```

Additionally, a `within()` method is added to SQLAlchemy's InstrumentedAttribute class that accepts a pandas Index object:

```python
index = pandas.period_range("2016-11-01", "2016-11-30", freq="W")
query = session.query(MyModel).filter(MyModel.timestamp.within(index))
```
knackhq 0.3.0
KnackHQ API Client
Requires Python: >= 3.7

# KnackHQ

![pypi](https://img.shields.io/pypi/v/knackhq?color=yellow&logo=python&logoColor=eee&style=flat-square)
![python](https://img.shields.io/pypi/pyversions/knackhq?logo=python&logoColor=eee&style=flat-square)
[![pytest](https://img.shields.io/github/actions/workflow/status/amancevice/knackhq/pytest.yml?logo=github&style=flat-square)](https://github.com/amancevice/knackhq/actions/workflows/pytest.yml)
[![coverage](https://img.shields.io/codeclimate/coverage/amancevice/knackhq?logo=code-climate&style=flat-square)](https://codeclimate.com/github/amancevice/knackhq/test_coverage)
[![maintainability](https://img.shields.io/codeclimate/maintainability/amancevice/knackhq?logo=code-climate&style=flat-square)](https://codeclimate.com/github/amancevice/knackhq/maintainability)

Python wrapper for [KnackHQ API](https://www.knack.com/developer-documentation/)

## Installation

```bash
pip install knackhq
```


## Connect to KnackHQ

Create a `KnackApp` instance to begin interacting with KnackHQ. Supply an app ID, an API key, and an optional API endpoint URL to the client:

```python
import knackhq

app = knackhq.KnackApp('<app_id>', '<api_key>')
```

Alternatively, set these values in your environment with:

* `KNACKHQ_APP_ID`
* `KNACKHQ_API_KEY`
* `KNACKHQ_ENDPOINT` (optional)

```python
app = knackhq.KnackApp()
```


## Reading from KnackHQ


### Raw requests

You may wish to send a raw request response from the KnackHQ API:

```python
app.request('GET', 'objects/object_1/records')  # or,
app.request('GET', 'objects', 'object_1', 'records')
```


### Getting Objects

Use dictionary syntax to get objects by name or key:

```python
obj = app['object_1']  # or,
obj = app['MyObject']
```

Access object metadata using dictionary syntax:

```python
obj['name']
obj['key']
obj['fields']
```

### Getting Records

Use the `get_records()` method to iterate over records in an object:

```python
for record in obj.get_records():
    print(record)
```

Supply arguments to `get_records()` to filter records. Options include:
* `record_id`
* `page`
* `rows_per_page`
* `sort_field`
* `sort_order`
* `filters`

Use `filters` to refine your search:

```python
filters = [
    {
        field: 'field_1',
        operator: 'is',
        value: 'test'
    }, {
        field: 'field_2',
        operator: 'is not blank'
    }
]

for record in obj.get_records(filters=filters):
    print(record)
```

If you know the ID of the record, use `get_record()` to return a single record:

```python
record = obj.get_record('1234567890ABCDEF')
```


## Writing Records

*TODO*
influxalchemy 0.3.0
InfluxDB Alchemy.
Requires Python: >= 3.7

# InfluxAlchemy

![pypi](https://img.shields.io/pypi/v/influxalchemy?color=yellow&logo=python&logoColor=eee&style=flat-square)
![python](https://img.shields.io/pypi/pyversions/influxalchemy?logo=python&logoColor=eee&style=flat-square)
[![pytest](https://img.shields.io/github/actions/workflow/status/amancevice/influxalchemy/pytest.yml?logo=github&style=flat-square)](https://github.com/amancevice/influxalchemy/actions/workflows/pytest.yml)
[![coverage](https://img.shields.io/codeclimate/coverage/amancevice/influxalchemy?logo=code-climate&style=flat-square)](https://codeclimate.com/github/amancevice/influxalchemy/test_coverage)
[![maintainability](https://img.shields.io/codeclimate/maintainability/amancevice/influxalchemy?logo=code-climate&style=flat-square)](https://codeclimate.com/github/amancevice/influxalchemy/maintainability)

Query InfluxDB using SQLAlchemy-style syntax

## Installation

```bash
pip install influxalchemy
```

## Usage

```python
import influxdb
import influxalchemy
```

### Define InfluxAlchemy Measurements

```python
class Widgets(influxalchemy.Measurement):
    __measurement__ = 'widgets'


class Wombats(influxalchemy.Measurement):
    __measurement__ = 'wombats'
```

The class-attribute `__measurement__` can be omitted and will default to the class name if absent.

### Open InfluxAlchemy Connection

```python
db = influxdb.DataFrameClient(database="example")
flux = influxalchemy.InfluxAlchemy(db)
```

## Query InfluxDB

### Query Single Measurement

```python
# SELECT * FROM widgets;
flux.query(Widgets)
```

### Query Ad Hoc Measurement

```python
# SELECT * from /.*/;
flux.query(influxalchemy.Measurement.new("/.*/"))
```

### Select Fields of Measurement

```python
# SELECT tag1, field2 FROM widgets;
flux.query(Widgets.tag1, Widgets.field2)
```

### Query Across Measurements

```python
# SELECT * FROM /widgets|wombats/;
flux.query(Widgets | Wombats)
```

### Filter Tags

```python
# SELECT * FROM widgets WHERE tag1 = 'fizz';
flux.query(Widgets).filter(Widgets.tag1 == "fizz")
```

### Filter Tags with 'like'

```python
# SELECT * FROM widgets WHERE tag1 =~ /z$/;
flux.query(Widgets).filter(Widgets.tag1.like("/z$/"))
```

### Chain Filters

```python
clause1 = Widgets.tag1 == "fizz"
clause2 = Widgets.tag2 == "buzz"

# SELECT * FROM widgets WHERE tag1 = 'fizz' AND tag2 = 'buzz';
flux.query(Widgets).filter(clause1 & clause2)

# SELECT * FROM widgets WHERE tag1 = 'fizz' OR tag2 = 'buzz';
flux.query(Widgets).filter(clause1 | clause2)
```

### Group By

```python
# SELECT * FROM widgets GROUP BY time(1d);
flux.query(Widgets).group_by("time(1d)")

# SELECT * FROM widgets GROUP BY tag1;
flux.query(Widgets).group_by(Widgets.tag1)
```

### Time

```python
# SELECT * FROM widgets WHERE (time > now() - 7d);
flux.query(Widgets).filter(Widgets.time > "now() - 7d")

# SELECT * FROM widgets WHERE time >= '2016-01-01' AND time <= now() - 7d;
d = date(2016, 1, 1)
flux.query(Widgets).filter(Widgets.time.between(d, "now() - 7d"))
```

Note that naive datetime object will be assumed in UTC timezone.