Skip to main content

Official python wrapper for the FURTHRmind rest api.

Project description

furthrmind-sdk

This package allows to easily interact with your FURTHRmind application in order to retrieve data or to write new data.

Install

pip install furthrmind

Basic usage

Create an instance of the furthrmind class and pass the url to your server, your api key. Optionally you can pass the project name or id of the project you would like to work with.

from furthrmind import FURTHRmind
fm = FURTHRmind(host, api_key, project_name="my project")

In order to retrieve data, you have to import the corresponding collection class and call the get or get_all method. The method will return an instance / a list with instances of the Experiment class. The instance of the experiment class will contain all data that belong to your experiment. Additionally, the experiment object has some convenient method for: add_field, add_many_fields, remove_field, update_field_value, update_field_unit, add_file, remove_file, add_datatable

collection import Experiment
exp_list = Experiment.get_all()

To create a new experiment, you need to call the create() or create_many() method. Please consider the correct input arguments for each collection class. For experiments, the create method expects to pass the new exp name and the name or id of the group that it should belong to. If you want to add an experiment to a subgroup, you need to pass the id of this group. The create method will return an instance of the Experiment class, the create_many method will return a list with instances of the Experiment class

new_exp = Experiment.create("myexperiment2", group_name="My group"

After you created the new you might want to add some fields, files, and datatables to your experiment. This can be achieved with:

new_exp.add_field(field_name="My field namy", field_type="Numeric",
                  value=5, unit="cm")
new_exp.add_many_fields([
        {
            "name": "May field name,
            "field_type" ="Numeric",
            "value: 5, 
            "unit": "cm"
        },
        {
            "name": "May second field name,
            "field_type" ="Numeric",
            "value: 10, 
            "unit": "m"
        }
])
new_exp.add_file(my_file_path)
new_exp.add_datatable(name=my data table, columns=[
        {
            "name": "my 1st column"
            "type": "Numeric,
            "unit": "cm",
            "data": [1,2,3]
        },
        {
            "name": "my 2nd column"
            "type": "Numeric,
            "unit": "cm",
            "data": [4,5,6]
        },
])

A list of collections to work with can be found here:

  • Project
  • Group
  • Experiment
  • Sample
  • ResearchItem
  • Field
  • FieldData (the fields attached to an item: experiments, samples, or researchitems)
  • Unit
  • File
  • DataTable
  • Column
  • ComboBoxEntry (the entries within a list field)
  • Category

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

furthrmind-0.1b3.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

furthrmind-0.1b3-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file furthrmind-0.1b3.tar.gz.

File metadata

  • Download URL: furthrmind-0.1b3.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.146.1-microsoft-standard-WSL2

File hashes

Hashes for furthrmind-0.1b3.tar.gz
Algorithm Hash digest
SHA256 33a8e25dad409dc98a06b5bfcdd55966af38527e52c95c57bb3415853d7a5a5c
MD5 8026d14dfa1789c6cdc3d4945e84a50e
BLAKE2b-256 5133d7feff7f3f8ddb723cfd328cc4642bee5770210f5a5014f3714862b8b4cc

See more details on using hashes here.

File details

Details for the file furthrmind-0.1b3-py3-none-any.whl.

File metadata

  • Download URL: furthrmind-0.1b3-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.146.1-microsoft-standard-WSL2

File hashes

Hashes for furthrmind-0.1b3-py3-none-any.whl
Algorithm Hash digest
SHA256 52a33c66cf844fac3901493136caa0a5db572ab6495bf396b7c4390fa5ba4e2d
MD5 39bd1d2018e3db474b883da20ce81f36
BLAKE2b-256 abb34dd72ff86b75ce344a99848f0519ebcba11c90388c135f98b87920f9a9fb

See more details on using hashes here.

Supported by

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