How to automate your data analysis workflow by leveraging the Marple API

In this post, we will walk you through the process of integrating the Marple API into your workflow, along with highlighting some of its key benefits and functionalities. We will cover how to set up the API, upload and import files, manage metadata, and share projects and sources, making your data management and visualization effortless.

What is the Marple API?

The Marple API is a set of programming interfaces that allows developers to interact with Marple's functionalities programmatically. This enables you to automate tasks, integrate Marple with other software, and customize its use to fit your specific requirements. Whether you're a data scientist, engineer, or developer, the Marple API opens up new possibilities for efficient and effective data management and visualization.

On a technical level, Marple offers an HTTP API, as well as an SDK for python. For MATLAB, we have a code example available here.

Benefits of Using the Marple API

The Marple API gives four key benefits to users and their whole team:

  • Automation: Automate repetitive tasks such as data import, export, and transformation. This saves time and reduces the risk of human error.
  • Integration: Seamlessly integrate Marple with other tools and platforms in your tech stack, ensuring a smooth and cohesive workflow.
  • Customization: Tailor Marple’s functionalities to suit your specific needs, from automatically generating data visualizations to specialized data processing routines.
  • Scalability: Handle large datasets and complex operations with ease, leveraging Marple's robust infrastructure.

Key functionalities

The following functionalities are available in the Marple API:

1. Uploading and Importing Files: Files can be uploaded to Marple's server and then imported into the database for analysis. This two-step process ensures data is correctly logged and accessible. For importing, we have a set of plugins available that can extract data from common file types such as TDMS, CSV, MAT, etc.

2. Adding Metadata: Metadata is crucial for organizing the data, even in small teams. The API allows developers to add, update, and manage metadata associated with each data source. This makes the process a lot more resilient, instead of people manually having to enter metadata.

3. Sharing Projects and Sources: Collaborate effortlessly by sharing projects and specific data sources. The API facilitates generating share links with a set of pre-made graphs, enabling team members to access and visualize data easily.

How to use the Marple API

For a more detailed explanation, read the full explanation in our documentation. Below, we give a short example in Python on how to 1) upload a file 2) import it, and 3) get a share link.

Step 1: Get your API key

As a Marple admin, head to the Settings / Tokens page. Make a new token for your project.

Add the API token to your python script:

from marple import Marple  # pip install marpledata
m = Marple(API_TOKEN)
m.check_connection()


Step 2: Upload a file

Upload the file to Marple using the upload_data_file function:

file_path = "/path/to/data.csv"
source_id = m.upload_data_file(file_path, marple_folder='/my-folder', metadata={})

Importing will start automatically, you can check the progress going from 0 to 100:

status = m.check_import_status(source_id)

Step 3: Get a share link

To quickly jump into an analysis, the killing feature of the API is to generate a Marple share link. Make sure to first create a project manually, with the graphs organised the way you want to see them. Save the project, for example with the name Project-API-example.

Generate the share link using the SDK as following:

link = m.get_link(source_id, "Project-API-example")
print(link) # <https://app.marpledata.com/visualisation?share=private-h8CGTL923YOx5APt>


Conclusion

The Marple API is a versatile and powerful tool that can transform how you handle and visualize data. By automating tasks, integrating with other tools, and customizing functionalities to meet your specific needs, the Marple API empowers you to unlock the full potential of your data. Ready to get started? Explore our API Documentation and begin your integration journey today.

For more insights and detailed guides, stay tuned to our blog and follow us on LinkedIn for the latest updates.