Skip to main content

Ondewo SURVEY Client Python Library

This library facilitates the interaction between a user and a CAI server. It achieves this by providing a higher-level interface mediator.

This higher-level interface mediator is structured around a series of python files generated from protobuf files. These protobuf files specify the details of the interface, and can be used to generate code in 10+ high-level languages. They are found in the ONDEWO SURVEY API along with the older Google protobufs from Dialogueflow that were used at the start. The ONDEWO PROTO-COMPILER will generate the needed files directly in this library.

Python Installation

You can install the library by installing it directly from the PyPi:

pip install ondewo-survey-client

Or, you could clone it and install the requirements:

git clone git@github.com:ondewo/ondewo-survey-client-python.git
cd ondewo-survey-client-python
make setup_developer_environment_locally

Repository Structure

.
├── ondewo
│   ├── survey
│   │   ├── fhir_pb2_grpc.py
│   │   ├── fhir_pb2.py
│   │   ├── fhir_pb2.pyi
│   │   ├── __init__.py
│   │   ├── py.typed
│   │   ├── survey_pb2_grpc.py
│   │   ├── survey_pb2.py
│   │   └── survey_pb2.pyi
│   └── __init__.py
├── ondewo-proto-compiler
├── ondewo-survey-api
├── CONTRIBUTING.md
├── Dockerfile.utils
├── LICENSE
├── Makefile
├── MANIFEST.in
├── mypy.ini
├── README.md
├── RELEASE.md
├── requirements-dev.txt
├── requirements.txt
├── setup.cfg
├── setup.py
└── temp.txt

Build

The make build command is dependent on 2 repositories and their speciefied version:

It will generate a _pb2.py, _pb2.pyi and _pb2_grpc.py file for every .proto in the api submodule.

⚠️ All Files in the ondewo folder that dont have pb2 in their name are handwritten, and therefor need to be manually adjusted to any changes in the proto-code.

Examples

The /examples folder provides a possible implementation of this library. To run an example, simple execute it like any other python file. To specify the server and credentials, you need to provide an environment file with the following variables:

  • host // The hostname of the Server - e.g. 127.0.0.1
  • port // Port of the Server - e.g. 6600
  • user_name // Username - same as you would use in AIM
  • password // Password of the user
  • keycloak_url // Keycloak base URL for headless auth - e.g. https://my-host/auth
  • realm // Keycloak realm - e.g. ondewo-ccai-platform
  • client_id // Keycloak public client id - e.g. ondewo-survey-cai-sdk-public
  • grpc_cert // gRPC Certificate of the server

With keycloak_url, realm, and client_id set, the client authenticates via Keycloak and attaches an authorization: Bearer <jwt> header to every RPC. See examples/survey_list_surveys_example.py for the full D18 flow.

Automatic Release Process

The entire process is automated to make development easier. The actual steps are simple:

TODO after Pull Request was merged in:

  • Checkout master:

    git checkout master
    
  • Pull the new stuff:

    git pull
    
  • (If not already, run the setup_developer_environment_locally command):

    make setup_developer_environment_locally
    
  • Update the ONDEWO_SURVEY_VERSION in the Makefile

  • Add the new Release Notes in RELEASE.md in the format:

    ## Release ONDEWO Survey Python Client X.X.X       <---- Beginning of Notes
    
       ...<NOTES>...
    
    *****************                      <---- End of Notes
    
  • Release:

    make ondewo_release
    

The release process can be divided into 6 Steps:

  1. build specified version of the ondewo-survey-api
  2. commit and push all changes in code resulting from the build
  3. Create and push the release branch e.g. release/1.3.20
  4. Create and push the release tag e.g. 1.3.20
  5. Create a new Release on GitHub
  6. Publish the built dist folder to pypi.org

⚠️ The Release Automation checks if the build has created all the proto-code files, but it does not check the code-integrity. Please build and test the generated code prior to starting the release process.

Metadata

Release files for ondewo-survey-client 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ondewo-survey-client 2.0.3
File Size Uploaded
ondewo_survey_client-2.0.3.tar.gz 39.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ondewo-survey-client 2.0.3
File Interpreter ABI Platform
ondewo_survey_client-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 86.2 kB

Release files / ondewo_survey_client-2.0.3.tar.gz

Download URL ondewo_survey_client-2.0.3.tar.gz
Size 39.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7141d06cb8ece7df18df5ac0c054aae9fee1b95fdd7bda7db0b03fbbd2824768
BLAKE2b-256 checksum
How to use checksums
ca6b3bf3a54edfad690b5e82c34574fb9269a0a071843eee6679cc20be17fcd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / ondewo_survey_client-2.0.3-py3-none-any.whl

Download URL ondewo_survey_client-2.0.3-py3-none-any.whl
Size 46.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
521ef7195b6df733322830fd7723ec7e222e640f32f7f5ea1c92606ab5b3531f
BLAKE2b-256 checksum
How to use checksums
928b94d9044a60838cb8eb120bf063c82abcfbdb2a97acd44d8d557d574d5e81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page