cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New updated Python SDK Released!

Kendall_Rogers
Employee
Employee

Hello Sinch Developer Community! 

 

The topic for today is our SDK support for Python.  We want to provide a closer look at our philosophy behind the design, how we’re tailoring this to Python developers, and to provide a space for questions and comments related to Python. 

 

When we started out with the design of the new SDK components, we wanted to ensure we were building them with the specific language first and foremost.  After that, our focus was to keep the design simple for users that only want to leverage specific API calls they use but ensure customizability and future-proof access to other parts of our infrastructure. 

 

Within each SDK we’ve added common capabilities to further streamline the interaction with our platform: 

  • We’ve provided a simple HTTP component but allow users to override that with their own custom version if needed.   
  • There is asynchronous support for all API calls, regardless of the original endpoint functionality.   
  • We’ve provided automated token management/refresh code, so developers can use the system without micromanaging their authorization/authentication.  

With all these common items, we hope to build out consistent frameworks with functionality all users require. 

 

Another goal of ours while designing this new Python SDK was to mimic our REST APIs as much as possible, while still providing Pythonic developer experience.  We also use IDE type hints which, along with the REST API specification, allows the user to perform most API interactions without the need to use reference documentation. 

 

Discoverability is one of the key components of great DX, hence Python SDK namespaces are small and specific yet descriptive.  For example: 

numbers_response = sinch_client.numbers.available.list( 
    region_code="US", 
    number_type="LOCAL", 
    page_size=10 
) 

 

The main client class organizes the Sinch product portfolio (called domains within SDK) and its features into hierarchy that produces an API that is easy to read and discover:

 

PythonSDKRelase Fig1.jpg

 

No third-party libraries are used by the Python SDK apart from industry standard Python HTTP libraries - requests and aiohttp. 

 

Currently, Python versions: 3.9, 3.10, 3.11, 3.12 are supported. New stable versions will be added in the future, while older/EOL versions will be deprecated. 

 

For now, the SMS, Numbers, Conversation API  and Verification APIs are supported, with other public Sinch APIs to be added soon. 

 

More Details and Download Info

For further details and to download our SDK, please refer to: 

GitHub: https://github.com/sinch/sinch-sdk-python 

PyPi: https://pypi.org/project/sinch/  

 

Kendall Rogers SDK Product Manger
0 REPLIES 0