Skip to main content

FURTHRmind python package

This package provides a simple and user-friendly way to interact with your FURTHRmind application. It enables users to effortlessly retrieve existing data or write new data into the application.

Install

You can conveniently install furthrmind from PyPi using the following command:

pip install furthrmind

Basic usage

Retrieve objects

To initiate an interaction with your server through the Furthrmind class, you need to create an instance of it. You will pass in your server's URL and API key. Don’t forget to provide the name or ID of the project you want to work with.

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

Retrieving data necessitates the importation of the relevant collection class. This can be attained either from your Furthrmind instance or by direct import.

Experiment = fm.Experiment
from furthrmind.collection import Experiment

To fetch a specific experiment, invoke the get method of the Experiment class, passing in the desired experiment's ID.

exp = fm.Experiment.get(exp_id)

or

exp = Experiment.get(exp_id)

Both these commands are identical provided the Experiment class was previously imported.

You can fetch all the experiments from a project by calling the get_all method which returns a list of instances of the Experiment class.

exp_list = Experiment.get_all()

The Experiment class instance encapsulates all data pertinent to your experiment. For convenience, this class provides several methods including: add_field, add_many_fields, remove_field, update_field_value, update_field_unit, add_file, remove_file, and add_datatable. Details about the available methods for each collection class can be found below.

Nested objects

In the preceding example, we retrieved one or more experiments from the Furthrmind server. Each experiment encompasses various attributes such as the corresponding samples, research items, and the group to which it belongs. Note that these entities are nested objects.

For instance, the 'groups' attribute comprises a list of group instances belonging to the group collection class. To optimize network traffic, these nested objects do not load completely. In other words, all properties, except for the ' id' and 'name', remain unretrieved.

To verify whether an object has been fully loaded, you can inspect the _fetched attribute of the object. If an object hasn't been fetched yet, you can invoke the get() method on that object to retrieve it.

Fields and FieldData: How to locate specific field value within an item

The targeted experiment contains an attribute known as 'fielddata', which is a list comprising FieldData objects. Unlike Field objects that represent field definitions within a project, FieldData merges these definitions with a specific value and unit applicable to a particular item, such as an experiment.

If you wish to locate a field value related to a specific item, you can iterate through the 'fielddata' list and compare the field names. For example, to search for the value of a field named "width", you could do the following:

for fielddata in exp.fielddata:
    if fielddata.field_name == "width":
        value = fielddata.value

Create new objects

To generate a new experiment, you should invoke the create() or create_many() method. It's important to correctly supply the input arguments suitable for each collection class. Specifically, the create method of the Experiment class necessitates passing the new experiment's name, and the name or ID of the group to which it should belong.

In case your requirement entails adding an experiment to a subgroup, supplying this subgroup's ID becomes paramount. The create method subsequently gives back an instance of the Experiment class, whereas the create_many method yields a list of Experiment class instances.

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

Alternatively, to create multiple experiments:

experiments = Experiment.create_many([{"name": "exp1", "group": "group1"}, {"name": "exp2", "group": "group2"}])

Adding fields, files, and datatables

After you created the new experiment 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]
        },
])

Detailed information about each collection and its attributes and methods can be found here:

Metadata

Release files for furthrmind 0.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for furthrmind 0.2.10
File Size Uploaded
furthrmind-0.2.10.tar.gz 48.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for furthrmind 0.2.10
File Interpreter ABI Platform
furthrmind-0.2.10-py3-none-any.whl Python 3 none any Details

Total release size: 109.5 kB

Release files / furthrmind-0.2.10.tar.gz

Download URL furthrmind-0.2.10.tar.gz
Size 48.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6c673ffe7d6b24c63e5887866dd8096e95dfd876a4fc7449cd6b6fa948f174ca
BLAKE2b-256 checksum
How to use checksums
6483ba77c92c7b7c16244630813c70071833e22c832cc79532255717b5618884
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Windows/10

Release files / furthrmind-0.2.10-py3-none-any.whl

Download URL furthrmind-0.2.10-py3-none-any.whl
Size 61.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
422419d11350a24ed441efb46ab2ff26f1504ec074139cf6f3a75b0ce383c0f9
BLAKE2b-256 checksum
How to use checksums
8d866c14e3794def93c39afb5032406ca17911fed5901b10dd06f8f79a828812
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Windows/10

Release history Release notifications | RSS feed

This release

0.2.10 This release

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page