Official python wrapper for the FURTHRmind rest api.
Project description
furthrmind
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. You can get this class either from your furthrmind instance or by importing it.
Experiment = fm.Experiment
from furthrmind.collection import Experiment
In order to get one experiment you can call the get method of the Experiment class and pass the id of the experiment you would like to retrieve.
exp = fm.Experiment.get(exp_id)
or
exp = Experiment.get(exp_id)
is exactly the same, if the Experiment class was imported before.
In oreder to get all experiments of one project, call the get_all method. The method will return a list with instances of the Experiment class.
exp_list = Experiment.get_all()
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file furthrmind-0.1b22.tar.gz.
File metadata
- Download URL: furthrmind-0.1b22.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.9.4-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e83d8618b2bc5cf8078b80c92580cefc0a5db3463637dad606fd93ff9e40860f
|
|
| MD5 |
3462f97b24867c48d8db3229ed58bdb8
|
|
| BLAKE2b-256 |
12184e0f80636b25fde1a08b3a1aa85788991e8cbffe73f37e32ad7f2c0d2cdb
|
File details
Details for the file furthrmind-0.1b22-py3-none-any.whl.
File metadata
- Download URL: furthrmind-0.1b22-py3-none-any.whl
- Upload date:
- Size: 45.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.9.4-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d03b2a6691a9dff221ba3cc201f8c543d7a259a91d9938769ee36330067b5bbe
|
|
| MD5 |
c073d9944653ace27c2814e50fcf76a7
|
|
| BLAKE2b-256 |
97a17687776f18bf546f8e75dc17db13b4639162db2622e2997d0ea480a34a85
|