Registry / communication / vonage-numbers

vonage-numbers

JSON →
library1.0.5pypypi✓ verified 86d ago

The `vonage-numbers` library provides a dedicated Python client for interacting with the Vonage Numbers API. It allows developers to programmatically manage their Vonage phone numbers, including searching, buying, updating, and canceling them. It is built on top of the `vonage-python` SDK and is currently at version 1.0.5, with updates tied to the underlying Vonage API and SDK changes.

pip install vonage-numbers
INSTALL
IMPORT
SIG · VONAGE-NUMBERS
V
vonage-numbers
communicationpythonv1.0.5
Install
4.8s avg
Import
1164ms
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 1.217s · 48.1MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.8s · import 1.111s · 48MB
47MB installed
● package 47MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Numbers
from vonage_numbers import Numbers
Client
import vonage
The core Vonage client (for authentication) is imported from the parent `vonage-python` SDK and then passed to the `vonage-numbers` client.

Initialize the core `vonage.Client` with API credentials, then use it to instantiate the `vonage_numbers.Numbers` client to perform operations like fetching all owned numbers. Ensure `VONAGE_API_KEY` and `VONAGE_API_SECRET` environment variables are set.

import vonage from vonage_numbers import Numbers import os VONAGE_API_KEY = os.environ.get("VONAGE_API_KEY", "YOUR_API_KEY") VONAGE_API_SECRET = os.environ.get("VONAGE_API_SECRET", "YOUR_API_SECRET") if VONAGE_API_KEY == "YOUR_API_KEY" or VONAGE_API_SECRET == "YOUR_API_SECRET": print("Please set VONAGE_API_KEY and VONAGE_API_SECRET environment variables or replace placeholders.") else: try: # Initialize Vonage client client = vonage.Client(key=VONAGE_API_KEY, secret=VONAGE_API_SECRET) # Initialize Numbers client numbers_client = Numbers(client) # Example: get all numbers print("Fetching all Vonage numbers...") all_numbers = numbers_client.get_all_numbers() if all_numbers and all_numbers.get('numbers'): print(f"Successfully retrieved {len(all_numbers['numbers'])} numbers.") for number_data in all_numbers['numbers'][:2]: # Print first 2 for brevity print(f"- Number: {number_data.get('msisdn')}, Country: {number_data.get('country')}") else: print("No numbers found or response was empty.") except vonage.exceptions.VonageClientException as e: print(f"Vonage API Error: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
gotchaThe `vonage-numbers` library is a thin wrapper around the `vonage-python` SDK. You must install `vonage-python` separately for `vonage-numbers` to function correctly.
fix
Ensure both `vonage-numbers` and `vonage-python` are installed: `pip install vonage-numbers vonage-python`
affects: All versions
gotchaThe `vonage_numbers.Numbers` client requires an initialized `vonage.Client` instance to be passed to its constructor. Directly instantiating `Numbers()` without the client will result in a `TypeError`.
fix
First create `client = vonage.Client(key='YOUR_KEY', secret='YOUR_SECRET')`, then `numbers_client = Numbers(client)`.
affects: All versions
breakingWhile `vonage-numbers` itself is stable, underlying changes to the Vonage Numbers API can lead to unexpected request/response formats or deprecated endpoints. Keep an eye on official Vonage API documentation.
fix
Regularly consult the official Vonage Developer Documentation for the Numbers API to stay updated on schema changes or deprecated features.
affects: All versions (due to external dependency on API)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'vonage'
The core `vonage-python` SDK, which `vonage-numbers` depends on for client initialization and API interaction, is not installed.
fix
Install the `vonage-python` SDK: `pip install vonage-python`
TypeError: Numbers.__init__() missing 1 required positional argument: 'client'
You attempted to instantiate the `vonage_numbers.Numbers` client without providing an initialized `vonage.Client` instance.
fix
First, create an authenticated `vonage.Client` instance, then pass it to `Numbers`: `client = vonage.Client(key='...', secret='...'); numbers_client = Numbers(client)`
vonage.exceptions.VonageClientException: You need to supply a key and secret to the Vonage client
The `vonage.Client` was initialized without valid API key and secret, or the provided credentials were incorrect.
fix
Ensure `VONAGE_API_KEY` and `VONAGE_API_SECRET` environment variables are set correctly, or pass your valid API key and secret directly as arguments to `vonage.Client(key='YOUR_API_KEY', secret='YOUR_API_SECRET')`.
Upgrade
Version history
1.0.5latest on PyPI · released Oct 9, 2025
Audit
Dependencies
vonage-pythonrequiredRequired as the core Vonage SDK client for authentication and API communication.
Agent activity
21 hits · last 30 days
node
20
OpenAI (training)
1
Resources
vonage-numbers — pip install vonage-numbers · libregistry