# 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 `poetry run pytest --verbose`.
Raw data
{
"_id": null,
"home_page": "https://github.com/agerasev/pyepics-asyncio",
"name": "pyepics-asyncio",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "pyepics,epics,asyncio,async,await",
"author": "Alexey Gerasev",
"author_email": "alexey.gerasev@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fd/43/a8bd052e38bd0b3644b80c75c5a9aa7f1380a0ed2cfe9a7f89798f7bcfb9/pyepics_asyncio-0.3.0.tar.gz",
"platform": null,
"description": "# pyepics-asyncio\n\nSimple `async`/`await` wrapper for [PyEpics](https://github.com/pyepics/pyepics).\n\n## Overview\n\nThere are two main types:\n+ `PvMonitor` - subscribed to PV updates, `get` returns last received value.\n+ `Pv` - connected but not subscribed, each `get` requests PV value over network.\n\n## Usage\n\n### Connect to PV\n\n```python\nfrom pyepics_asyncio import Pv\n\npv = await Pv.connect(\"pvname\")\n```\n\n### Write value to PV\n\n```python\nawait pv.put(3.1415)\n```\n\n### Read value from PV\n\n```python\nprint(await pv.get())\n```\n\n### Monitor PV value updates\n\n```python\nwith pv.monitor() as mon:\n async for value in mon:\n print(value)\n```\n\n## Testing\n\nTo run tests you need to have dummy IOC running (located in `ioc` dir):\n\n+ Set appropriate `EPICS_BASE` path in `configure/RELEASE`.\n+ Build with `make`.\n+ Go to `iocBoot/iocTest/` and run script `st.cmd` and don't stop it.\n\nIn separate shell run `poetry run pytest --verbose`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async/await wrapper for PyEpics",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/agerasev/pyepics-asyncio",
"Repository": "https://github.com/agerasev/pyepics-asyncio"
},
"split_keywords": [
"pyepics",
"epics",
"asyncio",
"async",
"await"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b367857fb226f833d8828ad575d6216f2922f10c6fa4f46ae97de6592c9e283f",
"md5": "434fe9e29bfdb9f372d48ee5062217b6",
"sha256": "7532635e7739189ecc485526b7be58457cda6d93ede3dde429da4f1da3a4bee7"
},
"downloads": -1,
"filename": "pyepics_asyncio-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "434fe9e29bfdb9f372d48ee5062217b6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 4297,
"upload_time": "2023-07-14T14:23:46",
"upload_time_iso_8601": "2023-07-14T14:23:46.821451Z",
"url": "https://files.pythonhosted.org/packages/b3/67/857fb226f833d8828ad575d6216f2922f10c6fa4f46ae97de6592c9e283f/pyepics_asyncio-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd43a8bd052e38bd0b3644b80c75c5a9aa7f1380a0ed2cfe9a7f89798f7bcfb9",
"md5": "7667f66a8fd9b4b2933a88a76fa28cc7",
"sha256": "a011c8165522e7187df7843012b6ac44757674fdd45779092734bc9ae9801a57"
},
"downloads": -1,
"filename": "pyepics_asyncio-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "7667f66a8fd9b4b2933a88a76fa28cc7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 4065,
"upload_time": "2023-07-14T14:23:48",
"upload_time_iso_8601": "2023-07-14T14:23:48.235376Z",
"url": "https://files.pythonhosted.org/packages/fd/43/a8bd052e38bd0b3644b80c75c5a9aa7f1380a0ed2cfe9a7f89798f7bcfb9/pyepics_asyncio-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-14 14:23:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "agerasev",
"github_project": "pyepics-asyncio",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyepics-asyncio"
}