SMSWithoutBorders Third Party Platforms library
Please make sure you have Python 3.7 or newer (python --version).
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install --upgrade pip wheel
$ pip install "git+https://github.com/smswithoutborders/SMSWithoutBorders-Customized-Third-Party-Platforms.git@main#egg=SwobThirdPartyPlatforms"
Install upgrades
$ pip install --force-reinstall "git+https://github.com/smswithoutborders/SMSWithoutBorders-Customized-Third-Party-Platforms.git@main#egg=SwobThirdPartyPlatforms"
$ git clone https://github.com/smswithoutborders/SMSWithoutBorders-Customized-Third-Party-Platforms.git
$ cd SMSWithoutBorders-Customized-Third-Party-Platforms
$ python3 setup.py install
from SwobThirdPartyPlatforms import ImportPlatform
from SwobThirdPartyPlatforms.exceptions import PlatformDoesNotExist
try
# Import platform
Platform = ImportPlatform(platform_name="platform_name")
# Initialize OAuth2 Methods
Methods = Platform.methods(origin = "origin")
# Initialize TwoFactor Methods
Methods = Platform.methods(identifier = "identifier")
try
# authorization
authorization_result = Methods.authorize()
# validation
validation_result = Methods.validate(
code=code,
scope=scope,
code_verifier=code_verifier
)
# invalidation
Methods.invalidate(token=token)
except Platform.exceptions.<some platform exception>
except PlatformDoesNotExist as error:
# Do something
except Exception as error:
# Do something
from SwobThirdPartyPlatforms import ImportPlatform
from SwobThirdPartyPlatforms.exceptions import PlatformDoesNotExist
try
# Import platform
Platform = ImportPlatform(platform_name="platform_name")
# run execute function
Platform.execute(body=body, user_details=user_details)
except PlatformDoesNotExist as error:
# Do something
except Exception as error:
# Do something
from SwobThirdPartyPlatforms import ImportPlatform
from SwobThirdPartyPlatforms.exceptions import PlatformDoesNotExist
try
# Import platform
Platform = ImportPlatform(platform_name="platform_name")
# get platform information
platform_information = Platform.info
except PlatformDoesNotExist as error:
# Do something
except Exception as error:
# Do something
-
PlatformDoesNotExist: Exception raised when Platform is not Found.
return: String
This project is licensed under the GNU General Public License v3.0.