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
Using the newest features for the SDK requires version 2.0.0 or higher. Check your resolved packages (requirements.txt
, poetry.lock
, ...) and upgrade if necessary.
There are two major changes to keep in mind while migrating:
There are two products now instead of one. But 90% of data-related functionality is in Marple DB.
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:
The table below shows functionality from Marple Files and their counterparts in the new SDK:
/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
Last updated