Skip to main content

OpenHEXA SDK

Project description

OpenHEXA Logo

Open-source Data integration platform

Test Suite

OpenHEXA Python SDK

OpenHEXA is an open-source data integration platform developed by Bluesquare.

Its goal is to facilitate data integration and analysis workflows, in particular in the context of public health projects.

Please refer to the OpenHEXA wiki for more information about OpenHEXA.

This repository contains the code of the OpenHEXA SDK, a library allows you to write code for the OpenHEXA platform. It is particularly useful to write OpenHEXA data pipelines, but can also be used in the OpenHEXA notebooks environment.

The OpenHEXA wiki has a section dedicated to the SDK: Using the OpenHEXA SDK.

Requirements

The OpenHEXA SDK requires Python version 3.9 or newer, but it is not yet compatible with Python 3.12 or later versions.

If you want to be able to run pipeline in a containerized environment on your machine, you will need Docker.

Quickstart

Here's a super minimal example to get you started. First, create a new directory and a virtual environment:

mkdir openhexa-pipelines-quickstart
cd openhexa-pipelines-quickstart
python -m venv venv
source venv/bin/activate

You can then install the OpenHEXA SDK:

pip install --upgrade openhexa.sdk

💡New OpenHEXA SDK versions are released on a regular basis. Don't forget to update your local installations with pip install --upgrade from times to times!

Now that the SDK is installed withing your virtual environmentYou can now use the openhexa CLI utility to create a new pipeline:

openhexa pipelines init "My awesome pipeline"

Great! As you can see in the console output, the OpenHEXA CLI has created a new directory, which contains the basic structure required for an OpenHEXA pipeline. You can now cd in the new pipeline directory and run the pipeline:

cd my_awesome_pipeline
python pipeline.py

Congratulations! You have successfully run your first pipeline locally.

If you inspect the actual pipeline code, you will see that it doesn't do a lot of things, but it is still a perfectly valid OpenHEXA pipeline.

Let's publish to an actual OpenHEXA workspace so that it can run online.

Using the OpenHEXA web interface, within a workspace, navigate to the Pipelines tab and click on "Create".

Copy the command displayed in the popup in your terminal:

openhexa workspaces add <workspace>

You will be prompted for an authentication token, you can find it in the popup as well.

After adding the workspace using the CLI, you can now push your pipeline:

openhexa pipelines push 

As it is the first time, the CLI will ask you to confirm the creation operation. After confirmation the console will output the link to the pipeline screen in the OpenHEXA interface.

You can now open the link and run the pipeline using the OpenHEXA web interface.

Contributing

The following sections explain how you can set up a local development environment if you want to participate to the development of the SDK.

SDK development setup

Install the SDK in editable mode:

python -m venv venv # Create a virtual environment for this project
source venv/bin/activate # Activate the venv
pip install -e ".[dev]"  # Necessary to be able to run the openhexa CLI

Using a local installation of OpenHEXA to run pipelines

While it is possible to run pipelines locally using only the SDK, if you want to run OpenHEXA in a more realistic setting you will need to install the OpenHEXA app and frontend components. Please refer to the installation instructions for more information.

You can then configure the OpenHEXA CLI to connect to your local backend:

openhexa config set_url http://localhost:8000

Notes: you can monitor the status of your pipelines using http://localhost:8000/pipelines/status

Running the tests

You can run the tests using pytest:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openhexa_sdk-0.1.45.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

openhexa.sdk-0.1.45-py3-none-any.whl (60.4 kB view details)

Uploaded Python 3

File details

Details for the file openhexa_sdk-0.1.45.tar.gz.

File metadata

  • Download URL: openhexa_sdk-0.1.45.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for openhexa_sdk-0.1.45.tar.gz
Algorithm Hash digest
SHA256 d2230563710b05e746a6f4a9415fad7375b0ea36286e97fd3a8e6e1ba94c0522
MD5 c70ceb29fb7cd5053d187c4e0bc05942
BLAKE2b-256 e2b09cc33c9d5c74d4b120099390dbed42d2d8af61db7f039d7b507bb536413e

See more details on using hashes here.

File details

Details for the file openhexa.sdk-0.1.45-py3-none-any.whl.

File metadata

File hashes

Hashes for openhexa.sdk-0.1.45-py3-none-any.whl
Algorithm Hash digest
SHA256 0729ba1757f896f64cbe041700be549a496d80f5ca7d749915b5ece8ec8003fd
MD5 bb2d12326cca2fa0b1fff2f4a0fc3391
BLAKE2b-256 0dfe21b6eaaaf9fbd848c52f303a8c25e8599db1bb1305bdc01eed97abb42f30

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page