Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwesterhausen/pyblueiris
Async Python Library for Blue Iris JSON API
https://github.com/nwesterhausen/pyblueiris
Last synced: 6 days ago
JSON representation
Async Python Library for Blue Iris JSON API
- Host: GitHub
- URL: https://github.com/nwesterhausen/pyblueiris
- Owner: nwesterhausen
- License: gpl-3.0
- Created: 2019-01-05T03:49:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T11:54:57.000Z (about 1 year ago)
- Last Synced: 2024-12-29T02:35:02.546Z (8 days ago)
- Language: Python
- Homepage: https://pypi.org/project/pyblueiris/
- Size: 889 KB
- Stars: 7
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
## Blue Iris Python Library
An async python library for the Blue Iris JSON API.
## Overview
For more in-depth documentation, visit [the documentation](https://nwesterhausen.github.io/pyblueiris/).Creating a BlueIris object requires you provide an async web session for it.
```python
import pyblueiris
from aiohttp import ClientSession
import asyncioPROTOCOL = 'http'
HOST = '192.168.1.5'
USER = 'pyserv'
PASS = 'secret-password'async def main():
async with ClientSession(raise_for_status=True) as sess:
blue = pyblueiris.BlueIris(sess, USER, PASS, PROTOCOL, HOST)
if __name__ == '__main__':
asyncio.run(main())
```From there you can simply call a command you want it to execute. There is a command `update_all_information()` which will call all data-gathering commands to fill out information about the server.
```python
def main():
async with ClientSession(raise_for_status=True) as sess:
blue = pyblueiris.BlueIris(sess, USER, PASS, PROTOCOL, HOST)
await blue.update_all_information()
```All of the information the BlueIris object knows about the server is stored in the attributes property \(dictionary\).
```python
print(blue.attributes)
```