Python SDK

Installation

Install the package from Pypi using any package manager. Examples:

  • poetry add marpledata

  • uv add marpledata

  • pip install marpledata

Usage

Read the full documentation on Pypi: https://pypi.org/project/marpledata/

Example: pushing a file

import time
from marple import DB

# create a datastream and API token in the Marple DB web application
DATASTREAM = 'Car data'
API_TOKEN = '<your api token>'

db = DB(API_TOKEN)

db.push_file(DATASTREAM, "tests/example_race.csv", metadata={"driver": "Mbaerto"})
print(db.get_status(STREAM_CSV, dataset_id))

Migration from Marple Files

There are two major changes to keep in mind while migrating:

  1. There are two products now instead of one. But 90% of data-related functionality is in Marple DB.

  2. When uploading a new file, you no longer need to provide the plugin and import options. Instead, you need to configure a datastream which takes care of this. Read more here:

Configuration

The table below shows functionality from Marple Files and their counterparts in the new SDK:

Marple Files (Deprecated)
Marple DB
Marple Insight

/library/upload or

m.upload_data_file(...)

db.push_file(...) ℹ️ plugin is now configured by datastream (once)

-

m.check_import_status(...)

db.get_status(...)

-

/sources/info

db.get_datasets(...)

-

/library/folder/contents

🚧 Upcoming

-

/export

db.download_original(...)

insight.export_mdb(...) Supported: mat, h5 🚧 Upcoming: csv

m.get_link(...)

-

Last updated