caosadvancedtools.scifolder.utils module#
- caosadvancedtools.scifolder.utils.add_value_list(header, df, name)#
- caosadvancedtools.scifolder.utils.create_files_list(df, ftype)#
- caosadvancedtools.scifolder.utils.get_entity_ids_from_include_file(prefix, file_path)#
reads version ids from include file
- caosadvancedtools.scifolder.utils.get_files_referenced_by_field(globs, prefix='', final_glob=None)#
returns all file entities at paths described by given globs
This function assumes that the supplied globs is a list of filenames, directories or globs.
prefix should be the path of the crawled file to supply a context for relative paths.
- caosadvancedtools.scifolder.utils.get_xls_header(filepath)#
This function reads an xlsx file and creates a dictionary analogue to the one created by the yaml headers in README.md files read with the get_header function of caosdb-advancedtools. As xlsx files lack the hierarchical structure, the information that can be provided is less complex. See the possibility to use the xlsx files as a less powerfull version for people who are not comfortable with the README.md files.
The xlsx file has a defined set of rows. In each row a list of entries can be given. This structure is converted to a dictionary with a fix structure.
- caosadvancedtools.scifolder.utils.is_filename_allowed(path, recordtype)#
- caosadvancedtools.scifolder.utils.parse_responsibles(header)#
Extract the responsible person(s) from the yaml header.
If field responsible is a list every entry from that list will be added as a person. Currently only the format <Firstname> <Lastname> <*> is supported. If it is a simple string, it is added as the only person.
- caosadvancedtools.scifolder.utils.reference_records_corresponding_to_files(record, recordtypes, globs, path, to_be_updated, property_name)#