Warning
This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
galaxy.files package
- class galaxy.files.FileSourcePath(file_source, path)[source]
Bases:
tuple
- file_source: BaseFilesSource
Alias for field number 0
- class galaxy.files.FileSourceScore(file_source, score)[source]
Bases:
tuple
- file_source: BaseFilesSource
Alias for field number 0
- class galaxy.files.UserDefinedFileSources(*args, **kwargs)[source]
Bases:
Protocol
Entry-point for Galaxy to inject user-defined object stores.
Supplied object of this class is used to write out concrete description of file sources when serializing all file sources available to a user.
- validate_uri_root(uri: str, user_context: FileSourcesUserContext) None [source]
- find_best_match(url: str) FileSourceScore | None [source]
- user_file_sources_to_dicts(for_serialization: bool, user_context: FileSourcesUserContext, browsable_only: bool | None = False, include_kind: Set[PluginKind] | None = None, exclude_kind: Set[PluginKind] | None = None) List[FilesSourceProperties] [source]
Write out user file sources as list of config dictionaries.
- __init__(*args, **kwargs)
- class galaxy.files.NullUserDefinedFileSources(*args, **kwargs)[source]
Bases:
UserDefinedFileSources
- validate_uri_root(uri: str, user_context: FileSourcesUserContext) None [source]
- find_best_match(url: str) FileSourceScore | None [source]
- user_file_sources_to_dicts(for_serialization: bool, user_context: FileSourcesUserContext, browsable_only: bool | None = False, include_kind: Set[PluginKind] | None = None, exclude_kind: Set[PluginKind] | None = None) List[FilesSourceProperties] [source]
Write out user file sources as list of config dictionaries.
- class galaxy.files.ConfiguredFileSourcesConf(conf_dict: Dict[str, Any] | List[Dict[str, Any]] | None = None, conf_file: str | None = None)[source]
Bases:
object
- class galaxy.files.ConfiguredFileSources(file_sources_config: FileSourcePluginsConfig, configured_file_source_conf: ConfiguredFileSourcesConf | None = None, load_stock_plugins: bool = False, plugin_loader: FileSourcePluginLoader | None = None, user_defined_file_sources: UserDefinedFileSources | None = None)[source]
Bases:
object
Load plugins and resolve Galaxy URIs to FileSource objects.
- __init__(file_sources_config: FileSourcePluginsConfig, configured_file_source_conf: ConfiguredFileSourcesConf | None = None, load_stock_plugins: bool = False, plugin_loader: FileSourcePluginLoader | None = None, user_defined_file_sources: UserDefinedFileSources | None = None)[source]
- find_best_match(url: str) BaseFilesSource | None [source]
Returns the best matching file source for handling a particular url. Each filesource scores its own ability to match a particular url, and the highest scorer with a score > 0 is selected.
- get_file_source_path(uri)[source]
Parse uri into a FileSource object and a path relative to its base.
- validate_uri_root(uri: str, user_context: FileSourcesUserContext)[source]
- plugins_to_dict(for_serialization: bool = False, user_context: FileSourcesUserContext | None = None, browsable_only: bool | None = False, include_kind: Set[PluginKind] | None = None, exclude_kind: Set[PluginKind] | None = None) List[FilesSourceProperties] [source]
- class galaxy.files.NullConfiguredFileSources[source]
Bases:
ConfiguredFileSources
- class galaxy.files.DictifiableFilesSourceContext(*args, **kwargs)[source]
Bases:
Protocol
- property file_sources: ConfiguredFileSources
- to_dict(view: str = 'collection', value_mapper: Dict[str, Callable] | None = None) Dict[str, Any] [source]
- __init__(*args, **kwargs)
- class galaxy.files.FileSourceDictifiable(*args, **kwargs)[source]
Bases:
Dictifiable
,DictifiableFilesSourceContext
- dict_collection_visible_keys = ('email', 'username', 'ftp_dir', 'preferences', 'is_admin')
- class galaxy.files.FileSourcesUserContext(*args, **kwargs)[source]
Bases:
DictifiableFilesSourceContext
,Protocol
- __init__(*args, **kwargs)
- class galaxy.files.ProvidesFileSourcesUserContext(trans, **kwargs)[source]
Bases:
FileSourcesUserContext
,FileSourceDictifiable
Implement a FileSourcesUserContext from a Galaxy ProvidesUserContext (e.g. trans).
- property ftp_dir
- property preferences
- property is_admin
Whether this user is an administrator.
- property user_vault
User vault namespace
- property app_vault
App vault namespace
- property file_sources
- class galaxy.files.DictFileSourcesUserContext(**kwd)[source]
Bases:
FileSourcesUserContext
,FileSourceDictifiable
- property email
- property ftp_dir
- property preferences
- property role_names
- property group_names
- property is_admin
- property user_vault
- property app_vault
- property file_sources
Subpackages
- galaxy.files.sources package
PluginKind
FileSourceSupports
FilesSourceProperties
FilesSourceProperties.file_sources_config
FilesSourceProperties.id
FilesSourceProperties.label
FilesSourceProperties.doc
FilesSourceProperties.scheme
FilesSourceProperties.writable
FilesSourceProperties.requires_roles
FilesSourceProperties.requires_groups
FilesSourceProperties.disable_templating
FilesSourceProperties.uri_root
FilesSourceProperties.type
FilesSourceProperties.browsable
FilesSourceProperties.url
FilesSourceProperties.supports
FilesSourceOptions
EntryData
Entry
RemoteEntry
TDirectoryClass
TFileClass
RemoteDirectory
RemoteFile
SingleFileSource
SupportsBrowsing
FilesSource
file_source_type_is_browsable()
BaseFilesSource
BaseFilesSource.plugin_kind
BaseFilesSource.supports_pagination
BaseFilesSource.supports_search
BaseFilesSource.supports_sorting
BaseFilesSource.get_browsable()
BaseFilesSource.get_prefix()
BaseFilesSource.get_scheme()
BaseFilesSource.get_writable()
BaseFilesSource.user_has_access()
BaseFilesSource.prefer_links()
BaseFilesSource.user_context_required
BaseFilesSource.get_uri_root()
BaseFilesSource.get_url()
BaseFilesSource.to_relative_path()
BaseFilesSource.score_url_match()
BaseFilesSource.uri_from_path()
BaseFilesSource.to_dict()
BaseFilesSource.to_dict_time()
BaseFilesSource.list()
BaseFilesSource.create_entry()
BaseFilesSource.write_from()
BaseFilesSource.realize_to()
uri_join()
slash_join()
- Submodules
- galaxy.files.sources.anvil module
- galaxy.files.sources.basespace module
- galaxy.files.sources.dropbox module
- galaxy.files.sources.ftp module
- galaxy.files.sources.galaxy module
- galaxy.files.sources.googlecloudstorage module
- galaxy.files.sources.googledrive module
- galaxy.files.sources.onedata module
- galaxy.files.sources.posix module
- galaxy.files.sources.s3 module
- galaxy.files.sources.s3fs module
- galaxy.files.sources.ssh module
- galaxy.files.sources.webdav module
- galaxy.files.unittest_utils package
Submodules
galaxy.files.uris module
- galaxy.files.uris.stream_url_to_str(path: str, file_sources: ConfiguredFileSources | None = None, prefix: str = 'gx_file_stream') str [source]
- galaxy.files.uris.stream_url_to_file(url: str, file_sources: ConfiguredFileSources | None = None, prefix: str = 'gx_file_stream', dir: str | None = None, user_context=None, target_path: str | None = None, file_source_opts: FilesSourceOptions | None = None) str [source]
- galaxy.files.uris.ensure_file_sources(file_sources: ConfiguredFileSources | None) ConfiguredFileSources [source]
- galaxy.files.uris.stream_to_file(stream, suffix='', prefix='', dir=None, text=False, **kwd)[source]
Writes a stream to a temporary file, returns the temporary file’s name
- galaxy.files.uris.validate_uri_access(uri: str, is_admin: bool, ip_allowlist: List[IPv4Address | IPv6Address | IPv4Network | IPv6Network]) None [source]
Perform uniform checks on supplied URIs.
Prevent access to local IPs not found in ip_allowlist.
Don’t allow non-admins to access file:// URIs.
- galaxy.files.uris.validate_non_local(uri: str, ip_allowlist: List[IPv4Address | IPv6Address | IPv4Network | IPv6Network]) str [source]