diff --git a/README.md b/README.md index 9219803e..0ac0cf37 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,16 @@ This is the Python server SDK to help you use Vonage APIs in your Python applica ## Installation +It's recommended to create a new virtual environment to install the SDK. You can do this with + +```bash +# Create the virtual environment +python3 -m venv venv + +# Activate the virtual environment +. ./venv/bin/activate +``` + To install the Python SDK package using pip: ```bash diff --git a/number_insight/CHANGES.md b/number_insight/CHANGES.md index 1164e2aa..3fe586ce 100644 --- a/number_insight/CHANGES.md +++ b/number_insight/CHANGES.md @@ -1,3 +1,6 @@ +# 1.0.3 +- Rename `basic_number_insight` -> `get_basic_info`, `standard_number_insight` -> `get_standard_info`, `advanced_async_number_insight` -> `get_advanced_info_async`, `advanced_sync_number_insight` -> `get_advanced_info_sync` + # 1.0.2 - Support for Python 3.13, drop support for 3.8 diff --git a/number_insight/src/vonage_number_insight/_version.py b/number_insight/src/vonage_number_insight/_version.py index a6221b3d..3f6fab60 100644 --- a/number_insight/src/vonage_number_insight/_version.py +++ b/number_insight/src/vonage_number_insight/_version.py @@ -1 +1 @@ -__version__ = '1.0.2' +__version__ = '1.0.3' diff --git a/number_insight/src/vonage_number_insight/number_insight.py b/number_insight/src/vonage_number_insight/number_insight.py index fef34c47..da24e0dc 100644 --- a/number_insight/src/vonage_number_insight/number_insight.py +++ b/number_insight/src/vonage_number_insight/number_insight.py @@ -37,7 +37,7 @@ def http_client(self) -> HttpClient: return self._http_client @validate_call - def basic_number_insight(self, options: BasicInsightRequest) -> BasicInsightResponse: + def get_basic_info(self, options: BasicInsightRequest) -> BasicInsightResponse: """Get basic number insight information about a phone number. Args: @@ -83,7 +83,7 @@ def standard_number_insight( return StandardInsightResponse(**response) @validate_call - def advanced_async_number_insight( + def get_advanced_info_async( self, options: AdvancedAsyncInsightRequest ) -> AdvancedAsyncInsightResponse: """Get advanced number insight information about a phone number asynchronously. @@ -108,7 +108,7 @@ def advanced_async_number_insight( return AdvancedAsyncInsightResponse(**response) @validate_call - def advanced_sync_number_insight( + def get_advanced_info_sync( self, options: AdvancedSyncInsightRequest ) -> AdvancedSyncInsightResponse: """Get advanced number insight information about a phone number synchronously. diff --git a/number_insight/tests/test_number_insight.py b/number_insight/tests/test_number_insight.py index a9494954..02b7ca63 100644 --- a/number_insight/tests/test_number_insight.py +++ b/number_insight/tests/test_number_insight.py @@ -34,7 +34,7 @@ def test_basic_insight(): 'basic_insight.json', ) options = BasicInsightRequest(number='12345678900', country_code='US') - response = number_insight.basic_number_insight(options) + response = number_insight.get_basic_info(options) assert response.status == 0 assert response.status_message == 'Success' @@ -50,7 +50,7 @@ def test_basic_insight_error(): with raises(NumberInsightError) as e: options = BasicInsightRequest(number='1234567890', country_code='US') - number_insight.basic_number_insight(options) + number_insight.get_basic_info(options) assert e.match('Invalid request :: Not valid number format detected') @@ -85,7 +85,7 @@ def test_advanced_async_insight(): country_code='GB', cnam=True, ) - response = number_insight.advanced_async_number_insight(options) + response = number_insight.get_advanced_info_async(options) assert response.status == 0 assert response.request_id == '434205b5-90ec-4ee2-a337-7b40d9683420' assert response.number == '447700900000' @@ -108,7 +108,7 @@ def test_advanced_async_insight_error(): cnam=True, ) with raises(NumberInsightError) as e: - number_insight.advanced_async_number_insight(options) + number_insight.get_advanced_info_async(options) assert e.match('Invalid credentials') @@ -127,7 +127,7 @@ def test_advanced_async_insight_partial_error(caplog): country_code='GB', cnam=True, ) - response = number_insight.advanced_async_number_insight(options) + response = number_insight.get_advanced_info_async(options) assert 'Not all parameters are available' in caplog.text assert response.status == 43 @@ -143,7 +143,7 @@ def test_advanced_sync_insight(caplog): options = AdvancedSyncInsightRequest( number='12345678900', country_code='US', cnam=True ) - response = number_insight.advanced_sync_number_insight(options) + response = number_insight.get_advanced_info_sync(options) assert 'Not all parameters are available' in caplog.text assert response.status == 44 diff --git a/vonage/pyproject.toml b/vonage/pyproject.toml index 7b8384f7..56def366 100644 --- a/vonage/pyproject.toml +++ b/vonage/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ "vonage-network-auth>=1.0.0", "vonage-network-sim-swap>=1.0.0", "vonage-network-number-verification>=1.0.0", - "vonage-number-insight>=1.0.2", + "vonage-number-insight>=1.0.3", "vonage-numbers>=1.0.2", "vonage-sms>=1.1.3", "vonage-subaccounts>=1.0.3",