Metadata-Version: 2.5
Name: sqlalchemy-openobserve
Version: 0.0.1
Summary: SQLAlchemy dialect and DBAPI driver for OpenObserve
Project-URL: Repository, https://github.com/sqlalchemy-openobserve/sqlalchemy-openobserve
Author: Milen Thomas
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: requests>=2.31
Requires-Dist: sqlalchemy<2.1,>=2.0.52
Provides-Extra: dev
Requires-Dist: mypy<2.0.0,>=1.18.2; extra == 'dev'
Requires-Dist: pytest<9.0.0,>=8.4.2; extra == 'dev'
Requires-Dist: ruff<0.17.0,>=0.16.8; extra == 'dev'
Description-Content-Type: text/markdown

# sqlalchemy-openobserve

A SQLAlchemy dialect and DBAPI driver for [OpenObserve](https://openobserve.ai),
built so that Apache Superset can connect to it.

> **Status: pre-alpha.** Nothing here works yet. Do not install it.

## What this will be

OpenObserve is queried with SQL over an HTTP API. This package exposes it to
SQLAlchemy so tools built on SQLAlchemy can read from it. It is read-only.

The Superset side (the DB engine spec) will live in the Apache Superset
repository, not here.

## Planned connection string

```
openobserve://{email}:{password}@{host}:{port}/{organization}
```

- The username is your OpenObserve email. Write its `@` as `%40`, for example
  `root%40example.com`, and percent-encode any special characters in the
  password the same way.
- HTTPS will be used by default, with `?ssl=false` for a plain HTTP server
  such as a local one on port 5080.
- `openobserve+rest://` is the same thing with the driver named explicitly.

## Requirements

Python 3.11 or newer, SQLAlchemy 2.0.52 or newer in the 2.0 series.

## Development

```bash
pip install -e ".[dev]"
```

The checks that CI runs on every pull request:

```bash
ruff check .
ruff format --check .
mypy --strict src
pytest
```

### A local OpenObserve

To try code against a real server, start OpenObserve in Docker and load the
sample data:

```bash
docker compose up -d
python3 scripts/load_sample_data.py
```

This gives you a logs stream named `app_logs` with 3,000 rows from the last
48 hours. Running the script again adds another 3,000 rows.

| | |
|---|---|
| URL | http://localhost:5080 |
| Organization | `default` |
| Email | `root@example.com` |
| Password | `Complexpass#123` |

The web UI is at the same URL. Stop the server, and delete its data, with
`docker compose down`.

## Licence

Apache-2.0. This package is an HTTP client and contains no OpenObserve
server code.
