The Vonage Python SDK is organized as a monorepo. While the top-level vonage package provides access to most API methods, specialized data models and request/response objects are located in specific API packages (e.g., vonage-sms, vonage-account).
To use an API, you typically use the vonage.Vonage client instance for the method call, but import the specific message or request objects from their corresponding sub-package.
Example: Sending an SMS
- Use
vonage to access the .sms.send() method. - Use
vonage_sms to import SmsMessage and SmsResponse.
from vonage_sms import SmsMessage, SmsResponse
# message is created using the specialized package
message = SmsMessage(to='1234567890', from_='Acme Inc.', text='Hello, World!')
# the call is made via the top-level vonage client
response: SmsResponse = vonage_client.sms.send(message) # vonage_client is an instance of `vonage.Vonage`