neurodatapub.utils
List of Modules
neurodatapub.utils.datalad
neurodatapub.utils.gitannex
Modules
neurodatapub.utils.io
: utils functions for input/output.
- neurodatapub.utils.io.copy_content_to_datalad_dataset(bids_dir, datalad_dataset_dir, dryrun=False)[source]
Copy BIDS dataset content to target datalad dataset directory using
rsync
.- bids_dirstring
Local path of the BIDS dataset
- datalad_dataset_dirstring
Local path of the directory of the datalad dataset being created
- dryrunbool
If
True
, only generates the commands and do not execute them (Default:False
)
- proc :
Output of call to
rsync
command viasubprocess.run()
- cmdstring
Equivalent output command
neurodatapub.utils.jsonconfig
: utils functions to handle JSON sibling configuration files.
- neurodatapub.utils.jsonconfig.validate_json_sibling_config(json_file, sibling_type=None)[source]
Validate a JSON sibling configuration file.
- json_filestr
Absolute path to JSON sibling configuration file
- sibling_type[‘git-annex-special-sibling’,’github-sibling’, ‘osf-sibling’]
Type of sibling configuration file
neurodatapub.utils.process
: utils functions to run command via subprocess.
- neurodatapub.utils.process.run(command, env=None, cwd=None)[source]
Function calls to execute a command. It runs the command specified as input via
subprocess.run()
.- commandstring
String containing the command to be executed (required)
- envos.environ
Specify a custom os.environ
- cwdDirectory
Specify a custom current working directory
>>> cmd = 'ls "/path/to/folder"' >>> run(cmd)
neurodatapub.utils.qt
: utils functions for Qt style sheets.
- neurodatapub.utils.qt.return_folder_button_style_sheet()[source]
Return the Qt style sheet for the traitsui
FileEditor
andDirectoryEditor
.- style_sheet_folder_buttonstr
Qt style sheet
- neurodatapub.utils.qt.return_global_style_sheet()[source]
Return the global Qt style sheet of the GUI.
- style_sheetstr
Qt style sheet
- neurodatapub.utils.qt.return_save_json_button_style_sheet()[source]
Return the Qt style sheet for the button that saves JSON configuration files.
- style_sheet_save_json_buttonstr
Qt style sheet
neurodatapub.utils.sshconfig
: utils function to edit SSH config.
- neurodatapub.utils.sshconfig.update_ssh_config(sshurl, user, dryrun=False)[source]
Add a new entry to the SSH config file (
~/.ssh/config
).It sets the default user login to the SSH special remote.
- sshurlstr
SSH URL of the git-annex special remote in the form
ssh://server.example.org
- userstr
User login for authentication to the git-annex special remote
- dryrunbool
If
True
, only generates the commands and do not execute them (Default:False
)