Metadata-Version: 2.5
Name: bare-sidecar
Version: 0.1.3
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, each running Bare alongside the application with an IPC to it exposed as `Bare.IPC` inside the process.

```
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))
```

### Versions

`versions` holds the versions of the components bundled with the sidecar, such as the Bare runtime:

```python
from bare_sidecar import versions

versions["bare"]  # "1.36.2"
```

## License

Apache-2.0
