Skip to main content

A set of tools to create and manage standardized forms for eLabFTW

Project description

For the full documentation, see readthedocs

elabforms

A set of tools to create and manage standardized forms for eLabFTW.


Create a virtual environment

python3 -m venv myenv
source myenv/bin/activate

Installation

You will need template_part files to generate the final template. These files are located in the elabforms_INTProjects and elabforms_BIDSMetadata repositories — private Git repositories at NIT.

Reminder: A template_part is an elabform with a single groupfield. You need to create a template_file_list.csv file listing the parts you want to concatenate, in this order, for example:

template_part_Example_1.json
template_part_Example_2.json
...
template_part_Example_N.json

Each line corresponds to one template part file.


User mode

Install the package from Test PyPI:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple elabforms==0.0.6

Usage

  • Test the installation by running:

    eform --help
    
  • To create a new form, run:

    eform template_file_list.csv template_generated.json
    

## Example
Assuming you have a file `template_file_list.csv` with the following content:
```csv
template_part_Example_1.json
template_part_Example_2.json

This will generate the file template_generated.json which will contain the content of the two files concatenated together.


 let 's template_part_Example_1.json` ![GENERIC_BIDS_SESSION](docs/GNERIC_BIDS_SESSION.png) 

with content:
```json
{
    "elabftw": {
        "extra_fields_groups": [
            {
                "id": 1,
                "name": "GENERIC_BIDS_SESSION"
            }
        ]
    },
    "extra_fields": {
        "session_id": {
            "type": "text",
            "value": "",
            "group_id": 1,
            "position": 0,
            "required": true,
            "description": "Ex: '01 or predrug or 20231206'"
        },
        "Session duration": {
            "type": "number",
            "value": "",
            "group_id": 1,
            "position": 3,
            "description": "The duration of the session [in minutes]",
            "blank_value_on_duplicate": true
        }
    }
}

and template_part_Example_2.json GENERIC_BIDS_SESSION, with the following content:

{
  "elabftw": {
    "display_main_text": true,
    "extra_fields_groups": [
      {
        "id": 2,
        "name": "Run "
      }
    ]
  },
  "extra_fields": {
    "TaskName": {
      "type": "text",

      "group_id": 2,
      "position": 0,

      "description": "Code name of the task (no space and only alphanumeric characters).\n Ex: 'rest or facesnback or headnodding'"
    },
    "RunNumber": {
      "type": "text",
      "value": "",
      "group_id": 2,
      "position": 2
    },
    "StartTime": {
      "type": "text",
      "value": "",
      "group_id": 2
    },
    "RunComment": {
      "type": "text",
      "value": "",
      "group_id": 2,
      "position": 3,
      "description": "Comment about the subject behavior during the run."
    },
    "TaskDescription": {
      "type": "text",
      "value": "  ",
      "group_id": 2,
      "position": 1,
      "description": "Description of the task"
    }
  }
}

This will generate the following file " template_generated.json" GENERIC_BIDS_SESSION,

which will contain the content of the two files template_part_Example_1.json and template_part_Example_2.json concatenated together.

{
    "elabftw": {
        "extra_fields_groups": [
            {
                "id": 1,
                "name": "GENERIC_BIDS_SESSION"
            },
            {
                "id": 2,
                "name": "Run "
            }
        ]
    },
    "extra_fields": {
        "session_id": {
            "type": "text",
            "value": "",
            "group_id": 1,
            "position": 0,
            "required": true,
            "description": "Ex: '01 or predrug or 20231206'"
        },
        "Session duration": {
            "type": "number",
            "value": "91",
            "group_id": 1,
            "position": "3",
            "description": "The duration of the session [in minutes]",
            "blank_value_on_duplicate": true
        },
        "TaskName": {
            "type": "text",
            "group_id": 2,
            "position": 0,
            "description": "Code name of the task (no space and only alphanumeric characters).\n Ex: 'rest or facesnback or headnodding'"
        },
        "RunNumber": {
            "type": "text",
            "value": "",
            "group_id": 2,
            "position": 2
        },
        "StartTime": {
            "type": "text",
            "value": "",
            "group_id": 2
        },
        "RunComment": {
            "type": "text",
            "value": "",
            "group_id": 2,
            "position": 3,
            "description": "Comment about the subject behavior during the run."
        },
        "TaskDescription": {
            "type": "text",
            "value": "  ",
            "group_id": 2,
            "position": 1,
            "description": "Description of the task"
        }
    }
}
```bash

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

elabforms-0.0.8.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

elabforms-0.0.8-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file elabforms-0.0.8.tar.gz.

File metadata

  • Download URL: elabforms-0.0.8.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for elabforms-0.0.8.tar.gz
Algorithm Hash digest
SHA256 3fe53df6fd3524d08655a83bd5feb0cbe0d1ecde4d916e29f2c16d99ad13fda7
MD5 f317e2d831fffcd5ac646d723d542287
BLAKE2b-256 e32a3586b3b5b89b95894685fb8b013732da2491ddf2813708d9ad13a7c485a1

See more details on using hashes here.

File details

Details for the file elabforms-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: elabforms-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for elabforms-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ee46157139d4d4c405dc5350d2a59985ee5bd8d6ec5b9faeda40f624a1276492
MD5 774693f0ead7a4c9cc9cf0bcf1759376
BLAKE2b-256 4e04ccee22601eba82a15599139500787f4ea19e13ed9a4af11f7a8b46c69371

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