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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aioyoufone-0.4.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6a372df8c9b9a22f7a14be4ccfe5a50a820cbcc50215f41cba4f411f6a443b81
MD5 7109e19a4d662839cfc2b111cfc9d06f
BLAKE2b-256 88ec25afdec83a13365c1a7a0bd29b41b3a2e653c3178a1ce24b10294e4136b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aioyoufone-0.4.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dae646b28c02391aa38fb06656eefaeb6c8a5269268419944251df602293e3dc
MD5 839a79ca11cb72660c5cb5eb90780b51
BLAKE2b-256 8c07c9d86745cd2dbc75532de341bfc09e14bb9317b9cc6502c014cad096f443

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