Metadata-Version: 2.4
Name: pyepics-asyncio
Version: 0.4.0
Summary: Async/await wrapper for PyEpics
Project-URL: Homepage, https://github.com/agerasev/pyepics-asyncio
Project-URL: Repository, https://github.com/agerasev/pyepics-asyncio
Author-email: Alexey Gerasev <alexey.gerasev@gmail.com>
License: MIT
License-File: LICENCE
Keywords: async,asyncio,await,epics,pyepics
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Requires-Dist: pyepics~=3.5
Description-Content-Type: text/markdown

# pyepics-asyncio

Simple `async`/`await` wrapper for [PyEpics](https://github.com/pyepics/pyepics).

## Overview

There are two main types:
+ `PvMonitor` - subscribed to PV updates, `get` returns last received value.
+ `Pv` - connected but not subscribed, each `get` requests PV value over network.

## Usage

### Connect to PV

```python
from pyepics_asyncio import Pv

pv = await Pv.connect("pvname")
```

### Write value to PV

```python
await pv.put(3.1415)
```

### Read value from PV

```python
print(await pv.get())
```

### Monitor PV value updates

```python
with pv.monitor() as mon:
    async for value in mon:
        print(value)
```

## Testing

To run tests you need to have dummy IOC running (located in `ioc` dir):

+ Set appropriate `EPICS_BASE` path in `configure/RELEASE`.
+ Build with `make`.
+ Go to `iocBoot/iocTest/` and run script `st.cmd` and don't stop it.

In separate shell run `uv run pytest --verbose`.
