galaxy.model package

Galaxy data model classes

Naming: try to use class names that have a distinct plural form so that the relationship cardinalities are obvious (e.g. prefer Dataset to Data)

galaxy.model.now()

Return a new datetime representing UTC day and time.

class galaxy.model.ConfigurationTemplateEnvironmentSecret[source]

Bases: TypedDict

name: str
type: typing_extensions.Literal[secret]
vault_key: str
class galaxy.model.ConfigurationTemplateEnvironmentVariable[source]

Bases: TypedDict

name: str
type: typing_extensions.Literal[variable]
variable: str
class galaxy.model.TransformAction[source]

Bases: TypedDict

action: str
galaxy.model.get_uuid(uuid: UUID | str | None = None) UUID[source]
class galaxy.model.Base(**kwargs: Any)[source]

Bases: DeclarativeBase, object

metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

See also

orm_declarative_metadata

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

__init__(**kwargs: Any) None

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class galaxy.model.RepresentById[source]

Bases: object

id: Mapped[int]
exception galaxy.model.NoConverterException(value)[source]

Bases: Exception

__init__(value)[source]
exception galaxy.model.ConverterDependencyException(value)[source]

Bases: Exception

__init__(value)[source]
galaxy.model.set_datatypes_registry(d_registry)[source]

Set up datatypes_registry

class galaxy.model.HasTags[source]

Bases: object

dict_collection_visible_keys = ['tags']
dict_element_visible_keys = ['tags']
to_dict(*args, **kwargs)[source]
make_tag_string_list()[source]
copy_tags_from(target_user, source)[source]
property auto_propagated_tags
class galaxy.model.SerializeFilesHandler(*args, **kwargs)[source]

Bases: Protocol

serialize_files(dataset: DatasetInstance, as_dict: Dict[str, Any]) None[source]
__init__(*args, **kwargs)
class galaxy.model.SerializationOptions(for_edit: bool, serialize_dataset_objects: bool | None = None, serialize_files_handler: SerializeFilesHandler | None = None, strip_metadata_files: bool | None = None)[source]

Bases: object

__init__(for_edit: bool, serialize_dataset_objects: bool | None = None, serialize_files_handler: SerializeFilesHandler | None = None, strip_metadata_files: bool | None = None) None[source]
attach_identifier(id_encoder, obj, ret_val)[source]
get_identifier(id_encoder, obj)[source]
get_identifier_for_id(id_encoder, obj_id)[source]
serialize_files(dataset, as_dict)[source]
class galaxy.model.Serializable[source]

Bases: RepresentById

serialize(id_encoder: IdEncodingHelper, serialization_options: SerializationOptions, for_link: bool = False) Dict[str, Any][source]

Serialize model for a re-population in (potentially) another Galaxy instance.

id: Mapped[int]
class galaxy.model.HasName[source]

Bases: object

get_display_name()[source]

These objects have a name attribute can be either a string or a unicode object. If string, convert to unicode object assuming ‘utf-8’ format.

class galaxy.model.UsesCreateAndUpdateTime[source]

Bases: object

update_time: Mapped[datetime | None]
property seconds_since_updated
property seconds_since_created
update()[source]
class galaxy.model.WorkerProcess(**kwargs)[source]

Bases: Base, UsesCreateAndUpdateTime

id: Mapped[int]
server_name: Mapped[str | None]
hostname: Mapped[str | None]
pid: Mapped[int | None]
update_time: Mapped[datetime | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('worker_process', MetaData(), Column('id', Integer(), table=<worker_process>, primary_key=True, nullable=False), Column('server_name', String(length=255), table=<worker_process>), Column('hostname', String(length=255), table=<worker_process>), Column('pid', Integer(), table=<worker_process>), Column('update_time', DateTime(), table=<worker_process>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
galaxy.model.cached_id(galaxy_model_object)[source]

Get model object id attribute without a firing a database query.

Useful to fetching the id of a typical Galaxy model object after a flush, where SA is going to mark the id attribute as unloaded but we know the id is immutable and so we can use the database identity to fetch.

With Galaxy’s default SA initialization - any flush marks all attributes as unloaded - even objects completely unrelated to the flushed changes and even attributes we know to be immutable like id. See test_galaxy_mapping.py for verification of this behavior. This method is a workaround that uses the fact that we know all Galaxy objects use the id attribute as identity and SA internals (_sa_instance_state) to infer the previously loaded ID value. I tried digging into the SA internals extensively and couldn’t find a way to get the previously loaded values after a flush to allow a generalization of this for other attributes.

class galaxy.model.JobLike[source]

Bases: object

MAX_NUMERIC = 9999999999999999999
add_metric(plugin, metric_name, metric_value)[source]
property metrics
set_streams(tool_stdout, tool_stderr, job_stdout=None, job_stderr=None, job_messages=None)[source]
log_str()[source]
property stdout
property stderr
galaxy.model.calculate_user_disk_usage_statements(user_id, quota_source_map, for_sqlite=False)[source]

Standalone function so can be reused for postgres directly in pgcleanup.py.

galaxy.model.calculate_disk_usage_per_objectstore(sa_session, user_id: int)[source]
class galaxy.model.UserQuotaBasicUsage(*, quota_source_label: str | None = None, total_disk_usage: float)[source]

Bases: BaseModel

quota_source_label: str | None
total_disk_usage: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'quota_source_label': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'total_disk_usage': FieldInfo(annotation=float, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.model.UserQuotaUsage(*, quota_source_label: str | None = None, total_disk_usage: float, quota_percent: float | None = None, quota_bytes: int | None = None, quota: str | None = None)[source]

Bases: UserQuotaBasicUsage

quota_percent: float | None
quota_bytes: int | None
quota: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'quota': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'quota_bytes': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'quota_percent': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'quota_source_label': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'total_disk_usage': FieldInfo(annotation=float, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.model.UserObjectstoreUsage(*, object_store_id: str, total_disk_usage: float)[source]

Bases: BaseModel

object_store_id: str
total_disk_usage: float
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'object_store_id': FieldInfo(annotation=str, required=True), 'total_disk_usage': FieldInfo(annotation=float, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class galaxy.model.User(email=None, password=None, username=None)[source]

Bases: Base, Dictifiable, RepresentById

Data for a Galaxy user or admin and relations to their histories, credentials, and roles.

use_pbkdf2 = True
bootstrap_admin_user = False
id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
last_password_change: Mapped[datetime | None]
form_values_id: Mapped[int | None]
preferred_object_store_id: Mapped[str]
disk_usage: Mapped[Decimal | None]
activation_token: Mapped[str | None]
addresses: Mapped[List[UserAddress]]
cloudauthz: Mapped[List[CloudAuthz]]
custos_auth: Mapped[List[CustosAuthnzToken]]
default_permissions: Mapped[List[DefaultUserPermissions]]
groups: Mapped[List[UserGroupAssociation]]
histories: Mapped[List[History]]
active_histories: Mapped[List[History]]
galaxy_sessions: Mapped[List[GalaxySession]]
object_stores: Mapped[List[UserObjectStore]]
file_sources: Mapped[List[UserFileSource]]
quotas: Mapped[List[UserQuotaAssociation]]
quota_source_usages: Mapped[List[UserQuotaSourceUsage]]
social_auth: Mapped[List[UserAuthnzToken]]
stored_workflow_menu_entries: Mapped[List[StoredWorkflowMenuEntry]]
values: Mapped[List[FormValues]]
api_keys: Mapped[List[APIKeys]]
data_manager_histories: Mapped[List[DataManagerHistoryAssociation]]
roles: Mapped[List[UserRoleAssociation]]
stored_workflows: Mapped[List[StoredWorkflow]]
all_notifications: Mapped[List[UserNotificationAssociation]]
non_private_roles: Mapped[List[UserRoleAssociation]]
preferences: AssociationProxy[Any] = ColumnAssociationProxyInstance(AssociationProxy('_preferences', 'value'))
dict_collection_visible_keys = ['id', 'email', 'username', 'deleted', 'active', 'last_password_change']
dict_element_visible_keys = ['id', 'email', 'username', 'total_disk_usage', 'nice_total_disk_usage', 'deleted', 'active', 'last_password_change', 'preferred_object_store_id']
__init__(email=None, password=None, username=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

email: Mapped[str]
password: Mapped[str]
external: Mapped[bool | None]
deleted: Mapped[bool | None]
purged: Mapped[bool | None]
active: Mapped[bool]
username: Mapped[str | None]
get_user_data_tables(data_table: str)[source]
property extra_preferences
set_password_cleartext(cleartext)[source]

Set user password to the digest of cleartext.

set_random_password(length=16)[source]

Sets user password to a random string of the given length. :return: void

check_password(cleartext)[source]

Check if cleartext matches user password when hashed.

system_user_pwent(real_system_username)[source]

Gives the system user pwent entry based on e-mail or username depending on the value in real_system_username

all_roles()[source]

Return a unique list of Roles associated with this user or any of their groups.

all_roles_exploiting_cache()[source]
get_disk_usage(nice_size=False, quota_source_label=None)[source]

Return byte count of disk space used by user or a human-readable string if nice_size is True.

set_disk_usage(bytes)[source]

Manually set the disk space used by a user to bytes.

property total_disk_usage

Return byte count of disk space used by user or a human-readable string if nice_size is True.

adjust_total_disk_usage(amount, quota_source_label)[source]
get_oidc_tokens(provider_backend)[source]
property nice_total_disk_usage

Return byte count of disk space used in a human-readable string.

calculate_disk_usage_default_source(object_store)[source]

Return byte count total of disk space used by all non-purged, non-library HDAs in non-purged histories assigned to default quota source.

calculate_and_set_disk_usage(object_store)[source]

Calculates and sets user disk usage.

static user_template_environment(user)[source]
>>> env = User.user_template_environment(None)
>>> env['__user_email__']
'Anonymous'
>>> env['__user_id__']
'Anonymous'
>>> user = User('foo@example.com')
>>> user.id = 6
>>> user.username = 'foo2'
>>> env = User.user_template_environment(user)
>>> env['__user_id__']
'6'
>>> env['__user_name__']
'foo2'
static expand_user_properties(user, in_string)[source]
config_template_details() Dict[str, Any][source]
is_active()[source]
is_authenticated()[source]
attempt_create_private_role()[source]
dictify_objectstore_usage() List[UserObjectstoreUsage][source]
dictify_usage(object_store=None) List[UserQuotaBasicUsage][source]

Include object_store to include empty/unused usage info.

dictify_usage_for(quota_source_label: str | None) UserQuotaBasicUsage[source]
quota_source_usage_for(quota_source_label: str | None) UserQuotaSourceUsage | None[source]
count_stored_workflow_user_assocs(stored_workflow) int[source]
current_galaxy_session
table = Table('galaxy_user', MetaData(), Column('id', Integer(), table=<galaxy_user>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<galaxy_user>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<galaxy_user>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('email', TrimmedString(length=255), table=<galaxy_user>, nullable=False), Column('username', TrimmedString(length=255), table=<galaxy_user>), Column('password', TrimmedString(length=255), table=<galaxy_user>, nullable=False), Column('last_password_change', DateTime(), table=<galaxy_user>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('external', Boolean(), table=<galaxy_user>, default=ScalarElementColumnDefault(False)), Column('form_values_id', Integer(), ForeignKey('form_values.id'), table=<galaxy_user>), Column('preferred_object_store_id', String(length=255), table=<galaxy_user>), Column('deleted', Boolean(), table=<galaxy_user>, default=ScalarElementColumnDefault(False)), Column('purged', Boolean(), table=<galaxy_user>, default=ScalarElementColumnDefault(False)), Column('disk_usage', Numeric(precision=15, scale=0), table=<galaxy_user>), Column('active', Boolean(), table=<galaxy_user>, nullable=False, default=ScalarElementColumnDefault(True)), Column('activation_token', TrimmedString(length=64), table=<galaxy_user>), schema=None)
class galaxy.model.PasswordResetToken(user, token=None)[source]

Bases: Base

user_id: Mapped[int | None]
__init__(user, token=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

token: Mapped[str]
user: Mapped[User | None]
expiration_time: Mapped[datetime | None]
table = Table('password_reset_token', MetaData(), Column('token', String(length=32), table=<password_reset_token>, primary_key=True, nullable=False), Column('expiration_time', DateTime(), table=<password_reset_token>), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<password_reset_token>), schema=None)
class galaxy.model.DynamicTool(active=True, hidden=True, **kwd)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
tool_id: Mapped[str | None]
tool_version: Mapped[str | None]
tool_format: Mapped[str | None]
tool_path: Mapped[str | None]
tool_directory: Mapped[str | None]
value: Mapped[bytes | None]
dict_collection_visible_keys = ('id', 'tool_id', 'tool_format', 'tool_version', 'uuid', 'active', 'hidden')
dict_element_visible_keys = ('id', 'tool_id', 'tool_format', 'tool_version', 'uuid', 'active', 'hidden')
__init__(active=True, hidden=True, **kwd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

active: Mapped[bool | None]
hidden: Mapped[bool | None]
uuid: Mapped[UUID | str | None]
table = Table('dynamic_tool', MetaData(), Column('id', Integer(), table=<dynamic_tool>, primary_key=True, nullable=False), Column('uuid', UUIDType(), table=<dynamic_tool>), Column('create_time', DateTime(), table=<dynamic_tool>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<dynamic_tool>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('tool_id', Unicode(length=255), table=<dynamic_tool>), Column('tool_version', Unicode(length=255), table=<dynamic_tool>), Column('tool_format', Unicode(length=255), table=<dynamic_tool>), Column('tool_path', Unicode(length=255), table=<dynamic_tool>), Column('tool_directory', Unicode(length=255), table=<dynamic_tool>), Column('hidden', Boolean(), table=<dynamic_tool>, default=ScalarElementColumnDefault(True)), Column('active', Boolean(), table=<dynamic_tool>, default=ScalarElementColumnDefault(True)), Column('value', MutableJSONType(), table=<dynamic_tool>), schema=None)
class galaxy.model.BaseJobMetric(plugin, metric_name, metric_value)[source]

Bases: Base

__init__(plugin, metric_name, metric_value)[source]

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

class galaxy.model.JobMetricText(plugin, metric_name, metric_value)[source]

Bases: BaseJobMetric, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
plugin: Mapped[str | None]
metric_name: Mapped[str | None]
metric_value: Mapped[str | None]
__init__(plugin, metric_name, metric_value)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('job_metric_text', MetaData(), Column('id', Integer(), table=<job_metric_text>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_metric_text>), Column('plugin', Unicode(length=255), table=<job_metric_text>), Column('metric_name', Unicode(length=255), table=<job_metric_text>), Column('metric_value', Unicode(length=1023), table=<job_metric_text>), schema=None)
class galaxy.model.JobMetricNumeric(plugin, metric_name, metric_value)[source]

Bases: BaseJobMetric, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
plugin: Mapped[str | None]
metric_name: Mapped[str | None]
metric_value: Mapped[Decimal | None]
__init__(plugin, metric_name, metric_value)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('job_metric_numeric', MetaData(), Column('id', Integer(), table=<job_metric_numeric>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_metric_numeric>), Column('plugin', Unicode(length=255), table=<job_metric_numeric>), Column('metric_name', Unicode(length=255), table=<job_metric_numeric>), Column('metric_value', Numeric(precision=26, scale=7), table=<job_metric_numeric>), schema=None)
class galaxy.model.TaskMetricText(plugin, metric_name, metric_value)[source]

Bases: BaseJobMetric, RepresentById

id: Mapped[int]
task_id: Mapped[int | None]
plugin: Mapped[str | None]
metric_name: Mapped[str | None]
metric_value: Mapped[str | None]
__init__(plugin, metric_name, metric_value)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('task_metric_text', MetaData(), Column('id', Integer(), table=<task_metric_text>, primary_key=True, nullable=False), Column('task_id', Integer(), ForeignKey('task.id'), table=<task_metric_text>), Column('plugin', Unicode(length=255), table=<task_metric_text>), Column('metric_name', Unicode(length=255), table=<task_metric_text>), Column('metric_value', Unicode(length=1023), table=<task_metric_text>), schema=None)
class galaxy.model.TaskMetricNumeric(plugin, metric_name, metric_value)[source]

Bases: BaseJobMetric, RepresentById

id: Mapped[int]
task_id: Mapped[int | None]
plugin: Mapped[str | None]
metric_name: Mapped[str | None]
metric_value: Mapped[Decimal | None]
__init__(plugin, metric_name, metric_value)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('task_metric_numeric', MetaData(), Column('id', Integer(), table=<task_metric_numeric>, primary_key=True, nullable=False), Column('task_id', Integer(), ForeignKey('task.id'), table=<task_metric_numeric>), Column('plugin', Unicode(length=255), table=<task_metric_numeric>), Column('metric_name', Unicode(length=255), table=<task_metric_numeric>), Column('metric_value', Numeric(precision=26, scale=7), table=<task_metric_numeric>), schema=None)
class galaxy.model.IoDicts(inp_data, out_data, out_collections)[source]

Bases: tuple

inp_data: Dict[str, DatasetInstance | None]

Alias for field number 0

out_data: Dict[str, DatasetInstance]

Alias for field number 1

out_collections: Dict[str, DatasetCollectionInstance | DatasetCollection]

Alias for field number 2

class galaxy.model.Job[source]

Bases: Base, JobLike, UsesCreateAndUpdateTime, Dictifiable, Serializable

A job represents a request to run a tool given input datasets, tool parameters, and output datasets.

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
history_id: Mapped[int | None]
library_folder_id: Mapped[int | None]
tool_id: Mapped[str | None]
tool_version: Mapped[str | None]
galaxy_version: Mapped[str | None]
dynamic_tool_id: Mapped[int | None]
info: Mapped[str | None]
copied_from_job_id: Mapped[int | None]
command_line: Mapped[str | None]
job_messages: Mapped[bytes | None]
param_filename: Mapped[str | None]
runner_name: Mapped[str | None]
job_stdout: Mapped[str | None]
job_stderr: Mapped[str | None]
tool_stdout: Mapped[str | None]
tool_stderr: Mapped[str | None]
exit_code: Mapped[int | None]
traceback: Mapped[str | None]
session_id: Mapped[int | None]
user_id: Mapped[int | None]
job_runner_name: Mapped[str | None]
job_runner_external_id: Mapped[str | None]
destination_id: Mapped[str | None]
destination_params: Mapped[bytes | None]
object_store_id: Mapped[str | None]
params: Mapped[str | None]
handler: Mapped[str | None]
preferred_object_store_id: Mapped[str | None]
object_store_id_overrides: Mapped[Dict[str, str] | None]
user: Mapped[User | None]
galaxy_session: Mapped[GalaxySession | None]
history: Mapped[History | None]
library_folder: Mapped[LibraryFolder | None]
parameters
input_datasets: Mapped[List[JobToInputDatasetAssociation]]
input_dataset_collections: Mapped[List[JobToInputDatasetCollectionAssociation]]
input_dataset_collection_elements: Mapped[List[JobToInputDatasetCollectionElementAssociation]]
output_dataset_collection_instances: Mapped[List[JobToOutputDatasetCollectionAssociation]]
output_dataset_collections: Mapped[List[JobToImplicitOutputDatasetCollectionAssociation]]
post_job_actions: Mapped[List[PostJobActionAssociation]]
input_library_datasets: Mapped[List[JobToInputLibraryDatasetAssociation]]
output_library_datasets: Mapped[List[JobToOutputLibraryDatasetAssociation]]
external_output_metadata: Mapped[List[JobExternalOutputMetadata]]
tasks: Mapped[List[Task]]
output_datasets: Mapped[List[JobToOutputDatasetAssociation]]
state_history: Mapped[List[JobStateHistory]]
text_metrics: Mapped[List[JobMetricText]]
numeric_metrics: Mapped[List[JobMetricNumeric]]
interactivetool_entry_points: Mapped[List[InteractiveToolEntryPoint]]
implicit_collection_jobs_association: Mapped[List[ImplicitCollectionJobsJobAssociation]]
container: Mapped[JobContainerAssociation | None]
data_manager_association: Mapped[DataManagerJobAssociation | None]
history_dataset_collection_associations: Mapped[List[HistoryDatasetCollectionAssociation]]
workflow_invocation_step: Mapped[WorkflowInvocationStep | None]
any_output_dataset_collection_instances_deleted
any_output_dataset_deleted
dict_collection_visible_keys = ['id', 'state', 'exit_code', 'update_time', 'create_time', 'galaxy_version']
dict_element_visible_keys = ['id', 'state', 'exit_code', 'update_time', 'create_time', 'galaxy_version', 'command_version', 'copied_from_job_id']
states

alias of JobState

terminal_states = [<JobState.OK: 'ok'>, <JobState.ERROR: 'error'>, <JobState.DELETED: 'deleted'>]
finished_states = [<JobState.OK: 'ok'>, <JobState.ERROR: 'error'>, <JobState.DELETED: 'deleted'>, <JobState.DELETING: 'deleting'>]
non_ready_states = [<JobState.NEW: 'new'>, <JobState.RESUBMITTED: 'resubmitted'>, <JobState.UPLOAD: 'upload'>, <JobState.WAITING: 'waiting'>, <JobState.QUEUED: 'queued'>, <JobState.RUNNING: 'running'>]

job states where the job hasn’t finished and the model may still change

__init__()

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

dependencies: Mapped[bytes | None]
state: Mapped[str]
imported: Mapped[bool | None]
property running
property finished
io_dicts(exclude_implicit_outputs=False) IoDicts[source]
get_external_output_metadata()[source]

The external_output_metadata is currently a reference from Job to JobExternalOutputMetadata. It exists for a job but not a task.

get_session_id()[source]
get_user_id()[source]
get_tool_id()[source]
get_tool_version()[source]
get_command_line()[source]
get_dependencies()[source]
get_param_filename()[source]
get_parameters()[source]
get_copied_from_job_id()[source]
get_input_datasets()[source]
get_output_datasets()[source]
get_input_library_datasets()[source]
get_output_library_datasets()[source]
get_state()[source]
get_info()[source]
get_job_runner_name()[source]
get_job_runner_external_id()[source]
get_post_job_actions()[source]
get_imported()[source]
get_handler()[source]
get_params()[source]
get_user()[source]
get_tasks()[source]
get_id_tag()[source]

Return a tag that can be useful in identifying a Job. This returns the Job’s get_id

set_session_id(session_id)[source]
set_user_id(user_id)[source]
set_tool_id(tool_id)[source]
get_user_email()[source]
set_tool_version(tool_version)[source]
set_command_line(command_line)[source]
set_dependencies(dependencies)[source]
set_param_filename(param_filename)[source]
set_parameters(parameters)[source]
set_copied_from_job_id(job_id)[source]
set_input_datasets(input_datasets)[source]
set_output_datasets(output_datasets)[source]
set_input_library_datasets(input_library_datasets)[source]
set_output_library_datasets(output_library_datasets)[source]
set_info(info)[source]
set_runner_name(job_runner_name)[source]
get_job()[source]
set_runner_external_id(job_runner_external_id)[source]
set_post_job_actions(post_job_actions)[source]
set_imported(imported)[source]
set_handler(handler)[source]
set_params(params)[source]
add_parameter(name, value)[source]
add_input_dataset(name, dataset=None, dataset_id=None)[source]
add_output_dataset(name, dataset)[source]
add_input_dataset_collection(name, dataset_collection)[source]
add_input_dataset_collection_element(name, dataset_collection_element)[source]
add_output_dataset_collection(name, dataset_collection_instance)[source]
add_implicit_output_dataset_collection(name, dataset_collection)[source]
add_input_library_dataset(name, dataset)[source]
add_output_library_dataset(name, dataset)[source]
add_post_job_action(pja)[source]
get_change_datatype_actions()[source]
property all_entry_points_configured
set_state(state: JobState) bool[source]

Save state history. Returns True if state has changed, else False.

get_param_values(app, ignore_errors=False)[source]

Read encoded parameter values from the database and turn back into a dict of tool parameter values.

raw_param_dict()[source]
check_if_output_datasets_deleted()[source]

Return true if all of the output datasets associated with this job are in the deleted state

mark_stopped(track_jobs_in_database=False)[source]

Mark this job as stopped

mark_deleted(track_jobs_in_database=False)[source]

Mark this job as deleted, and mark any output datasets as discarded.

mark_failed(info='Job execution failed', blurb=None, peek=None)[source]

Mark this job as failed, and mark any output datasets as errored.

resume(flush=True)[source]
requires_shareable_storage(security_agent)[source]
to_dict(view='collection', system_details=False)[source]

Return item dictionary.

update_hdca_update_time_for_job(update_time, sa_session, supports_skip_locked)[source]
set_final_state(final_state, supports_skip_locked)[source]
get_destination_configuration(dest_params, config, key, default=None)[source]

Get a destination parameter that can be defaulted back in specified config if it needs to be applied globally.

property command_version
update_output_states(supports_skip_locked)[source]
remappable()[source]

Check whether job is remappable when rerun

hide_outputs(flush=True)[source]
table = Table('job', MetaData(), Column('id', Integer(), table=<job>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<job>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<job>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('history_id', Integer(), ForeignKey('history.id'), table=<job>), Column('library_folder_id', Integer(), ForeignKey('library_folder.id'), table=<job>), Column('tool_id', String(length=255), table=<job>), Column('tool_version', TEXT(), table=<job>, default=ScalarElementColumnDefault('1.0.0')), Column('galaxy_version', String(length=64), table=<job>), Column('dynamic_tool_id', Integer(), ForeignKey('dynamic_tool.id'), table=<job>), Column('state', String(length=64), table=<job>), Column('info', TrimmedString(length=255), table=<job>), Column('copied_from_job_id', Integer(), table=<job>), Column('command_line', TEXT(), table=<job>), Column('dependencies', MutableJSONType(), table=<job>), Column('job_messages', MutableJSONType(), table=<job>), Column('param_filename', String(length=1024), table=<job>), Column('runner_name', String(length=255), table=<job>), Column('job_stdout', TEXT(), table=<job>), Column('job_stderr', TEXT(), table=<job>), Column('tool_stdout', TEXT(), table=<job>), Column('tool_stderr', TEXT(), table=<job>), Column('exit_code', Integer(), table=<job>), Column('traceback', TEXT(), table=<job>), Column('session_id', Integer(), ForeignKey('galaxy_session.id'), table=<job>), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<job>), Column('job_runner_name', String(length=255), table=<job>), Column('job_runner_external_id', String(length=255), table=<job>), Column('destination_id', String(length=255), table=<job>), Column('destination_params', MutableJSONType(), table=<job>), Column('object_store_id', TrimmedString(length=255), table=<job>), Column('imported', Boolean(), table=<job>, default=ScalarElementColumnDefault(False)), Column('params', TrimmedString(length=255), table=<job>), Column('handler', TrimmedString(length=255), table=<job>), Column('preferred_object_store_id', String(length=255), table=<job>), Column('object_store_id_overrides', JSONType(), table=<job>), schema=None)
class galaxy.model.Task(job, working_directory, prepare_files_cmd)[source]

Bases: Base, JobLike, RepresentById

A task represents a single component of a job.

id: Mapped[int]
create_time: Mapped[datetime]
execution_time: Mapped[datetime | None]
update_time: Mapped[datetime | None]
command_line: Mapped[str | None]
param_filename: Mapped[str | None]
runner_name: Mapped[str | None]
job_stdout: Mapped[str | None]
job_stderr: Mapped[str | None]
tool_stdout: Mapped[str | None]
tool_stderr: Mapped[str | None]
exit_code: Mapped[int | None]
job_messages: Mapped[bytes | None]
info: Mapped[str | None]
traceback: Mapped[str | None]
job_id: Mapped[int]
task_runner_name: Mapped[str | None]
task_runner_external_id: Mapped[str | None]
text_metrics: Mapped[List[TaskMetricText]]
numeric_metrics: Mapped[List[TaskMetricNumeric]]
class states(value)[source]

Bases: str, Enum

An enumeration.

NEW = 'new'
WAITING = 'waiting'
QUEUED = 'queued'
RUNNING = 'running'
OK = 'ok'
ERROR = 'error'
DELETED = 'deleted'
__init__(job, working_directory, prepare_files_cmd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

state: Mapped[str | None]
working_directory: Mapped[str | None]
job: Mapped[Job]
prepare_input_files_cmd: Mapped[str | None]
get_param_values(app)[source]

Read encoded parameter values from the database and turn back into a dict of tool parameter values.

get_id_tag()[source]

Return an id tag suitable for identifying the task. This combines the task’s job id and the task’s own id.

get_command_line()[source]
get_parameters()[source]
get_state()[source]
get_info()[source]
get_working_directory()[source]
get_task_runner_name()[source]
get_task_runner_external_id()[source]
get_job()[source]
get_prepare_input_files_cmd()[source]
get_external_output_metadata()[source]

The external_output_metadata is currently a backref to JobExternalOutputMetadata. It exists for a job but not a task, and when a task is cancelled its corresponding parent Job will be cancelled. So None is returned now, but that could be changed to self.get_job().get_external_output_metadata().

get_job_runner_name()[source]

Since runners currently access Tasks the same way they access Jobs, this method just refers to this instance’s runner.

get_job_runner_external_id()[source]

Runners will use the same methods to get information about the Task class as they will about the Job class, so this method just returns the task’s external id.

get_session_id()[source]
set_id(id)[source]
set_command_line(command_line)[source]
set_parameters(parameters)[source]
set_state(state)[source]
set_info(info)[source]
set_working_directory(working_directory)[source]
set_task_runner_name(task_runner_name)[source]
set_job_runner_external_id(task_runner_external_id)[source]
set_task_runner_external_id(task_runner_external_id)[source]
set_job(job)[source]
set_prepare_input_files_cmd(prepare_input_files_cmd)[source]
table = Table('task', MetaData(), Column('id', Integer(), table=<task>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<task>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('execution_time', DateTime(), table=<task>), Column('update_time', DateTime(), table=<task>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('state', String(length=64), table=<task>), Column('command_line', TEXT(), table=<task>), Column('param_filename', String(length=1024), table=<task>), Column('runner_name', String(length=255), table=<task>), Column('job_stdout', TEXT(), table=<task>), Column('job_stderr', TEXT(), table=<task>), Column('tool_stdout', TEXT(), table=<task>), Column('tool_stderr', TEXT(), table=<task>), Column('exit_code', Integer(), table=<task>), Column('job_messages', MutableJSONType(), table=<task>), Column('info', TrimmedString(length=255), table=<task>), Column('traceback', TEXT(), table=<task>), Column('job_id', Integer(), ForeignKey('job.id'), table=<task>, nullable=False), Column('working_directory', String(length=1024), table=<task>), Column('task_runner_name', String(length=255), table=<task>), Column('task_runner_external_id', String(length=255), table=<task>), Column('prepare_input_files_cmd', TEXT(), table=<task>), schema=None)
class galaxy.model.JobParameter(name, value)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
__init__(name, value)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str | None]
value: Mapped[str | None]
copy()[source]
table = Table('job_parameter', MetaData(), Column('id', Integer(), table=<job_parameter>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_parameter>), Column('name', String(length=255), table=<job_parameter>), Column('value', TEXT(), table=<job_parameter>), schema=None)
class galaxy.model.JobToInputDatasetAssociation(name, dataset)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
dataset_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset: Mapped[HistoryDatasetAssociation]
dataset_version: Mapped[int | None]
table = Table('job_to_input_dataset', MetaData(), Column('id', Integer(), table=<job_to_input_dataset>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_input_dataset>), Column('dataset_id', Integer(), ForeignKey('history_dataset_association.id'), table=<job_to_input_dataset>), Column('dataset_version', Integer(), table=<job_to_input_dataset>), Column('name', String(length=255), table=<job_to_input_dataset>), schema=None)
class galaxy.model.JobToOutputDatasetAssociation(name, dataset)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
dataset_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset: Mapped[HistoryDatasetAssociation]
property item
table = Table('job_to_output_dataset', MetaData(), Column('id', Integer(), table=<job_to_output_dataset>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_output_dataset>), Column('dataset_id', Integer(), ForeignKey('history_dataset_association.id'), table=<job_to_output_dataset>), Column('name', String(length=255), table=<job_to_output_dataset>), schema=None)
class galaxy.model.JobToInputDatasetCollectionAssociation(name, dataset_collection)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
dataset_collection_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset_collection)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset_collection: Mapped[HistoryDatasetCollectionAssociation]
table = Table('job_to_input_dataset_collection', MetaData(), Column('id', Integer(), table=<job_to_input_dataset_collection>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_input_dataset_collection>), Column('dataset_collection_id', Integer(), ForeignKey('history_dataset_collection_association.id'), table=<job_to_input_dataset_collection>), Column('name', String(length=255), table=<job_to_input_dataset_collection>), schema=None)
class galaxy.model.JobToInputDatasetCollectionElementAssociation(name, dataset_collection_element)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
dataset_collection_element_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset_collection_element)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset_collection_element: Mapped[DatasetCollectionElement]
table = Table('job_to_input_dataset_collection_element', MetaData(), Column('id', Integer(), table=<job_to_input_dataset_collection_element>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_input_dataset_collection_element>), Column('dataset_collection_element_id', Integer(), ForeignKey('dataset_collection_element.id'), table=<job_to_input_dataset_collection_element>), Column('name', Unicode(length=255), table=<job_to_input_dataset_collection_element>), schema=None)
class galaxy.model.JobToOutputDatasetCollectionAssociation(name, dataset_collection_instance)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
dataset_collection_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset_collection_instance)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset_collection_instance: Mapped[HistoryDatasetCollectionAssociation]
property item
table = Table('job_to_output_dataset_collection', MetaData(), Column('id', Integer(), table=<job_to_output_dataset_collection>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_output_dataset_collection>), Column('dataset_collection_id', Integer(), ForeignKey('history_dataset_collection_association.id'), table=<job_to_output_dataset_collection>), Column('name', Unicode(length=255), table=<job_to_output_dataset_collection>), schema=None)
class galaxy.model.JobToImplicitOutputDatasetCollectionAssociation(name, dataset_collection)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
dataset_collection_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset_collection)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset_collection: Mapped[DatasetCollection]
table = Table('job_to_implicit_output_dataset_collection', MetaData(), Column('id', Integer(), table=<job_to_implicit_output_dataset_collection>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_implicit_output_dataset_collection>), Column('dataset_collection_id', Integer(), ForeignKey('dataset_collection.id'), table=<job_to_implicit_output_dataset_collection>), Column('name', Unicode(length=255), table=<job_to_implicit_output_dataset_collection>), schema=None)
class galaxy.model.JobToInputLibraryDatasetAssociation(name, dataset)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
ldda_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset: Mapped[LibraryDatasetDatasetAssociation]
table = Table('job_to_input_library_dataset', MetaData(), Column('id', Integer(), table=<job_to_input_library_dataset>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_input_library_dataset>), Column('ldda_id', Integer(), ForeignKey('library_dataset_dataset_association.id'), table=<job_to_input_library_dataset>), Column('name', Unicode(length=255), table=<job_to_input_library_dataset>), schema=None)
class galaxy.model.JobToOutputLibraryDatasetAssociation(name, dataset)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
ldda_id: Mapped[int]
job: Mapped[Job]
__init__(name, dataset)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str]
dataset: Mapped[LibraryDatasetDatasetAssociation]
table = Table('job_to_output_library_dataset', MetaData(), Column('id', Integer(), table=<job_to_output_library_dataset>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_to_output_library_dataset>), Column('ldda_id', Integer(), ForeignKey('library_dataset_dataset_association.id'), table=<job_to_output_library_dataset>), Column('name', Unicode(length=255), table=<job_to_output_library_dataset>), schema=None)
class galaxy.model.JobStateHistory(job)[source]

Bases: Base, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
__init__(job)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

job_id: Mapped[int | None]
state: Mapped[str | None]
info: Mapped[str | None]
table = Table('job_state_history', MetaData(), Column('id', Integer(), table=<job_state_history>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<job_state_history>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_state_history>), Column('state', String(length=64), table=<job_state_history>), Column('info', TrimmedString(length=255), table=<job_state_history>), schema=None)
class galaxy.model.ImplicitlyCreatedDatasetCollectionInput(name, input_dataset_collection)[source]

Bases: Base, RepresentById

id: Mapped[int]
dataset_collection_id: Mapped[int | None]
input_dataset_collection_id: Mapped[int | None]
__init__(name, input_dataset_collection)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str | None]
input_dataset_collection: Mapped[HistoryDatasetCollectionAssociation | None]
table = Table('implicitly_created_dataset_collection_inputs', MetaData(), Column('id', Integer(), table=<implicitly_created_dataset_collection_inputs>, primary_key=True, nullable=False), Column('dataset_collection_id', Integer(), ForeignKey('history_dataset_collection_association.id'), table=<implicitly_created_dataset_collection_inputs>), Column('input_dataset_collection_id', Integer(), ForeignKey('history_dataset_collection_association.id'), table=<implicitly_created_dataset_collection_inputs>), Column('name', Unicode(length=255), table=<implicitly_created_dataset_collection_inputs>), schema=None)
class galaxy.model.ImplicitCollectionJobs(populated_state=None)[source]

Bases: Base, Serializable

id: Mapped[int]
jobs: Mapped[List[ImplicitCollectionJobsJobAssociation]]
class populated_states(value)[source]

Bases: str, Enum

An enumeration.

NEW = 'new'
OK = 'ok'
FAILED = 'failed'
__init__(populated_state=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

populated_state: Mapped[str]
property job_list
table = Table('implicit_collection_jobs', MetaData(), Column('id', Integer(), table=<implicit_collection_jobs>, primary_key=True, nullable=False), Column('populated_state', TrimmedString(length=64), table=<implicit_collection_jobs>, nullable=False, default=ScalarElementColumnDefault('new')), schema=None)
class galaxy.model.ImplicitCollectionJobsJobAssociation(**kwargs)[source]

Bases: Base, RepresentById

id: Mapped[int]
implicit_collection_jobs_id: Mapped[int]
job_id: Mapped[int]
order_index: Mapped[int]
implicit_collection_jobs
job: Mapped[Job]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('implicit_collection_jobs_job_association', MetaData(), Column('id', Integer(), table=<implicit_collection_jobs_job_association>, primary_key=True, nullable=False), Column('implicit_collection_jobs_id', Integer(), ForeignKey('implicit_collection_jobs.id'), table=<implicit_collection_jobs_job_association>), Column('job_id', Integer(), ForeignKey('job.id'), table=<implicit_collection_jobs_job_association>), Column('order_index', Integer(), table=<implicit_collection_jobs_job_association>, nullable=False), schema=None)
class galaxy.model.PostJobAction(action_type, workflow_step=None, output_name=None, action_arguments=None)[source]

Bases: Base, RepresentById

id: Mapped[int]
workflow_step_id: Mapped[int | None]
__init__(action_type, workflow_step=None, output_name=None, action_arguments=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

action_type: Mapped[str]
output_name: Mapped[str | None]
action_arguments: Mapped[bytes | None]
workflow_step: Mapped[WorkflowStep | None]
table = Table('post_job_action', MetaData(), Column('id', Integer(), table=<post_job_action>, primary_key=True, nullable=False), Column('workflow_step_id', Integer(), ForeignKey('workflow_step.id'), table=<post_job_action>), Column('action_type', String(length=255), table=<post_job_action>, nullable=False), Column('output_name', String(length=255), table=<post_job_action>), Column('action_arguments', MutableJSONType(), table=<post_job_action>), schema=None)
class galaxy.model.PostJobActionAssociation(pja, job=None, job_id=None)[source]

Bases: Base, RepresentById

id: Mapped[int]
post_job_action_id: Mapped[int]
__init__(pja, job=None, job_id=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

job: Mapped[Job]
job_id: Mapped[int]
post_job_action: Mapped[PostJobAction]
table = Table('post_job_action_association', MetaData(), Column('id', Integer(), table=<post_job_action_association>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<post_job_action_association>, nullable=False), Column('post_job_action_id', Integer(), ForeignKey('post_job_action.id'), table=<post_job_action_association>, nullable=False), schema=None)
class galaxy.model.JobExternalOutputMetadata(job=None, dataset=None)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
history_dataset_association_id: Mapped[int | None]
library_dataset_dataset_association_id: Mapped[int | None]
is_valid: Mapped[bool | None]
filename_in: Mapped[str | None]
filename_out: Mapped[str | None]
filename_results_code: Mapped[str | None]
filename_kwds: Mapped[str | None]
filename_override_metadata: Mapped[str | None]
job_runner_external_pid: Mapped[str | None]
__init__(job=None, dataset=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

job: Mapped[Job | None]
history_dataset_association: Mapped[HistoryDatasetAssociation | None]
library_dataset_dataset_association: Mapped[LibraryDatasetDatasetAssociation | None]
property dataset
table = Table('job_external_output_metadata', MetaData(), Column('id', Integer(), table=<job_external_output_metadata>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_external_output_metadata>), Column('history_dataset_association_id', Integer(), ForeignKey('history_dataset_association.id'), table=<job_external_output_metadata>), Column('library_dataset_dataset_association_id', Integer(), ForeignKey('library_dataset_dataset_association.id'), table=<job_external_output_metadata>), Column('is_valid', Boolean(), table=<job_external_output_metadata>, default=ScalarElementColumnDefault(True)), Column('filename_in', String(length=255), table=<job_external_output_metadata>), Column('filename_out', String(length=255), table=<job_external_output_metadata>), Column('filename_results_code', String(length=255), table=<job_external_output_metadata>), Column('filename_kwds', String(length=255), table=<job_external_output_metadata>), Column('filename_override_metadata', String(length=255), table=<job_external_output_metadata>), Column('job_runner_external_pid', String(length=255), table=<job_external_output_metadata>), schema=None)
class galaxy.model.FakeDatasetAssociation(dataset=None)[source]

Bases: object

fake_dataset_association = True
__init__(dataset=None)[source]
get_file_name(sync_cache=True)[source]
class galaxy.model.JobExportHistoryArchive(compressed=False, **kwd)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
history_id: Mapped[int | None]
dataset_id: Mapped[int | None]
history_attrs_filename: Mapped[str | None]
job: Mapped[Job | None]
dataset: Mapped[Dataset | None]
history: Mapped[History | None]
ATTRS_FILENAME_HISTORY = 'history_attrs.txt'
__init__(compressed=False, **kwd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

compressed: Mapped[bool | None]
property fda
property temp_directory
property up_to_date

Return False, if a new export should be generated for corresponding history.

property ready
property preparing
property export_name
static create_for_history(history, job, sa_session, object_store, compressed)[source]
to_dict()[source]
table = Table('job_export_history_archive', MetaData(), Column('id', Integer(), table=<job_export_history_archive>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_export_history_archive>), Column('history_id', Integer(), ForeignKey('history.id'), table=<job_export_history_archive>), Column('dataset_id', Integer(), ForeignKey('dataset.id'), table=<job_export_history_archive>), Column('compressed', Boolean(), table=<job_export_history_archive>, default=ScalarElementColumnDefault(False)), Column('history_attrs_filename', TEXT(), table=<job_export_history_archive>), schema=None)
class galaxy.model.JobImportHistoryArchive(**kwargs)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
history_id: Mapped[int | None]
archive_dir: Mapped[str | None]
job: Mapped[Job | None]
history: Mapped[History | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('job_import_history_archive', MetaData(), Column('id', Integer(), table=<job_import_history_archive>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_import_history_archive>), Column('history_id', Integer(), ForeignKey('history.id'), table=<job_import_history_archive>), Column('archive_dir', TEXT(), table=<job_import_history_archive>), schema=None)
class galaxy.model.StoreExportAssociation(**kwargs)[source]

Bases: Base, RepresentById

id: Mapped[int]
task_uuid: Mapped[UUID | str | None]
create_time: Mapped[datetime]
object_type: Mapped[str | None]
object_id: Mapped[int | None]
export_metadata: Mapped[bytes | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('store_export_association', MetaData(), Column('id', Integer(), table=<store_export_association>, primary_key=True, nullable=False), Column('task_uuid', UUIDType(), table=<store_export_association>), Column('create_time', DateTime(), table=<store_export_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('object_type', TrimmedString(length=32), table=<store_export_association>), Column('object_id', Integer(), table=<store_export_association>), Column('export_metadata', JSONType(), table=<store_export_association>), schema=None)
class galaxy.model.JobContainerAssociation(**kwd)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int]
container_type: Mapped[str | None]
container_name: Mapped[str | None]
created_time: Mapped[datetime | None]
modified_time: Mapped[datetime | None]
job: Mapped[Job]
__init__(**kwd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

container_info: Mapped[bytes | None]
table = Table('job_container_association', MetaData(), Column('id', Integer(), table=<job_container_association>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<job_container_association>), Column('container_type', TEXT(), table=<job_container_association>), Column('container_name', TEXT(), table=<job_container_association>), Column('container_info', MutableJSONType(), table=<job_container_association>), Column('created_time', DateTime(), table=<job_container_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('modified_time', DateTime(), table=<job_container_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
class galaxy.model.InteractiveToolEntryPoint(requires_domain=True, requires_path_in_url=False, configured=False, deleted=False, **kwd)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
name: Mapped[str | None]
tool_port: Mapped[int | None]
host: Mapped[str | None]
port: Mapped[int | None]
protocol: Mapped[str | None]
entry_url: Mapped[str | None]
requires_path_in_header_named: Mapped[str | None]
created_time: Mapped[datetime | None]
modified_time: Mapped[datetime | None]
label: Mapped[str | None]
job: Mapped[Job | None]
dict_collection_visible_keys = ['id', 'job_id', 'name', 'label', 'active', 'created_time', 'modified_time', 'output_datasets_ids']
dict_element_visible_keys = ['id', 'job_id', 'name', 'label', 'active', 'created_time', 'modified_time', 'output_datasets_ids']
__init__(requires_domain=True, requires_path_in_url=False, configured=False, deleted=False, **kwd)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

requires_domain: Mapped[bool | None]
requires_path_in_url: Mapped[bool | None]
configured: Mapped[bool | None]
deleted: Mapped[bool | None]
token: Mapped[str | None]
info: Mapped[bytes | None]
property active
property class_id
property output_datasets_ids
table = Table('interactivetool_entry_point', MetaData(), Column('id', Integer(), table=<interactivetool_entry_point>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<interactivetool_entry_point>), Column('name', TEXT(), table=<interactivetool_entry_point>), Column('token', TEXT(), table=<interactivetool_entry_point>), Column('tool_port', Integer(), table=<interactivetool_entry_point>), Column('host', TEXT(), table=<interactivetool_entry_point>), Column('port', Integer(), table=<interactivetool_entry_point>), Column('protocol', TEXT(), table=<interactivetool_entry_point>), Column('entry_url', TEXT(), table=<interactivetool_entry_point>), Column('requires_domain', Boolean(), table=<interactivetool_entry_point>, default=ScalarElementColumnDefault(True)), Column('requires_path_in_url', Boolean(), table=<interactivetool_entry_point>, default=ScalarElementColumnDefault(False)), Column('requires_path_in_header_named', TEXT(), table=<interactivetool_entry_point>), Column('info', MutableJSONType(), table=<interactivetool_entry_point>), Column('configured', Boolean(), table=<interactivetool_entry_point>, default=ScalarElementColumnDefault(False)), Column('deleted', Boolean(), table=<interactivetool_entry_point>, default=ScalarElementColumnDefault(False)), Column('created_time', DateTime(), table=<interactivetool_entry_point>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('modified_time', DateTime(), table=<interactivetool_entry_point>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('label', TEXT(), table=<interactivetool_entry_point>), schema=None)
class galaxy.model.GenomeIndexToolData(**kwargs)[source]

Bases: Base, RepresentById

id: Mapped[int]
job_id: Mapped[int | None]
dataset_id: Mapped[int | None]
fasta_path: Mapped[str | None]
created_time: Mapped[datetime | None]
modified_time: Mapped[datetime | None]
indexer: Mapped[str | None]
user_id: Mapped[int | None]
job: Mapped[Job | None]
dataset: Mapped[Dataset | None]
user: Mapped[User | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('genome_index_tool_data', MetaData(), Column('id', Integer(), table=<genome_index_tool_data>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<genome_index_tool_data>), Column('dataset_id', Integer(), ForeignKey('dataset.id'), table=<genome_index_tool_data>), Column('fasta_path', String(length=255), table=<genome_index_tool_data>), Column('created_time', DateTime(), table=<genome_index_tool_data>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('modified_time', DateTime(), table=<genome_index_tool_data>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('indexer', String(length=64), table=<genome_index_tool_data>), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<genome_index_tool_data>), schema=None)
class galaxy.model.Group(name=None)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
quotas: Mapped[List[GroupQuotaAssociation]]
roles: Mapped[List[GroupRoleAssociation]]
users: Mapped[List[UserGroupAssociation]]
dict_collection_visible_keys = ['id', 'name']
dict_element_visible_keys = ['id', 'name']
__init__(name=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str | None]
deleted: Mapped[bool | None]
table = Table('galaxy_group', MetaData(), Column('id', Integer(), table=<galaxy_group>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<galaxy_group>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<galaxy_group>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('name', String(length=255), table=<galaxy_group>), Column('deleted', Boolean(), table=<galaxy_group>, default=ScalarElementColumnDefault(False)), schema=None)
class galaxy.model.UserGroupAssociation(user, group)[source]

Bases: Base, RepresentById

id: Mapped[int]
user_id: Mapped[int]
group_id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
__init__(user, group)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

user: Mapped[User]
group: Mapped[Group]
table = Table('user_group_association', MetaData(), Column('id', Integer(), table=<user_group_association>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<user_group_association>), Column('group_id', Integer(), ForeignKey('galaxy_group.id'), table=<user_group_association>), Column('create_time', DateTime(), table=<user_group_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<user_group_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
class galaxy.model.Notification(source, category, variant, content)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
publication_time: Mapped[datetime | None]
expiration_time: Mapped[datetime | None]
dispatched: Mapped[bool]
galaxy_url: Mapped[str | None]
user_notification_associations: Mapped[List[UserNotificationAssociation]]
__init__(source, category, variant, content)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

source: Mapped[str]
category: Mapped[str]
variant: Mapped[str]
content: Mapped[bytes | None]
table = Table('notification', MetaData(), Column('id', Integer(), table=<notification>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<notification>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<notification>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('publication_time', DateTime(), table=<notification>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('expiration_time', DateTime(), table=<notification>, default=ScalarElementColumnDefault(datetime.datetime(2025, 5, 21, 9, 42, 1, 471350))), Column('source', String(length=32), table=<notification>), Column('category', String(length=64), table=<notification>), Column('variant', String(length=16), table=<notification>), Column('dispatched', Boolean(), table=<notification>, nullable=False, default=ScalarElementColumnDefault(False)), Column('galaxy_url', String(length=255), table=<notification>), Column('content', DoubleEncodedJsonType(), table=<notification>), schema=None)
class galaxy.model.UserNotificationAssociation(user, notification)[source]

Bases: Base, RepresentById

id: Mapped[int]
user_id: Mapped[int]
notification_id: Mapped[int]
seen_time: Mapped[datetime | None]
deleted: Mapped[bool | None]
update_time: Mapped[datetime | None]
__init__(user, notification)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

user: Mapped[User]
notification: Mapped[Notification]
table = Table('user_notification_association', MetaData(), Column('id', Integer(), table=<user_notification_association>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<user_notification_association>), Column('notification_id', Integer(), ForeignKey('notification.id'), table=<user_notification_association>), Column('seen_time', DateTime(), table=<user_notification_association>), Column('deleted', Boolean(), table=<user_notification_association>, default=ScalarElementColumnDefault(False)), Column('update_time', DateTime(), table=<user_notification_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
galaxy.model.is_hda(d)[source]
class galaxy.model.HistoryAudit(*args, **kwargs)[source]

Bases: Base

history_id: Mapped[int]
update_time: Mapped[datetime]
__init__(*args, **kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

classmethod prune(sa_session)[source]
table = Table('history_audit', MetaData(), Column('history_id', Integer(), ForeignKey('history.id'), table=<history_audit>, primary_key=True, nullable=False), Column('update_time', DateTime(), table=<history_audit>, primary_key=True, nullable=False, default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
class galaxy.model.History(id=None, name=None, user=None)[source]

Bases: Base, HasTags, Dictifiable, UsesAnnotations, HasName, Serializable, UsesCreateAndUpdateTime

create_time: Mapped[datetime]
user_id: Mapped[int | None]
hid_counter: Mapped[int | None]
genome_build: Mapped[str | None]
importable: Mapped[bool | None]
slug: Mapped[str | None]
preferred_object_store_id: Mapped[str | None]
archived: Mapped[bool | None]
archive_export_id: Mapped[int | None]
datasets: Mapped[List[HistoryDatasetAssociation]]
exports: Mapped[List[JobExportHistoryArchive]]
active_datasets: Mapped[List[HistoryDatasetAssociation]]
dataset_collections: Mapped[List[HistoryDatasetCollectionAssociation]]
active_dataset_collections: Mapped[List[HistoryDatasetCollectionAssociation]]
visible_datasets: Mapped[List[HistoryDatasetAssociation]]
visible_dataset_collections: Mapped[List[HistoryDatasetCollectionAssociation]]
tags: Mapped[List[HistoryTagAssociation]]
annotations: Mapped[List[HistoryAnnotationAssociation]]
ratings: Mapped[List[HistoryRatingAssociation]]
default_permissions: Mapped[List[DefaultHistoryPermissions]]
users_shared_with: Mapped[List[HistoryUserShareAssociation]]
galaxy_sessions
workflow_invocations: Mapped[List[WorkflowInvocation]]
jobs: Mapped[List[Job]]
update_time: Mapped[datetime | None]
users_shared_with_count
average_rating
users_shared_with_dot_users = ObjectAssociationProxyInstance(AssociationProxy('users_shared_with', 'user'))
dict_collection_visible_keys = ['id', 'name', 'published', 'deleted']
dict_element_visible_keys = ['id', 'name', 'archived', 'create_time', 'deleted', 'empty', 'genome_build', 'hid_counter', 'importable', 'preferred_object_store_id', 'purged', 'published', 'slug', 'tags', 'update_time', 'username']
default_name = 'Unnamed history'
__init__(id=None, name=None, user=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

id: Mapped[int]
name: Mapped[str | None]
deleted: Mapped[bool | None]
purged: Mapped[bool | None]
importing: Mapped[bool | None]
published: Mapped[bool | None]
user: Mapped[User | None]
init_on_load()[source]
stage_addition(items)[source]
property empty
property username
property count
update()[source]
add_pending_items(set_output_hid=True)[source]
add_galaxy_session(galaxy_session, association=None)[source]
add_dataset(dataset, parent_id=None, genome_build=None, set_hid=True, quota=True)[source]
add_datasets(sa_session, datasets, parent_id=None, genome_build=None, set_hid=True, quota=True, flush=False)[source]

Optimized version of add_dataset above that minimizes database interactions when adding many datasets and collections to history at once.

add_dataset_collection(history_dataset_collection, set_hid=True)[source]
copy(name=None, target_user=None, activatable=False, all_datasets=False)[source]

Return a copy of this history using the given name and target_user. If activatable, copy only non-deleted datasets. If all_datasets, copy non-deleted, deleted, and purged datasets.

get_dataset_by_hid(hid)[source]
property has_possible_members
property activatable_datasets
to_dict(view='collection', value_mapper=None)[source]

Return item dictionary.

property latest_export
unhide_datasets()[source]
resume_paused_jobs()[source]
property paused_jobs
disk_size

Return a query scalar that will get any history’s size in bytes by summing the ‘total_size’s of all non-purged, unique datasets within it.

property disk_nice_size

Returns human readable size of history on disk.

property active_datasets_and_roles
property active_visible_datasets_and_roles
property active_visible_dataset_collections
property active_contents

Return all active contents ordered by hid.

contents_iter(**kwds)[source]

Fetch filtered list of contents of history.

table = Table('history', MetaData(), Column('id', Integer(), table=<history>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<history>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<history>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<history>), Column('name', TrimmedString(length=255), table=<history>), Column('hid_counter', Integer(), table=<history>, default=ScalarElementColumnDefault(1)), Column('deleted', Boolean(), table=<history>, default=ScalarElementColumnDefault(False)), Column('purged', Boolean(), table=<history>, default=ScalarElementColumnDefault(False)), Column('importing', Boolean(), table=<history>, default=ScalarElementColumnDefault(False)), Column('genome_build', TrimmedString(length=40), table=<history>), Column('importable', Boolean(), table=<history>, default=ScalarElementColumnDefault(False)), Column('slug', TEXT(), table=<history>), Column('published', Boolean(), table=<history>, default=ScalarElementColumnDefault(False)), Column('preferred_object_store_id', String(length=255), table=<history>), Column('archived', Boolean(), table=<history>, default=ScalarElementColumnDefault(False), server_default=DefaultClause(<sqlalchemy.sql.elements.False_ object>, for_update=False)), Column('archive_export_id', Integer(), ForeignKey('store_export_association.id'), table=<history>), schema=None)
class galaxy.model.UserShareAssociation[source]

Bases: RepresentById

user: Mapped[User]
class galaxy.model.HistoryUserShareAssociation(**kwargs)[source]

Bases: Base, UserShareAssociation

id: Mapped[int]
history_id: Mapped[int]
user_id: Mapped[int]
user: Mapped[User]
history: Mapped[History]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('history_user_share_association', MetaData(), Column('id', Integer(), table=<history_user_share_association>, primary_key=True, nullable=False), Column('history_id', Integer(), ForeignKey('history.id'), table=<history_user_share_association>), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<history_user_share_association>), schema=None)
class galaxy.model.UserRoleAssociation(user, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
user_id: Mapped[int]
role_id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
__init__(user, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

user: Mapped[User]
role: Mapped[Role]
table = Table('user_role_association', MetaData(), Column('id', Integer(), table=<user_role_association>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<user_role_association>), Column('role_id', Integer(), ForeignKey('role.id'), table=<user_role_association>), Column('create_time', DateTime(), table=<user_role_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<user_role_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
class galaxy.model.GroupRoleAssociation(group, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
group_id: Mapped[int]
role_id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
__init__(group, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

group: Mapped[Group]
role: Mapped[Role]
table = Table('group_role_association', MetaData(), Column('id', Integer(), table=<group_role_association>, primary_key=True, nullable=False), Column('group_id', Integer(), ForeignKey('galaxy_group.id'), table=<group_role_association>), Column('role_id', Integer(), ForeignKey('role.id'), table=<group_role_association>), Column('create_time', DateTime(), table=<group_role_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<group_role_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
class galaxy.model.Role(name=None, description=None, type=types.SYSTEM, deleted=False)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
dataset_actions: Mapped[List[DatasetPermissions]]
groups: Mapped[List[GroupRoleAssociation]]
users: Mapped[List[UserRoleAssociation]]
dict_collection_visible_keys = ['id', 'name']
dict_element_visible_keys = ['id', 'name', 'description', 'type']
private_id = None
class types(value)[source]

Bases: str, Enum

An enumeration.

PRIVATE = 'private'
SYSTEM = 'system'
USER = 'user'
ADMIN = 'admin'
SHARING = 'sharing'
__init__(name=None, description=None, type=types.SYSTEM, deleted=False)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str | None]
description: Mapped[str | None]
type: Mapped[str | None]
deleted: Mapped[bool | None]
table = Table('role', MetaData(), Column('id', Integer(), table=<role>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<role>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<role>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('name', String(length=255), table=<role>), Column('description', TEXT(), table=<role>), Column('type', String(length=40), table=<role>), Column('deleted', Boolean(), table=<role>, default=ScalarElementColumnDefault(False)), schema=None)
class galaxy.model.UserQuotaSourceUsage(**kwargs)[source]

Bases: Base, Dictifiable, RepresentById

dict_element_visible_keys = ['disk_usage', 'quota_source_label']
id: Mapped[int]
user_id: Mapped[int | None]
quota_source_label: Mapped[str | None]
disk_usage: Mapped[Decimal]
user: Mapped[User | None]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('user_quota_source_usage', MetaData(), Column('id', Integer(), table=<user_quota_source_usage>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<user_quota_source_usage>), Column('quota_source_label', String(length=32), table=<user_quota_source_usage>), Column('disk_usage', Numeric(precision=15, scale=0), table=<user_quota_source_usage>, nullable=False, default=ScalarElementColumnDefault(0)), schema=None)
class galaxy.model.UserQuotaAssociation(user, quota)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
user_id: Mapped[int]
quota_id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
dict_element_visible_keys = ['user']
__init__(user, quota)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

user: Mapped[User]
quota: Mapped[Quota]
table = Table('user_quota_association', MetaData(), Column('id', Integer(), table=<user_quota_association>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<user_quota_association>), Column('quota_id', Integer(), ForeignKey('quota.id'), table=<user_quota_association>), Column('create_time', DateTime(), table=<user_quota_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<user_quota_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
class galaxy.model.GroupQuotaAssociation(group, quota)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
group_id: Mapped[int]
quota_id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
dict_element_visible_keys = ['group']
__init__(group, quota)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

group: Mapped[Group]
quota: Mapped[Quota]
table = Table('group_quota_association', MetaData(), Column('id', Integer(), table=<group_quota_association>, primary_key=True, nullable=False), Column('group_id', Integer(), ForeignKey('galaxy_group.id'), table=<group_quota_association>), Column('quota_id', Integer(), ForeignKey('quota.id'), table=<group_quota_association>), Column('create_time', DateTime(), table=<group_quota_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<group_quota_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), schema=None)
class galaxy.model.Quota(name=None, description=None, amount=0, operation='=', quota_source_label=None)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
deleted: Mapped[bool | None]
default: Mapped[List[DefaultQuotaAssociation]]
groups: Mapped[List[GroupQuotaAssociation]]
users: Mapped[List[UserQuotaAssociation]]
dict_collection_visible_keys = ['id', 'name', 'quota_source_label']
dict_element_visible_keys = ['id', 'name', 'description', 'bytes', 'operation', 'display_amount', 'default', 'users', 'groups', 'quota_source_label']
valid_operations = ('+', '-', '=')
__init__(name=None, description=None, amount=0, operation='=', quota_source_label=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

name: Mapped[str | None]
description: Mapped[str | None]
bytes: Mapped[int | None]
operation: Mapped[str | None]
quota_source_label: Mapped[str | None]
get_amount()[source]
set_amount(amount)[source]
property amount
property display_amount
table = Table('quota', MetaData(), Column('id', Integer(), table=<quota>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<quota>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<quota>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('name', String(length=255), table=<quota>), Column('description', TEXT(), table=<quota>), Column('bytes', BigInteger(), table=<quota>), Column('operation', String(length=8), table=<quota>), Column('deleted', Boolean(), table=<quota>, default=ScalarElementColumnDefault(False)), Column('quota_source_label', String(length=32), table=<quota>), schema=None)
class galaxy.model.DefaultQuotaAssociation(type, quota)[source]

Bases: Base, Dictifiable, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
quota_id: Mapped[int]
dict_element_visible_keys = ['type']
class types(value)[source]

Bases: str, Enum

An enumeration.

UNREGISTERED = 'unregistered'
REGISTERED = 'registered'
__init__(type, quota)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

type: Mapped[str | None]
quota: Mapped[Quota]
table = Table('default_quota_association', MetaData(), Column('id', Integer(), table=<default_quota_association>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<default_quota_association>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<default_quota_association>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('type', String(length=32), table=<default_quota_association>), Column('quota_id', Integer(), ForeignKey('quota.id'), table=<default_quota_association>), schema=None)
class galaxy.model.DatasetPermissions(action, dataset, role=None, role_id=None)[source]

Bases: Base, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
dataset_id: Mapped[int | None]
__init__(action, dataset, role=None, role_id=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

action: Mapped[str | None]
dataset: Mapped[Dataset | None]
role: Mapped[Role | None]
role_id: Mapped[int | None]
table = Table('dataset_permissions', MetaData(), Column('id', Integer(), table=<dataset_permissions>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<dataset_permissions>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<dataset_permissions>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('action', TEXT(), table=<dataset_permissions>), Column('dataset_id', Integer(), ForeignKey('dataset.id'), table=<dataset_permissions>), Column('role_id', Integer(), ForeignKey('role.id'), table=<dataset_permissions>), schema=None)
class galaxy.model.LibraryPermissions(action, library_item, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
library_id: Mapped[int | None]
role_id: Mapped[int | None]
__init__(action, library_item, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

action: Mapped[str | None]
library: Mapped[Library | None]
role: Mapped[Role | None]
table = Table('library_permissions', MetaData(), Column('id', Integer(), table=<library_permissions>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<library_permissions>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<library_permissions>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('action', TEXT(), table=<library_permissions>), Column('library_id', Integer(), ForeignKey('library.id'), table=<library_permissions>), Column('role_id', Integer(), ForeignKey('role.id'), table=<library_permissions>), schema=None)
class galaxy.model.LibraryFolderPermissions(action, library_item, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
library_folder_id: Mapped[int | None]
role_id: Mapped[int | None]
__init__(action, library_item, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

action: Mapped[str | None]
folder: Mapped[LibraryFolder | None]
role: Mapped[Role | None]
table = Table('library_folder_permissions', MetaData(), Column('id', Integer(), table=<library_folder_permissions>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<library_folder_permissions>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<library_folder_permissions>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('action', TEXT(), table=<library_folder_permissions>), Column('library_folder_id', Integer(), ForeignKey('library_folder.id'), table=<library_folder_permissions>), Column('role_id', Integer(), ForeignKey('role.id'), table=<library_folder_permissions>), schema=None)
class galaxy.model.LibraryDatasetPermissions(action, library_item, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
library_dataset_id: Mapped[int | None]
role_id: Mapped[int | None]
__init__(action, library_item, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

action: Mapped[str | None]
library_dataset: Mapped[LibraryDataset | None]
role: Mapped[Role | None]
table = Table('library_dataset_permissions', MetaData(), Column('id', Integer(), table=<library_dataset_permissions>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<library_dataset_permissions>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<library_dataset_permissions>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('action', TEXT(), table=<library_dataset_permissions>), Column('library_dataset_id', Integer(), ForeignKey('library_dataset.id'), table=<library_dataset_permissions>), Column('role_id', Integer(), ForeignKey('role.id'), table=<library_dataset_permissions>), schema=None)
class galaxy.model.LibraryDatasetDatasetAssociationPermissions(action, library_item, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
library_dataset_dataset_association_id: Mapped[int]
role_id: Mapped[int | None]
__init__(action, library_item, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

action: Mapped[str | None]
library_dataset_dataset_association: Mapped[LibraryDatasetDatasetAssociation]
role: Mapped[Role | None]
table = Table('library_dataset_dataset_association_permissions', MetaData(), Column('id', Integer(), table=<library_dataset_dataset_association_permissions>, primary_key=True, nullable=False), Column('create_time', DateTime(), table=<library_dataset_dataset_association_permissions>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<library_dataset_dataset_association_permissions>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('action', TEXT(), table=<library_dataset_dataset_association_permissions>), Column('library_dataset_dataset_association_id', Integer(), ForeignKey('library_dataset_dataset_association.id'), table=<library_dataset_dataset_association_permissions>), Column('role_id', Integer(), ForeignKey('role.id'), table=<library_dataset_dataset_association_permissions>), schema=None)
class galaxy.model.DefaultUserPermissions(user, action, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
user_id: Mapped[int | None]
role_id: Mapped[int | None]
__init__(user, action, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

user: Mapped[User | None]
action: Mapped[str | None]
role: Mapped[Role | None]
table = Table('default_user_permissions', MetaData(), Column('id', Integer(), table=<default_user_permissions>, primary_key=True, nullable=False), Column('user_id', Integer(), ForeignKey('galaxy_user.id'), table=<default_user_permissions>), Column('action', TEXT(), table=<default_user_permissions>), Column('role_id', Integer(), ForeignKey('role.id'), table=<default_user_permissions>), schema=None)
class galaxy.model.DefaultHistoryPermissions(history, action, role)[source]

Bases: Base, RepresentById

id: Mapped[int]
history_id: Mapped[int | None]
role_id: Mapped[int | None]
__init__(history, action, role)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

history: Mapped[History | None]
action: Mapped[str | None]
role: Mapped[Role | None]
table = Table('default_history_permissions', MetaData(), Column('id', Integer(), table=<default_history_permissions>, primary_key=True, nullable=False), Column('history_id', Integer(), ForeignKey('history.id'), table=<default_history_permissions>), Column('action', TEXT(), table=<default_history_permissions>), Column('role_id', Integer(), ForeignKey('role.id'), table=<default_history_permissions>), schema=None)
class galaxy.model.StorableObject[source]

Bases: object

flush()[source]
galaxy.model.setup_global_object_store_for_models(object_store)[source]
class galaxy.model.Dataset(id=None, state=None, external_filename=None, extra_files_path=None, file_size=None, purgable=True, uuid=None)[source]

Bases: Base, StorableObject, Serializable

job_id: Mapped[int | None]
create_time: Mapped[datetime]
update_time: Mapped[datetime]
object_store_id: Mapped[str | None]
created_from_basename: Mapped[str | None]
total_size: Mapped[Decimal | None]
actions: Mapped[List[DatasetPermissions]]
job: Mapped[Job | None]
active_history_associations: Mapped[List[HistoryDatasetAssociation]]
purged_history_associations: Mapped[List[HistoryDatasetAssociation]]
active_library_associations: Mapped[List[LibraryDatasetDatasetAssociation]]
history_associations: Mapped[List[HistoryDatasetAssociation]]
library_associations: Mapped[List[LibraryDatasetDatasetAssociation]]
states

alias of DatasetState

non_ready_states = (<DatasetState.NEW: 'new'>, <DatasetState.UPLOAD: 'upload'>, <DatasetState.QUEUED: 'queued'>, <DatasetState.RUNNING: 'running'>, <DatasetState.SETTING_METADATA: 'setting_metadata'>)
ready_states = (<DatasetState.ERROR: 'error'>, <DatasetState.EMPTY: 'empty'>, <DatasetState.PAUSED: 'paused'>, <DatasetState.DEFERRED: 'deferred'>, <DatasetState.FAILED_METADATA: 'failed_metadata'>, <DatasetState.OK: 'ok'>, <DatasetState.DISCARDED: 'discarded'>)
valid_input_states = (<DatasetState.SETTING_METADATA: 'setting_metadata'>, <DatasetState.EMPTY: 'empty'>, <DatasetState.RUNNING: 'running'>, <DatasetState.NEW: 'new'>, <DatasetState.PAUSED: 'paused'>, <DatasetState.DEFERRED: 'deferred'>, <DatasetState.UPLOAD: 'upload'>, <DatasetState.OK: 'ok'>, <DatasetState.QUEUED: 'queued'>)
no_data_states = (<DatasetState.PAUSED: 'paused'>, <DatasetState.DEFERRED: 'deferred'>, <DatasetState.DISCARDED: 'discarded'>, <DatasetState.NEW: 'new'>, <DatasetState.UPLOAD: 'upload'>, <DatasetState.QUEUED: 'queued'>, <DatasetState.RUNNING: 'running'>, <DatasetState.SETTING_METADATA: 'setting_metadata'>)
terminal_states = (<DatasetState.OK: 'ok'>, <DatasetState.EMPTY: 'empty'>, <DatasetState.ERROR: 'error'>, <DatasetState.DEFERRED: 'deferred'>, <DatasetState.DISCARDED: 'discarded'>, <DatasetState.FAILED_METADATA: 'failed_metadata'>)
class conversion_messages(value)[source]

Bases: str, Enum

An enumeration.

PENDING = 'pending'
NO_DATA = 'no data'
NO_CHROMOSOME = 'no chromosome'
NO_CONVERTER = 'no converter'
NO_TOOL = 'no tool'
DATA = 'data'
ERROR = 'error'
OK = 'ok'
permitted_actions = <galaxy.util.bunch.Bunch object>
file_path = '/tmp/'
object_store = None
engine = None
__init__(id=None, state=None, external_filename=None, extra_files_path=None, file_size=None, purgable=True, uuid=None)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

id: Mapped[int]
uuid: Mapped[UUID | str | None]
state: Mapped[str | None]
deleted: Mapped[bool | None]
purged: Mapped[bool | None]
purgable: Mapped[bool | None]
external_filename: Mapped[str | None]
file_size: Mapped[Decimal | None]
sources: Mapped[List[DatasetSource]]
hashes: Mapped[List[DatasetHash]]
property is_new
in_ready_state()[source]
property shareable

Return True if placed into an objectstore not labeled as private.

ensure_shareable()[source]
get_file_name(sync_cache=True)[source]
property quota_source_label
property quota_source_info
property device_source_label
property device_source_info
set_file_name(filename)[source]
get_extra_files_path()[source]
create_extra_files_path()[source]
set_extra_files_path(extra_files_path)[source]
property extra_files_path
extra_files_path_exists()[source]
property store_by
extra_files_path_name_from(object_store)[source]
property extra_files_path_name
get_size(nice_size: typing_extensions.Literal[False], calculate_size: bool = True) int[source]
get_size(nice_size: typing_extensions.Literal[True], calculate_size: bool = True) str

Returns the size of the data on disk

set_size(no_extra_files=False)[source]

Sets the size of the data on disk.

If the caller is sure there are no extra files, pass no_extra_files as True to optimize subsequent calls to get_total_size or set_total_size - potentially avoiding both a database flush and check against the file system.

get_total_size()[source]
set_total_size()[source]
has_data()[source]

Detects whether there is any data

mark_deleted()[source]
property user_can_purge
full_delete()[source]

Remove the file and extra files, marks deleted and purged

get_access_roles(security_agent)[source]
get_manage_permissions_roles(security_agent)[source]
has_manage_permissions_roles(security_agent)[source]
table = Table('dataset', MetaData(), Column('id', Integer(), table=<dataset>, primary_key=True, nullable=False), Column('job_id', Integer(), ForeignKey('job.id'), table=<dataset>), Column('create_time', DateTime(), table=<dataset>, default=CallableColumnDefault(<function datetime.utcnow>)), Column('update_time', DateTime(), table=<dataset>, onupdate=CallableColumnDefault(<function datetime.utcnow>), default=CallableColumnDefault(<function datetime.utcnow>)), Column('state', TrimmedString(length=64), table=<dataset>), Column('deleted', Boolean(), table=<dataset>, default=ScalarElementColumnDefault(False)), Column('purged', Boolean(), table=<dataset>, default=ScalarElementColumnDefault(False)), Column('purgable', Boolean(), table=<dataset>, default=ScalarElementColumnDefault(True)), Column('object_store_id', TrimmedString(length=255), table=<dataset>), Column('external_filename', TEXT(), table=<dataset>), Column('_extra_files_path', TEXT(), table=<dataset>), Column('created_from_basename', TEXT(), table=<dataset>), Column('file_size', Numeric(precision=15, scale=0), table=<dataset>), Column('total_size', Numeric(precision=15, scale=0), table=<dataset>), Column('uuid', UUIDType(), table=<dataset>), schema=None)
class galaxy.model.DatasetSource(**kwargs)[source]

Bases: Base, Dictifiable, Serializable

id: Mapped[int]
dataset_id: Mapped[int | None]
source_uri: Mapped[str | None]
extra_files_path: Mapped[str | None]
transform: Mapped[List[TransformAction] | None]
dataset: Mapped[Dataset | None]
hashes: Mapped[List[DatasetSourceHash]]
dict_collection_visible_keys = ['id', 'source_uri', 'extra_files_path', 'transform']
dict_element_visible_keys = ['id', 'source_uri', 'extra_files_path', 'transform']
copy() DatasetSource[source]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('dataset_source', MetaData(), Column('id', Integer(), table=<dataset_source>, primary_key=True, nullable=False), Column('dataset_id', Integer(), ForeignKey('dataset.id'), table=<dataset_source>), Column('source_uri', TEXT(), table=<dataset_source>), Column('extra_files_path', TEXT(), table=<dataset_source>), Column('transform', MutableJSONType(), table=<dataset_source>), schema=None)
class galaxy.model.DatasetSourceHash(**kwargs)[source]

Bases: Base, Serializable

id: Mapped[int]
dataset_source_id: Mapped[int | None]
hash_function: Mapped[str | None]
hash_value: Mapped[str | None]
source: Mapped[DatasetSource | None]
copy() DatasetSourceHash[source]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('dataset_source_hash', MetaData(), Column('id', Integer(), table=<dataset_source_hash>, primary_key=True, nullable=False), Column('dataset_source_id', Integer(), ForeignKey('dataset_source.id'), table=<dataset_source_hash>), Column('hash_function', TEXT(), table=<dataset_source_hash>), Column('hash_value', TEXT(), table=<dataset_source_hash>), schema=None)
class galaxy.model.DatasetHash(**kwargs)[source]

Bases: Base, Dictifiable, Serializable

id: Mapped[int]
dataset_id: Mapped[int | None]
hash_function: Mapped[str | None]
hash_value: Mapped[str | None]
extra_files_path: Mapped[str | None]
dataset: Mapped[Dataset | None]
dict_collection_visible_keys = ['id', 'hash_function', 'hash_value', 'extra_files_path']
dict_element_visible_keys = ['id', 'hash_function', 'hash_value', 'extra_files_path']
copy() DatasetHash[source]
__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

table = Table('dataset_hash', MetaData(), Column('id', Integer(), table=<dataset_hash>, primary_key=True, nullable=False), Column('dataset_id', Integer(), ForeignKey('dataset.id'), table=<dataset_hash>), Column('hash_function', TEXT(), table=<dataset_hash>), Column('hash_value', TEXT(), table=<dataset_hash>), Column('extra_files_path', TEXT(), table=<dataset_hash>), schema=None)
galaxy.model.datatype_for_extension(extension, datatypes_registry=None) Data[source]
class galaxy.model.DatasetInstance(id=None, hid=None, name=None, info=None, blurb=None, peek=None, tool_version=None, extension=None, dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None, parent_id=None, validated_state=DatasetValidatedState.UNKNOWN, validated_state_message=None, visible=True, create_dataset=False, sa_session=None, extended_metadata=None, flush=True, metadata_deferred=False, creating_job_id=None, copied_from_history_dataset_association=None, copied_from_library_dataset_dataset_association=None)[source]

Bases: RepresentById, UsesCreateAndUpdateTime, object

A base class for all ‘dataset instances’, HDAs, LDAs, etc

states

alias of DatasetState

class conversion_messages(value)

Bases: str, Enum

An enumeration.

PENDING = 'pending'
NO_DATA = 'no data'
NO_CHROMOSOME = 'no chromosome'
NO_CONVERTER = 'no converter'
NO_TOOL = 'no tool'
DATA = 'data'
ERROR = 'error'
OK = 'ok'
permitted_actions = <galaxy.util.bunch.Bunch object>
purged: bool
creating_job_associations: List[JobToOutputDatasetCollectionAssociation | JobToOutputDatasetAssociation]
copied_from_history_dataset_association: HistoryDatasetAssociation | None
copied_from_library_dataset_dataset_association: LibraryDatasetDatasetAssociation | None
dependent_jobs: List[JobToInputLibraryDatasetAssociation]
implicitly_converted_datasets: List[ImplicitlyConvertedDatasetAssociation]
implicitly_converted_parent_datasets: List[ImplicitlyConvertedDatasetAssociation]
validated_states

alias of DatasetValidatedState

__init__(id=None, hid=None, name=None, info=None, blurb=None, peek=None, tool_version=None, extension=None, dbkey=None, <