Marketplace
Learn how to build a Marketplace integration using the Secoda SDK.
Last updated
Learn how to build a Marketplace integration using the Secoda SDK.
Last updated
To create a Marketplace integration, you'll need to use the Secoda Software Development Kit (SDK). The SDK is a Python-based toolkit that allows for the creation of custom Marketplace integrations. These integrations can be used to add resources and lineage to Secoda.
Check out our webinar on the Secoda SDK here!
To start building with the Secoda SDK, there are a few steps to follow. First, you need to write your Python code. You can use the documentation below or scroll down for a step by step example!
Once the code is written, you can upload and connect your integration.
And share it!
In this guide, we'll build an example integration with a data visualization service called Cluvio. By the end, you'll be able to write scripts that can be executed locally and ready to be submitted to Secoda.
Before you begin, ensure you have:
Python (3.11 or later recommended) installed on your system.
Secoda SDK installed via pip install --upgrade secodadk
.
Create a new directory for your integration project. Inside this directory, create a virtual environment and activate it:
With your virtual environment activated, install the Secoda SDK (and if exists, upgrade to the latest version)
Create a new Python file, fake_cluvio_integration.py
, which will contain your integration code.
At the top of your script, import the necessary components from the Secoda SDK:
Extend the SecodaIntegration
class to create your own integration:
The extract
method is where the integration interacts with Cluvio's API. We'll authenticate using credentials and then extract data:
Note that:
self.credentials
is a dictionary provided by the SecodaIntegration
base class, allowing you to access user inputs in the integration connect form.
We use self.http_post
for HTTP requests. You must use our self.http_{method}
for HTTP requests. Other library like requests
or httpx
will not work. self.http_{method}
returns a httpx.Response
instance.
With the data obtained from Cluvio, you can now declare resources (e.g., dashboards) via self.declare_resource
See Secoda Fields Explained for more information on the fields of Resource
.
Lineage between resources is also crucial for understanding the relationship and flow of data. This is declared via the self.declare_lineage
method. Lineage can be between resources from the same source.
Lineage can also flow from an existing resource in the workspace, to a resource brought in from the custom integration.
To ensure that your integration works as expected, test it on your local machine. Set the credentials in your environment for security:
Run your script with the environment variables set to your Cluvio credentials:
Once you've tested your script and are happy with the results, it's time to Upload and Connect your Custom Integration.
For the full code of this integration, see here.