Skip to main content

Module to communicate to the Youfone API

Project description

aioyoufone

Asynchronous library to communicate with the Youfone API

maintainer buyme_coffee discord

MIT License

GitHub issues Average time to resolve an issue Percentage of issues still open PRs Welcome

Python

github release github release date github last-commit github contributors github commit activity

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",
        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


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.4.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

aioyoufone-0.4.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file aioyoufone-0.4.0.tar.gz.

File metadata

  • Download URL: aioyoufone-0.4.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for aioyoufone-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ccbcf950677d24cabbdb45280e9e4c2da4ab8b71f749294e23670d2a83d5db06
MD5 a645d96c7e0103d68ca61c404ee401d4
BLAKE2b-256 6e06626786d3e79ac59e9e6358e57c9f09acad4dd70793a0209368348ea4b82b

See more details on using hashes here.

File details

Details for the file aioyoufone-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: aioyoufone-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for aioyoufone-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6d9d6106464542890c238b2795426e19c29512bed7b39205837afc11c18f77b
MD5 1b51ba7d9b0d648852590b67ce709682
BLAKE2b-256 aa3adcb17b1070ba9a27a381b8f291361ea9830299a2d87243288a5da9a90b96

See more details on using hashes here.

Supported by

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