# pyrophone.jq

*module*

JSON byte-stream filtering with the optional PyPI ``jq`` binding.

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/jq.py#L1-L1)

## pyrophone.jq.JQ

*class*

```python
class JQ(Node)
```

Bases: `pyrophone._node.Node`

Apply a jq program to each JSON payload, emitting zero or more results.

Each input is one complete JSON value encoded as bytes. Results are emitted
individually as compact UTF-8 JSON, preserving jq order and backpressure.
Unlike the one-to-one Transform base, jq can filter or expand messages.
Compilation and evaluation use synchronous bindings on the runtime loop.

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/jq.py#L32-L65)

### pyrophone.jq.JQ.expr

*attribute* · *class attribute* · *instance attribute*

```python
expr = Property[str](title='jq expression', description='jq expression applied to each JSON message, for example .count += 1. Live changes take effect on the next input message.')
```

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/jq.py#L42-L48)

### pyrophone.jq.JQ.in_port

*attribute* · *class attribute* · *instance attribute*

```python
in_port = Input[bytes](description='One complete JSON value per payload.')
```

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/jq.py#L49-L49)

### pyrophone.jq.JQ.out_port

*attribute* · *class attribute* · *instance attribute*

```python
out_port = Output[bytes](description='One JSON-encoded payload per jq result.')
```

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/jq.py#L50-L50)

### pyrophone.jq.JQ.run

*method* · *async*

```python
async def run() -> None
```

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/jq.py#L52-L65)

### pyrophone.jq.JQ.print

*method*

```python
def print(file: TextIO | None = None) -> None
```

Inherited from: `pyrophone._inspection.Printable`

Write a pretty multiline description, followed by a newline.

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/_inspection.py#L13-L15)
