Metadata-Version: 2.3
Name: sowwic-nyx-bridge
Version: 1.0.0
Summary: TCP bridge between Nyx and external processes (Blender, Maya, any Python)
Keywords: nyx,bridge,tcp,remote execution,dcc,maya,blender
Author: sowwic
Author-email: sowwic <47799401+sowwic@users.noreply.github.com>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/sowwic/nyx-bridge
Project-URL: Documentation, https://sowwic.github.io/nyx-bridge/
Project-URL: Issues, https://github.com/sowwic/nyx-bridge/issues
Project-URL: Changelog, https://github.com/sowwic/nyx-bridge/blob/main/CHANGELOG.rst
Description-Content-Type: text/markdown

# nyx-bridge

![Tests](https://github.com/sowwic/nyx-bridge/actions/workflows/tests.yml/badge.svg)
![Lint](https://github.com/sowwic/nyx-bridge/actions/workflows/lint.yml/badge.svg)

TCP bridge between [Nyx](https://github.com/sowwic/nyx) and external processes
(Blender, Maya, any Python).

Nyx runs a `BridgeServer`. The external process runs a `NyxClient`, connects out,
and executes the code the server sends. Standard library only; the client side
supports Python 3.11+ (Maya 2027, Blender), so it can be installed into a DCC's Python
(e.g. `pip install --target <modules dir>`).

## Install

```bash
pip install sowwic-nyx-bridge
```

## Use

In the external process:

```python
from nyx_bridge.client import NyxClient

NyxClient().serve_forever()  # address from NYX_BRIDGE_ADDRESS / NYX_BRIDGE_TOKEN
```

On the Nyx side:

```python
from nyx_bridge.server import BridgeServer

with BridgeServer() as server:
    session = server.wait_for_client(timeout=30)
    print(session.execute("result = 6 * 7").value)   # 42
```

On the same machine the client finds a running Nyx through its address file, so no
configuration is needed. See the [documentation](https://sowwic.github.io/nyx-bridge/) for the
client and server in detail, the wire protocol and how to write a client for a new
application.

## Development

```bash
uv sync
make check       # ruff + pytest
make mkdocs      # docs
make help        # all targets, including pypi-publish
```
