### Install Python Project Dependencies Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Installs required project dependencies from 'requirements.txt' and development dependencies from 'requirements-dev.txt' using pip. ```Shell pip install -r requirements.txt pip install -r requirements-dev.txt ``` -------------------------------- ### Activate Python Virtual Environment Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Activates the previously created virtual environment, making its Python interpreter and installed packages available in the current shell session. ```Shell source venv/bin/activate ``` -------------------------------- ### Create Python Virtual Environment Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Initial setup to create an isolated Python environment for project dependencies. This step is typically performed once per project. ```Shell python -m venv venv ``` -------------------------------- ### Run RingCentral Python Demo Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Executes a specific RingCentral Python demo file. Requires copying and editing '.env.sample' to '.env' with valid credentials for API access. ```Shell python3 ringcentral/demos/demo_fax.py ``` -------------------------------- ### PyPI Configuration for Manual Release Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Configuration for the '~/.pypirc' file, enabling manual package upload to PyPI using a token. This file specifies the repository URL and authentication credentials. ```Configuration [distutils] index-servers = pypi [pypi] repository = https://upload.pypi.org/legacy/ username = __token__ password = pypi- ``` -------------------------------- ### Install RingCentral Python SDK Source: https://github.com/ringcentral/ringcentral-python/blob/master/README.md This snippet demonstrates how to install the RingCentral Python SDK using pip. It is recommended to use Python 3.7 or newer for compatibility. ```Shell $ pip3 install ringcentral ``` -------------------------------- ### GitHub Action Release Commands Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Commands executed by a GitHub Action to build and upload the Python package to PyPI. This process is triggered automatically by pushing a tag to the remote repository. ```Shell python3 -m pip install --upgrade build python3 -m pip install --upgrade twine python3 -m build twine upload dist/* ``` -------------------------------- ### Run Python Unit Tests Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Executes all unit tests within the project directory that match the '*test.py' pattern using Python's built-in 'unittest' module. ```Shell python -m unittest discover . --pattern '*test.py' ``` -------------------------------- ### Python Project Dependency List Source: https://github.com/ringcentral/ringcentral-python/blob/master/requirements.txt Specifies the external Python libraries and their compatible versions required for the project to run correctly. These dependencies are typically installed using pip. ```Python observable==0.3.* requests==2.* websockets==15.* ``` -------------------------------- ### Initialize and Authenticate RingCentral Python SDK Source: https://github.com/ringcentral/ringcentral-python/blob/master/README.md This code snippet illustrates the basic usage of the RingCentral Python SDK. It shows how to initialize the SDK with your client ID, client secret, and server URL, then authenticate using a JWT token. Finally, it demonstrates making a simple GET request to retrieve user extension information. ```Python from ringcentral import SDK sdk = SDK('CLIENT_ID', 'CLIENT_SECRET', 'SERVER') platform = sdk.platform() platform.login(jwt='JWT_TOKEN') res = platform.get('/account/~/extension/~') print('User loaded ' + res.json().name) ``` -------------------------------- ### Run Python Unit Tests with Coverage Report Source: https://github.com/ringcentral/ringcentral-python/blob/master/dev-notes.md Executes unit tests and generates a code coverage report using the 'coverage' tool. This helps identify untested parts of the codebase and requires Python 3.8+. ```Shell coverage run -m unittest discover . --pattern '*test.py' coverage report ``` -------------------------------- ### Send Automated SMS Messages with RingCentral Python SDK Source: https://github.com/ringcentral/ringcentral-python/blob/master/README.md This comprehensive Python example demonstrates how to send automated SMS messages using the RingCentral SDK. It includes setting up a mock customer database, defining a function to send SMS via the RingCentral API, and a main function that iterates through customers to send payment reminders. The script initializes the SDK, logs in, and then uses the platform.post method to send messages to specified phone numbers. ```Python from ringcentral import SDK database = [] database.append({"Customer":"Tyler","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Chen","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Anne","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Brown","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Peter","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"White","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Lisa","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Dan","Payment":"Paid","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Stephanie","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"}) database.append({"Customer":"Lukas","Payment":"Due","PhoneNumber":"xxxxxxxxxxx"}) sdk = SDK('CLIENT_ID', 'CLIENT_SECRET', 'SERVER') platform = sdk.platform() platform.login(jwt='JWT_TOKEN') def sendSMS(message, number): params = {'from': {'phoneNumber': 'USERNAME'},'to': [{'phoneNumber': number}],'text': message} response = platform.post('/restapi/v1.0/account/~/extension/~/sms', params) print('Sent payment reminder to ' + number) def main(): for i in range(len(database)): customer = database[i] if customer['Payment'] is "Due": sendSMS("Hi " + customer['Customer'] + ". Your payment is due.", customer['PhoneNumber']) time.sleep(5) print("Send payment reminder done.") if __name__ == '__main__': main() ``` -------------------------------- ### Python Project Dependencies (requirements.txt) Source: https://github.com/ringcentral/ringcentral-python/blob/master/requirements-dev.txt This snippet lists the core Python packages and their version constraints necessary for the RingCentral Python project to function correctly. It includes tools for testing (coverage, coveralls, discover, requests-mock), environment management (python-dotenv), and package distribution/documentation (twine, build, pdoc). ```Python coverage>=4.3.1 coveralls>=1.1 discover>=0.4.0 requests-mock>=1.2.0 python-dotenv>=1.0.0 twine build pdoc==14.4.0 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.