Skip to main content

Utils package containing objects for use with Vonage APIs

Project description

Vonage Utils Package

This package contains utility code that is used by the Vonage Python SDK and other related packages.

The utils module provides two utility functions: format_phone_number and remove_none_values. It also exposes the VonageError type that other exceptions related to Vonage SDK inherit from. This can also be accessed via the main SDK module with vonage.VonageError.

Usage

from utils import format_phone_number, remove_none_values

# Use format_phone_number
try:
    formatted_number = format_phone_number('123-456-7890')
    print(formatted_number)
except (InvalidPhoneNumberError, InvalidPhoneNumberTypeError) as e:
    print(e)

# Use remove_none_values to remove null values from a Vonage API response when converting to a dictionary with the `asdict` method
from dataclasses import asdict

vonage_api_response = vonage.api.method()
cleaned_dict = asdict(my_dataclass, dict_factory=remove_none_values)
print(cleaned_dict)

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

vonage_utils-1.1.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

vonage_utils-1.1.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file vonage_utils-1.1.4.tar.gz.

File metadata

  • Download URL: vonage_utils-1.1.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.4

File hashes

Hashes for vonage_utils-1.1.4.tar.gz
Algorithm Hash digest
SHA256 950b802dc93f8440717fba6e183d2ae39f6e0316dc19a3f1f41ca81f9af24bf8
MD5 4b80e4c70b1c939a5990023e072fa28b
BLAKE2b-256 26cb3f584cb37639f93fd6a47076d272ecab1f49e8231d1bf6e77566fe58232b

See more details on using hashes here.

File details

Details for the file vonage_utils-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for vonage_utils-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 438b0bc8da25e8026ec6789cd9a113b4f41636c70c4d84b2d9ab0e92ed23a665
MD5 ac0fdc8608a51f24f2174c60e0905e08
BLAKE2b-256 c544dbd70b0fbf7b8c025209f4ec708ca67c45796d2ee5d23ecc222d39751058

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