API Reference: Entity Types#
Complete reference for all B-Fabric entity types.
- class bfabric.entities.core.entity.Entity(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
FindMixinA single generic entity, read from B-Fabric.
- ENDPOINT() str#
- property bfabric_instance: str#
The bfabric instance URL associated with the entity.
- property classname: str#
The entity’s classname.
- property custom_attributes: dict[str, str]#
Returns custom attributes as a dictionary, if the entity has any.
If the field exists but is empty, an empty dictionary is returned. If the field does not exist, an AttributeError is raised.
- property data_dict: ApiResponseObjectType#
Returns a shallow copy of the entity’s data dictionary.
- dump_yaml(path: Path) None#
Writes the entity’s data dictionary to a YAML file.
- get(key: str, default: Any = None) ApiResponseDataType | None#
Returns the value of a key in the data dictionary, or a default value if the key is not present.
- property id: int#
Returns the entity’s ID.
- classmethod load_yaml(path: Path, client: Bfabric | None = None, bfabric_instance: str | None = None) Self#
Loads an entity from a YAML file.
- property refs: References#
Returns the entity’s references manager.
- property web_url: str#
- class bfabric.entities.Application(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'application'#
- executable: HasOne[Executable]#
- property technology_folder_name: Annotated[str, BeforeValidator(func=path_safe_name, json_schema_input_type=PydanticUndefined)]#
Returns the technology which is used e.g. for output registration.
Currently, in case of multiple technologies, the first one (alphabetically) is used. TODO this logic should probably be improved in the future
- class bfabric.entities.Dataset(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
EntityRepresentation of a single dataset in B-Fabric.
- ENDPOINT: str = 'dataset'#
- property column_names: list[str]#
Returns a list of column names in the dataset.
- property column_types: dict[str, str]#
Returns a dictionary mapping column names to their data types.
- get_csv(separator: str = ',') str#
Returns the dataset as a csv string, using the specified column separator.
- get_parquet() bytes#
Returns the dataset as a parquet bytes object.
- to_polars() DataFrame#
Returns a Polars DataFrame representation of the dataset.
- write_csv(path: Path, separator: str = ',') None#
Writes the dataset to a csv file at path, using the specified column separator.
- write_parquet(path: Path) None#
Writes the dataset to a parquet file at path.
- class bfabric.entities.Executable(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'executable'#
- property decoded: str | None#
- property decoded_bytes: bytes | None#
- property decoded_str: str | None#
- storage#
- class bfabric.entities.ExternalJob(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'externaljob'#
- executable: HasOne[Executable]#
- class bfabric.entities.Instrument(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'instrument'#
- class bfabric.entities.MultiplexId(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'multiplexid'#
- class bfabric.entities.MultiplexKit(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'multiplexkit'#
- property ids: DataFrame#
- multiplex_ids: HasMany[MultiplexId]#
- class bfabric.entities.Order(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'order'#
- class bfabric.entities.Parameter(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'parameter'#
- property key: str#
- property value: str#
- class bfabric.entities.Plate(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'plate'#
- class bfabric.entities.Project(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'project'#
- class bfabric.entities.Resource(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'resource'#
- property filename: str#
Returns the filename of the actual path, i.e. not necessarily the resource name but rather the name as the file is stored.
- property storage_absolute_path: Path#
Returns the absolute path of the resource in the storage as a Path object.
- property storage_relative_path: Path#
Returns the relative path of the resource in the storage as a Path object.
- class bfabric.entities.Run(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'run'#
- class bfabric.entities.Sample(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'sample'#
- class bfabric.entities.Storage(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'storage'#
- property base_path: Path#
- property scp_prefix: str | None#
SCP prefix with storage base path included.
- class bfabric.entities.User(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity- ENDPOINT = 'user'#
- class bfabric.entities.Workflow(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity,UserCreatedMixin- ENDPOINT = 'workflow'#
- workflow_steps: HasMany[WorkflowStep]#
- workflow_template: HasOne[WorkflowTemplate]#
- class bfabric.entities.WorkflowStep(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity,UserCreatedMixin- ENDPOINT = 'workflowstep'#
- class bfabric.entities.WorkflowTemplate(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity,UserCreatedMixin- ENDPOINT = 'workflowtemplate'#
- workflow_template_steps: HasMany[WorkflowTemplateStep]#
- class bfabric.entities.WorkflowTemplateStep(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity,UserCreatedMixin- ENDPOINT = 'workflowtemplatestep'#
- workflow_template: HasOne[WorkflowTemplate]#
- class bfabric.entities.Workunit(data_dict: ApiResponseObjectType, client: Bfabric | None = None, bfabric_instance: str | None = None)#
Bases:
Entity,UserCreatedMixinImmutable representation of a single workunit in B-Fabric.
- ENDPOINT = 'workunit'#
- application: HasOne[Application]#
- property application_parameters: dict[str, str]#
Dictionary of application context parameters.
- external_jobs: HasMany[ExternalJob]#
- property parameter_values: dict[str, str]#
- property store_output_folder: Path#
Relative path in the storage for the workunit output.
- property submitter_parameters: dict[str, str]#
Dictionary of submitter context parameters.
- property workunit_parameters: dict[str, str]#
Dictionary of workunit context parameters.
Quick Links#
Entity |
Description |
Special Features |
|---|---|---|
Project |
Top-level project entity |
Container for samples and workunits |
Sample |
Sample within a project |
Has container relationship (Project/Order) |
Workunit |
Workunit/job entity |
Rich parameter access, output folder calculation |
Dataset |
Dataset entity |
DataFrame conversion, export methods, column access |
Application |
Application definition |
Technology folder name, storage/executable relationships |
Executable |
Executable binary/script |
Base64 decoding, parameter definitions |
ExternalJob |
External job reference |
Client entity resolution, workunit association |
Resource |
File resource |
Path methods, storage/sample/workunit relationships |
Storage |
Storage location |
Base path, SCP prefix |
Parameter |
Workunit parameter |
Key-value access with special handling |
User |
User entity |
Login-based lookup |
Order |
Order entity |
Optional project relationship |
Workflow |
Workflow definition |
Workflow steps, template association |
WorkflowStep |
Individual workflow step |
Container relationship |
WorkflowTemplate |
Workflow template |
Template steps definition |
WorkflowTemplateStep |
Template step |
Template association |
Plate |
Plate entity |
Basic entity |
Run |
Run entity |
Basic entity |
Instrument |
Instrument entity |
Basic entity |
MultiplexKit |
Multiplex kit |
Filtered multiplex IDs |
MultiplexId |
Multiplex ID |
Basic entity |
See Also#
Working with Entities - Guide to using entities
EntityReader - EntityReader API reference
Relationships - Using entity relationships