Module to communicate to the Youfone API
Project description
aioyoufone
Asynchronous library to communicate with the Youfone API
API Example
"""Test for aioyoufone."""
from aioyoufone import YoufoneClient
import json
import asyncio
import logging
# Setup logging
logger = logging.getLogger(__name__)
async def main():
client = YoufoneClient(
"user@email.com",
"YourPassword",
"nl",
None,
True
)
try:
customer_data = await client.fetch_data()
if isinstance(customer_data, dict) and 'error' in customer_data:
logging.error("Error occurred while retrieving customer data: %s", customer_data['error'])
else:
logging.info("Customer data retrieved successfully: %s", json.dumps(customer_data, indent=4, sort_keys=True))
except Exception as e:
logging.error("Error occurred while retrieving customer data: %s", str(e))
finally:
await client.close_session()
logging.basicConfig(level=logging.INFO)
asyncio.run(main())
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
aioyoufone-0.2.2.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file aioyoufone-0.2.2.tar.gz
.
File metadata
- Download URL: aioyoufone-0.2.2.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 328999ca371361afbe7ce54e5b761283674e86756876bbbff6518764a69dadec |
|
MD5 | 54854bde2332e471772caf7c6f49c54a |
|
BLAKE2b-256 | 2d7fad450bd863828ee9d910f6a5baace116a431eb9739cd6f30b5d9eca3a522 |
File details
Details for the file aioyoufone-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: aioyoufone-0.2.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c08ff4d26d7f076ac73ad0a0f3e7a65c64c5e25bc3c830e66ab12bbdd0cdd6ff |
|
MD5 | 9405689338d5f7148702180bf6f88db5 |
|
BLAKE2b-256 | 47b100199672c654e8f4fad136b6b62c5ef816d84a1d2878daae19a7025f85c3 |