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.0

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.0
File Size Uploaded
pytewke-0.6.0.tar.gz 17.3 MB Details

Built distribution (wheel)

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

Total release size: 17.3 MB

Release files / pytewke-0.6.0.tar.gz

Download URL pytewke-0.6.0.tar.gz
Size 17.3 MB
Tags Source
SHA-256 checksum
How to use checksums
625179d60a30a529369121a25608e6a57314ec5d0649086703963a6adb8b0437
BLAKE2b-256 checksum
How to use checksums
e271615971d55291c8e9f84512b677682889a0f2a40b01b148a2442116dfd21f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL pytewke-0.6.0-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
295fed502c56a970c42001e50a86e2d78a7267a0692469766081d5b867ce77f0
BLAKE2b-256 checksum
How to use checksums
76bea5f0ab39f96d6dadaf96278519417f76d3b320af0c1935e5f64d243d410b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

This release

0.6.0 This release

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