Uniconnapp Quick Start Template for python users
- We need an account in Uniconnapps Platform to try examples or build demo apps.
- If you are not an existing user visit uniconnapps.com to get access. If you are an existing user login to Uniconnapps Platform
- It houses Apps and Users within it.
- For demo apps and simplicity sake, we can just start with a single space with name of the developer.
- It is a typical demo project or a microservice
- It is a main object in the application code
- It holds the identity, auth, config, etc. and it is specific to an App (Uniapp) in UCA platform.
- We use this object to register actions (functionalities) and send events.
- We can get all the parameters required to initialize this object in "Build -> Environment" section or use a portion of "Sample Code" in "Build -> Code" section of Uniconnapps Platform.
- The recommended python version is 3.10 but UCA client supports 3.7+
Note: You can skip this step if you are using GitHub Codespaces
uniconnapps-connector is available on PyPI:
$ pip install uniconnapps-connectorif you don't have pip command use -m pip
$ python -m pip install uniconnapps-connector- Open main.py and replace UCA client initialization code according to your UCA App parameters
- The typical code needs to be replaced is
uca_client = connector.UcaClient(
connector_endpoint="uca://xxxxxxx.xxx",
app_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
client_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
client_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)- Simply Run .py file using python interpreter
$ python main.py- You will typically see "Streaming Actions from UCA Cloud Queue..."
...
Streaming Actions from UCA Cloud Queue...
Streaming Actions from UCA Cloud Queue...
Streaming Actions from UCA Cloud Queue...- Now keep it running and check "Experience -> Actions" section in UCA platform (in Web Browser, you may need to refresh)
- Invoke Actions from browser directly