Skip to main content

Marple SDK

Project description

Marple SDK

A simple SDK to upload data to Marple

Installation

Install the Marple SDK using:

pip install marpledata

Import the package using:

import marple

Usage

Setup

Create a Marple connection using:

from marple import Marple
m = Marple(ACCESS_TOKEN)

You can generate access tokens in the app, under Settings->Tokens.

If you are using Marple on-premise, you can add the custom URL:

m = Marple(ACCESS_TOKEN, api_url='https://marple.company.com/api/v1')

To check your connection, use:

m.check_connection()

Calling endpoints

Call endpoints by their METHOD:

m.get('/version')
m.post('/sources/info', json={'id': 98})

Upload data files

If your data is already in a file format, use this function to upload the data to Marple.

source_id = m.upload_data_file(file_path, marple_folder='/', metadata={})

  • file_path: the file_path of your data set
  • marple_folder: in what folder you would like to upload the data
  • metadata: dictionary with metadata. Example: {'Pilot': 'John Doe'}' Note that the metadata fields need to be added to your workspace before you will see them.

Upload a dataframe

If your data is in a pandas dataframe, use this function to upload the data to Marple.

source_id = m.upload_dataframe(dataframe, target_name, marple_folder='/', metadata={})

  • target_name: the target name for the dataset, this is how it will appear in Marple.

Add and send data

You can also use the Marple SDK to add data piece by piece and send it to Marple. First use:

m.add_data(data_dict)

  • data_dict = dictionary with signal, value pairs in it. Example: {'time': 2, 'signal 1': 0, 'signal 2': 5}

Once all the data has been added, use:

source_id = m.send_data(target_name, marple_folder, metadata={})

Get a link to the data

You can generate a link to Marple that opens the data and a project immediately. This can be very useful to see the results of a simulation directly.

link = m.get_link(source_id, project_name)

  • source_id: identifier for the data set, is returned by all above functions.
  • project_name: name of the project that you want to open the data in.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marpledata-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

marpledata-0.1.3-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file marpledata-0.1.3.tar.gz.

File metadata

  • Download URL: marpledata-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.1

File hashes

Hashes for marpledata-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7c4e1f387541f182cadda2ff8abb3ea1d8837151045532cd10323b6fddedb393
MD5 6fcc071ef41fa6fed34ded02f8767059
BLAKE2b-256 ef2a2d0b0560334986c9a72c1eabe23b0981ee18805af1a2ec9c1745c1878026

See more details on using hashes here.

File details

Details for the file marpledata-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: marpledata-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.1

File hashes

Hashes for marpledata-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e5a3ee82e3799771b3206a7ea01c93f0e519b8cb483c28c84bd06b7e51dfdda4
MD5 457af230a98abc7896630cc38405671b
BLAKE2b-256 56c03d11e8a0315ff5eaa948221676581533b9e26213f206f9b4d0ffc855c687

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page