Metadata-Version: 2.4
Name: heracles-ql
Version: 0.1.1
Summary: heralces-ql VictoriaMetrics DSL
Author-email: Hudson River Trading LLC <opensource@hudson-trading.com>
License-File: LICENSE
Requires-Python: >=3.11
Provides-Extra: config
Requires-Dist: pydantic>=2.11.7; extra == 'config'
Requires-Dist: pyyaml>=6.0.2; extra == 'config'
Description-Content-Type: text/markdown

# HeraclesQL - A Python DSL for writing VictoriaMetrics Queries

### 🚧 HeraclesQL is available now, but this repo is still under construction! 🚧

HeraclesQL is a Python package which provides a type-safe embedded domain specific language for
writing VictoriaMetrics MetricsQL queries.

Highlights include:
  - MetricsQL-like syntax - HeraclesQL will be immediately familiar to anyone who's written MetricsQL or PromQL!
  - Custom Functions and Parameterizable Expressions - No more copy and pasting behavior between alerts!
  - Static Type Safety - MyPy and your editor will catch common problems before they occur!
  - Variables - Complicated alerts can be expressed imperatively!
  - Meta-alerts - Generate alerts about your alerts to avoid common pitfalls!

## Installation

HeraclesQL is available on PyPi. Just `pip install heracles-ql`

HeraclesQL depends on native code in a few places. Right now, we provide binaries for `manylinux_2_34_x86_64`.

Otherwise, we provide an sdist that includes the native source code. In order to build the sdist, you'll need a
modern Go compiler.

## Example

HeraclesQL lets you write MetricsQL queries as Python. For example,

```python
from heracles import ql

v = ql.Selector()

my_query = ql.rate(v.my_interesting_metric(useful="label")[5 * ql.Minute])

print(ql.format(my_query.render()))

# rate(my_interesting_metric{useful="label"}[5m])
```
