GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - labthings/python-labthings-client: A simple Python client for LabThings devices

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
labthings_client
labthings_client
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
changelog.config.js
changelog.config.js
 
 
poetry.lock
poetry.lock
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

LabThings Python Client

LabThings PyPI

This is an (extremely early) minimal Python client for Lab Things and Mozilla Web Things

Installation

pip install labthings-client

Usage example

import atexit
from labthings_client.discovery import ThingBrowser

# Create a Thing discoverer
browser = ThingBrowser().open()
# Close the discoverer when this script exits
atexit.register(browser.close)

# Wait for the first found LabThing on the network
thing = browser.wait_for_first()

Managing properties

>>> thing.properties
{'pdfComponentMagicDenoise': <affordances.Property object at 0x00000288F4095548>}

>>> thing.properties.pdfComponentMagicDenoise.set(500) 
500

>>> thing.properties.pdfComponentMagicDenoise.get()    
500

>>> 

Managing actions

>>> thing.actions
{'averageDataAction': <affordances.Action object at 0x00000288F40955C8>}

>>> thing.actions.averageDataAction.args
{'type': <class 'dict'>,
 'properties': {'n': {'format': 'int32',
                      'required': True,
                      'type': <class 'int'>},
                'optlist': {'example': [1, 2, 3],
                            'items': {'format': 'int32', 'type': <class 'int'>},
                            'nullable': True,
                            'required': False,
                            'type': <class 'list'>}},
}

>>> thing.actions.averageDataAction(n=10)       
<tasks.ActionTask object at 0x00000288F40D1348>

>>> thing.actions.averageDataAction(n=10).wait()
[0.0013352326078147302, 0.0008734229673564006, 0.0009756767699519994, 0.0008614760409831329, ...

>>> 

About

A simple Python client for LabThings devices

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

2 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.