Wrangler
Wrapper submodule! Provides with the very basic functionality expected for all subclasses of all the generic submodules defined in the library. |
Wrapper submodule. Not a lot to say here - This is just a wrapper to make it easier for users to use basic library functionality:
broker.wrangler.Wrangler.submit()Retrieve:
broker.wrangler.Wrangler.retrieve_entities()Save:
broker.wrangler.Wrangler.save_results()
- class Wrangler(api, authenticator, input_processor, entity, output_processor)
Bases:
objectWrapper submodule! Provides with the very basic functionality expected for all subclasses of all the generic submodules defined in the library. Currently allows:
Submitting a set of entities to an archive
Retrieving a set of entities from an archive
Saving a set of entities to a file
And the functionality depends on what submodule you create it with!
- Parameters:
api (
GenericApi) – Subclass ofbroker.api.generic_api.GenericApiauthenticator (
GenericAuthenticator) – Subclass ofbroker.authenticator.generic_authenticator.GenericAuthenticatorinput_processor (
GenericInputProcessor) – Subclass ofbroker.input_processor.generic_input_processor.GenericInputProcessorentity (
Type[GenericEntity]) – Subclass ofbroker.metadata_entity.generic_entity.GenericEntity(Please notice, you need to pass a class to this parameter)output_processor (
GenericOutputProcessor) – subclass ofbroker.output_processor.generic_output_processor.GenericOutputProcessor
- submit(entities)
Submit the entities to the archive.
- Parameters:
entities (
list[GenericEntity]) – List of genericEntity’s.- Return type:
list[GenericEntity]- Returns:
List of entities submitted
- save_results(entities)
Save the entities to a file.
- Parameters:
entities – Entities to be saved to a file
- retrieve_entities(accession_list)
Retrieve entities by using an accession
- Parameters:
accession_list (
list[str]) – list of strings containing the accessions.- Return type:
list[GenericEntity]- Returns:
Exceptions
- exception NoResults
Bases:
Exception