Python client to talk to WatchYourLAN APIs
Project description
watchyourlanclient
Python API client to interact with WatchYourLAN
Example usage
from watchyourlanclient import WatchYourLANClient
async def main_async():
api_client = WatchYourLANClient(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 = WatchYourLANClient(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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file watchyourlanclient-2024.1008a0.tar.gz.
File metadata
- Download URL: watchyourlanclient-2024.1008a0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f740e5587501e6a636f4bd6a0a7dd87faacca5d70bd3a0839c90b0ef38403143
|
|
| MD5 |
8cb511220d4a07eab85c57844a0ec97d
|
|
| BLAKE2b-256 |
a2ed235cb728dcbe78a8c54fe36e72da0a1ea4c2f67c5bd5053288acc4724013
|
File details
Details for the file watchyourlanclient-2024.1008a0-py3-none-any.whl.
File metadata
- Download URL: watchyourlanclient-2024.1008a0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8260bd56618bfabc20e1376cbe2d8dea5d05b4e414ed6c782251d5e0e7dc036
|
|
| MD5 |
a74ccd58dfb342ad647af0fc88e9b204
|
|
| BLAKE2b-256 |
1660fdf3707655d6bfd9d8b7a23b707c39337aaa4f32e4acaf1c7e4899e086bc
|