Skip to main content

Python client to talk to WatchYourLAN APIs

Project description

watchyourlanclient

Python API client to interact with WatchYourLAN

Example usage

async def main_async():
    api_client = WatchYourLANAPI(base_url="http://localhost:8840", async_mode=True)

    try:
        # Get all hosts
        hosts = await api_client.get_all_hosts()
        print("Async Hosts:", hosts)

        # Get history for a specific MAC
        history = await api_client.get_host_history("00:11:22:33:44:55")
        print("Async Host History:", history)

        # Get port state
        port_state = await api_client.get_port_state("192.168.1.10", 80)
        print("Async Port State:", port_state)

    finally:
        await api_client.close()

def main_sync():
    api_client = WatchYourLANAPI(base_url="http://localhost:8840", async_mode=False)

    try:
        # Get all hosts
        hosts = api_client.get_all_hosts()
        print("Sync Hosts:", hosts)

        # Get history for a specific MAC
        history = api_client.get_host_history("00:11:22:33:44:55")
        print("Sync Host History:", history)

        # Get port state
        port_state = api_client.get_port_state("192.168.1.10", 80)
        print("Sync Port State:", port_state)

    finally:
        api_client.close_sync()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

watchyourlanclient-2024.1007a0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

watchyourlanclient-2024.1007a0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file watchyourlanclient-2024.1007a0.tar.gz.

File metadata

File hashes

Hashes for watchyourlanclient-2024.1007a0.tar.gz
Algorithm Hash digest
SHA256 26334e75a35b365e4d2603191ac827adc0390b81492cdab4f1e1396301ea78db
MD5 858d2cf5f7abd3e0ed5bf8d3cd20c563
BLAKE2b-256 fa48b60ee0f08d5b076701a7f433755a86fc1f0afd65119b10bc6c47b14c71ee

See more details on using hashes here.

File details

Details for the file watchyourlanclient-2024.1007a0-py3-none-any.whl.

File metadata

File hashes

Hashes for watchyourlanclient-2024.1007a0-py3-none-any.whl
Algorithm Hash digest
SHA256 aee4fef933b1f6b8cddc2b801ad46ff0cc4d99ac09da8e421609a248bb7c87aa
MD5 cb1aa01bdddf02b9289799adb67a1bc5
BLAKE2b-256 818426f50788e8e72a381f60c705b989f17c63f29bef21e5fb5792876f337c2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page