Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

sinch-sdk-python-snippets

Sinch Python SDK Code Snippets

This directory contains code snippets demonstrating usage of the Sinch Python SDK.

Requirements

Snippets execution settings

When executing a snippet, you will need to provide some information about your Sinch account (credentials, Sinch virtual phone number, ...)

These settings can be placed directly in the snippet source code, or you can use an environment file (.env). Using an environment file allows the settings to be shared and used automatically by every snippet.

Setting Up Your Environment File

1. Rename the example file

Linux / Mac:

cp .env.example .env

Windows (Command Prompt):

copy .env.example .env

Windows (PowerShell):

Copy-Item .env.example .env

2. Fill in your credentials

Open the newly created .env file in your preferred text editor and fill in the required values (e.g., SINCH_PROJECT_ID=your_project_id).

Note: Do not share your .env file or credentials publicly.

Install dependencies using Poetry:

poetry install

Running snippets

All available code snippets are located in subdirectories, structured by feature and corresponding actions (e.g., numbers/, sms/).

To execute a specific snippet, navigate to the appropriate subdirectory and run:

python snippet.py