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.3.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file vonage_utils-1.1.3.tar.gz
.
File metadata
- Download URL: vonage_utils-1.1.3.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 550cd7a510145082aebbf933b18c3c847849a64d03445785cbc7a63c9666c325 |
|
MD5 | 4dd454be54b0c6bb03bab945bc337606 |
|
BLAKE2b-256 | 658631c9085d9020788a3ea31974e58aae5e273c0160ef235ac62455cf92d721 |
File details
Details for the file vonage_utils-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: vonage_utils-1.1.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71b34c31d4400a87df59cf549181b5fc0a86fa95b563b0865362c8b0d259f067 |
|
MD5 | 0564c7297e47cc7c5978cdee6e0aca59 |
|
BLAKE2b-256 | 488a0b9a05efa10c03c5df76f2280238daca93b2e4b20b2d3be95cd3d9fecbca |