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.1.1

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.1.1
File Size Uploaded Provenance Actions
ondewo_survey_client-2.1.1.tar.gz 48.3 kB Without provenance Details for ondewo_survey_client-2.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 100.8 kB

Release files / ondewo_survey_client-2.1.1.tar.gz

Download URL ondewo_survey_client-2.1.1.tar.gz
Size 48.3 kB
Tags Source
SHA-256 checksum
How to use checksums
33022c1a7d5eb88574384e48fefbbcf5b39523cb5c15281df70d6c6e2e67a2e0
BLAKE2b-256 checksum
How to use checksums
62e2f264a75f70c451353037915207ce1c3afca65c601643e59edd7bb1b5f918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

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

Download URL ondewo_survey_client-2.1.1-py3-none-any.whl
Size 52.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd3663d773df9569c7e69920ea96bf131d9cf99c67c1564b6b567dda8ce82259
BLAKE2b-256 checksum
How to use checksums
d9625525da61305b4087484bcc262300024972676642725f834e4ec03c8b848e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for ondewo-survey-client 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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