morb_fetch package
Copyright (c) 2025 MORB Developers and Contributors. All rights reserved.
morb-fetch: Data Fetcher for MORB
- class morb_fetch.Settings(*args, **kwargs)
Bases:
BaseSettingsConfiguration settings for MORB-fetch.
- serverurl
The base URL for the MORB-data server.
- Type:
AnyHttpUrl
- indexfile
The filename of the index file.
- Type:
CSVFilename
- indexfilehash
The SHA256 hash of the index file.
- Type:
SHA256Hash
- max_filesize
The maximum file size allowed.
- Type:
Optional[HumanFileSize]
- cache
The path to the cache directory.
- Type:
Path
-
serverurl:
AnyHttpUrl
- classmethod settings_customise_sources(settings_cls, init_settings, env_settings, dotenv_settings, file_secret_settings)
Customise the settings sources and priorities to include a YAML file and environment variable.
Priority: Source file defaults < YAML File < Environment Variables
- morb_fetch.get_config()
Get the global configuration for package
- Returns:
The global configuration settings.
- Return type:
- morb_fetch.clear_config()
Unset the global configuration for package
- class morb_fetch.Database(config=None)
Bases:
objectA class to represent the examples database. It loads the examples from a CSV file and provides a method to fetch a specific example by name and identifier.
- list_ids()
List all example identifiers.
- class morb_fetch.Example(meta, database=None)
Bases:
objectA class to represent an example. It contains the metadata and the data associated with the example.
- retrieve()
Retrieve the data associated with the example either from the local cache or from the server.
- Returns:
None
- class morb_fetch.ToolkitDownloader(*args, **kwargs)
Bases:
BaseModelBase Downloader class for Toolkits
- class morb_fetch.MORLABDownloader(*args, **kwargs)
Bases:
ZenodoToolkitDownloader- download_path: ClassVar[Path]
- name: ClassVar[str]
- registry: ClassVar[dict[str, DOIstr]]
- class morb_fetch.MMESSDownloader(*args, **kwargs)
Bases:
ZenodoToolkitDownloader- download_path: ClassVar[Path]
- name: ClassVar[str]
- registry: ClassVar[dict[str, DOIstr]]
- class morb_fetch.PyMORDownloader(*args, **kwargs)
Bases:
ZenodoToolkitDownloader- download_path: ClassVar[Path]
- name: ClassVar[str]
- registry: ClassVar[dict[str, DOIstr]]
- classmethod retrieve_version(version)
Retrieve a specific version of Toolkit
- class morb_fetch.ZenodoToolkitDownloader(*args, **kwargs)
Bases:
ToolkitDownloaderBase Downloader class for Toolkits from Zenodo
- class morb_fetch.TectonicDownloader
Bases:
objectDownload Tectonic binary from GitHub releases. Tectonic is a XELateX-implementation engine that can flexibly fetch related resources to compile LaTeX documents.
NOTE: Tectonic does not implement the biber engine. Check TectonicBiberDownloader to retrieve the biber engine.
- REPO_URL
- download_path
- classmethod list_available_versions()
List all available versions of Tectonic
- name
- registry
- class morb_fetch.TectonicBiberDownloader
Bases:
objectDownload Biber binary from SourceForge releases. Add to OS’s PATH for Tectonic to find the biber binary.
- REPO_URL
- download_path
- classmethod list_available_versions()
List all available versions of Tectonic
- name
- registry
- morb_fetch.get_database()
Get the global database instance.
- Returns:
The global database instance.
- Return type:
- morb_fetch.loadmat(filepath)
Load a MATLAB file using pymatreader.read_mat.
Subpackages
- morb_fetch.bindings package
- morb_fetch.examples package
- morb_fetch.toolkits package
Submodules
morb_fetch.config module
- class morb_fetch.config.Settings(*args, **kwargs)
Bases:
BaseSettingsConfiguration settings for MORB-fetch.
- serverurl
The base URL for the MORB-data server.
- Type:
AnyHttpUrl
- indexfile
The filename of the index file.
- Type:
CSVFilename
- indexfilehash
The SHA256 hash of the index file.
- Type:
SHA256Hash
- max_filesize
The maximum file size allowed.
- Type:
Optional[HumanFileSize]
- cache
The path to the cache directory.
- Type:
Path
-
serverurl:
AnyHttpUrl
- classmethod settings_customise_sources(settings_cls, init_settings, env_settings, dotenv_settings, file_secret_settings)
Customise the settings sources and priorities to include a YAML file and environment variable.
Priority: Source file defaults < YAML File < Environment Variables
- morb_fetch.config.get_config()
Get the global configuration for package
- Returns:
The global configuration settings.
- Return type:
- morb_fetch.config.clear_config()
Unset the global configuration for package
- morb_fetch.config.create_config(yaml_path)
Create a new configuration file at the specified path.
- Parameters:
yaml_path (Path) – The path to the YAML configuration file.
- morb_fetch.config.list_config()
List available configuration files in the current working directory, user configuration directory and any context included due to environment variables.
- morb_fetch.config.delete_config(yaml_path)
Delete a YAML configuration file.
- Parameters:
yaml_path (Path) – Path to the YAML configuration file.
morb_fetch.utils module
- morb_fetch.utils.loadmat(filepath)
Load a MATLAB file using pymatreader.read_mat.
- morb_fetch.utils.parse_human_size(s)
Parse a human-readable size string into an integer.
- Parameters:
s (HumanFileSize) – The human-readable size string.
- Returns:
The parsed size in bytes.
- Return type:
- Raises:
ValueError – If the size string is invalid.