Metadata-Version: 2.5
Name: bare-sidecar
Version: 0.1.1
Summary: Start and manage Bare sidecar processes from Python
Project-URL: Homepage, https://github.com/holepunchto/bare-sidecar-python
Project-URL: Repository, https://github.com/holepunchto/bare-sidecar-python
Project-URL: Issues, https://github.com/holepunchto/bare-sidecar-python/issues
Author: Holepunch
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# bare-sidecar-python

Start and manage Bare sidecar processes from Python. The Python counterpart of [bare-sidecar](https://github.com/holepunchto/bare-sidecar): it runs a Bare entry point in a child process with an IPC connection to it, exposed as `Bare.IPC` inside the process. The Bare executable is shipped in platform wheels.

```
pip install bare-sidecar
```

## Usage

```python
import asyncio

from bare_sidecar import spawn


async def main():
    async with await spawn("app.js") as sidecar:
        await sidecar.write(b"Hello world")

        async for data in sidecar:
            print(data)


asyncio.run(main())
```

Where `app.js` is a Bare entry point using `Bare.IPC`:

```js
Bare.IPC.on('data', (data) => Bare.IPC.write(data))
```

## License

Apache-2.0
