Skip to main content

ci

pytewke

A Python client for local CoAP communications with Tewke devices

This library is under development

Usage

Install

pip install pytewke

Examples

Discovering Scenes and Targets

import asyncio
from pprint import pprint

from pytewke import Tap
from pytewke.error import PyTewkeDiscoveryError


async def test_device():
    """Test Tap Panel device."""
    # Replace with your device's IP address
    host = "w.x.y.z"

    try:
        async with Tap(host) as tap:
            print("Targets:")
            targets = await tap.get_targets()
            pprint(targets)

            print("Scenes:")
            scenes = await tap.get_scenes()
            pprint(scenes)
    except PyTewkeDiscoveryError as err:
        print(f"Error connecting to {host}, error: {repr(err)}")


if __name__ == "__main__":
    asyncio.run(test_device())

Example script

The repository includes an example script to quickly try it out.

Uncomment the relevant lines in example.py to run different examples like discovering resources, reading config, observing state, etc.

python3 example.py

Note: if you have not installed pytewke but have cloned the library instead, you will need to add the src folder to your PYTHONPATH:

PYTHONPATH="${PYTHONPATH}:/path/to/pytewke/src" python3 example.py

Development

Requirements

  • aiocoap
  • cbor2
  • pydantic

Note: Python versions older than 3.12 have not been tested.

Development requirements

Run the following command inside this folder

pip install .[dev]

Note: You will need to add the src folder to your PYTHONPATH when using the example script or while running tests.

Metadata

Release files for pytewke 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytewke 0.6.2
File Size Uploaded
pytewke-0.6.2.tar.gz 25.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytewke 0.6.2
File Interpreter ABI Platform
pytewke-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 MB

Release files / pytewke-0.6.2.tar.gz

Download URL pytewke-0.6.2.tar.gz
Size 25.7 MB
Tags Source
SHA-256 checksum
How to use checksums
0caeaea0fa97654b448ecf2e3c92398c70cdd8fac9e71f24f2d14f5e92f5da52
BLAKE2b-256 checksum
How to use checksums
0c06591bba29f3eea385300e2c166ffd1a725199a0ef3d1bc8a01a2a1d513510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pytewke-0.6.2-py3-none-any.whl

Download URL pytewke-0.6.2-py3-none-any.whl
Size 26.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec471aa385ad464748d5dd989384090fe3f069058674959bfe171613abe5dba4
BLAKE2b-256 checksum
How to use checksums
fdc9e431b42418d154b8fbf37a42291639b386c4fc27c6523b23497e44524203
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.7.1

2 release files

0.7.0

2 release files

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page