fairmd.idp.databankio module
Repository downloads and extraction of individual archive members.
- fairmd.idp.databankio.validate_source_path(source)[source]
Accept relative repository paths, never filesystem traversal.
- fairmd.idp.databankio.find_archive_in_path(file_path)[source]
Split at the first archive with a member following it.
- fairmd.idp.databankio.extract_file_from_archive(archive_path, target_path, dest_dir)[source]
Extract one regular member to dest_dir using its basename.
- fairmd.idp.databankio.extract_nested_file_from_archives(archive_path, nested_path, dest_path)[source]
Extract arbitrary archive nesting, resetting member paths at each layer.
- fairmd.idp.databankio.download_resource_from_uri(uri, dest, override_if_exists=False, *, source_path=None)[source]
Download to dest, optionally extracting the member in source_path.
Without source_path, legacy destinations like a.zip/folder/file.xtc are supported and extracted beside a.zip. Returns 0 (new), 1 (cached), 2 (replaced).
- fairmd.idp.databankio.prepare_file_sources(sim, file_keys)[source]
Normalize file fields to local basenames; record archive locations in SOURCE_FILES so the file can be resolved again after DIR_WRK is gone.
- fairmd.idp.databankio.download_system_file(system, local_name, dest, override_if_exists=False)[source]
Download one system file, e.g. for re-download at analysis time, resolving it via SOURCE_FILES if it originally came from inside an archive. Falls back to local_name itself as the repository filename otherwise.