Wrangler

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: object

Wrapper 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 of broker.api.generic_api.GenericApi

  • authenticator (GenericAuthenticator) – Subclass of broker.authenticator.generic_authenticator.GenericAuthenticator

  • input_processor (GenericInputProcessor) – Subclass of broker.input_processor.generic_input_processor.GenericInputProcessor

  • entity (Type[GenericEntity]) – Subclass of broker.metadata_entity.generic_entity.GenericEntity (Please notice, you need to pass a class to this parameter)

  • output_processor (GenericOutputProcessor) – subclass of broker.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