The Logichub Integration SDK
Project description
lhub_integ
Python package to shim basic scripts to work with integration machinery. An example script is available in /lhub_integ/tests/test_integration/main.py
This package requires Python 3.7:
brew install pyenv
pyenv install 3.7.1
pyenv init # Follow the instructions
pyenv local 3.7.1
# Make sure this says "3.7.1"
python --version
Usage (as an integration writer)
To write a Python script that is convertible into an integration:
- Create a directory that will contain your integration
- Install lhub_integ as a local package:
pip install lh_integration
- Copy
main.py
from the tests folder into your integration and modify as desired.
Python scripts must provide an entrypoint function with some number of arguments. These arguments will correspond to columns in the input data. The function should return a Python dictionary that can be serialized to JSON
def process(url, num_bytes: int):
return {'output': url + 'hello'}
Dev Installation
# Get Python 3
brew install python
brew install pipenv
pipenv install
pipenv shell
Test the package installer
pipenv install -e .
Run tests
pytest
Deploying changes to lhub_integ & custom integrations
- Make changes. Verify that the tests pass and that you can build the image locally (do not push the image from your laptop)
- Get your changes merged to master.
CircleCI
will build an image. It will be unused at this point because nothing points tolatest
. - Go to https://hub.docker.com/r/logichub/integrations-custom/tags/ and find that latest tag that contains the results of building your image. Update
ConfigProperties.IntegrationsCustomImageTag
and make any code updates required.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lhub_integ-0.1.0.tar.gz
(8.5 kB
view hashes)
Built Distribution
lhub_integ-0.1.0-py3-none-any.whl
(22.5 kB
view hashes)
Close
Hashes for lhub_integ-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e90d20eae32f670e6a1b19b4d0457333f10c4ea936481c8366a959e34ddaba |
|
MD5 | 75b0f0a56dc4209dd26b321844e55372 |
|
BLAKE2b-256 | 2fcd84b06c2a947c65b28549c03b1d0aa019b270d257caf1f25af1125907c0dc |