Skip to content
/ phare Public

Asynchronous and ergonomic Python client SDK for a light installation at the University of Kiel

License

Notifications You must be signed in to change notification settings

fwcd/phare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phare

PyPI Build

An asynchronous and ergonomic client library for the Project Lighthouse API.

Example

import asyncio
import numpy as np
import os

from phare.auth import Auth
from phare.lighthouse import Lighthouse
from phare.constants import LIGHTHOUSE_FRAME_SHAPE, LIGHTHOUSE_URL

async def main():
    user = os.environ['LIGHTHOUSE_USER']
    token = os.environ['LIGHTHOUSE_TOKEN']
    url = os.environ.get('LIGHTHOUSE_URL', LIGHTHOUSE_URL)

    async with await Lighthouse.connect(Auth(user, token), url) as lh:
        frame = np.random.randint(0, 255, size=LIGHTHOUSE_FRAME_SHAPE, dtype=np.uint8)
        await lh.put_model(frame)

asyncio.run(main())

About

Asynchronous and ergonomic Python client SDK for a light installation at the University of Kiel

Topics

Resources

License

Stars

Watchers

Forks

Languages