rotifer.db.delegator.SequentialDelegatorCursor#
- class rotifer.db.delegator.SequentialDelegatorCursor(readers=[], writers=[], progress=True, tries=None, batch_size=None, threads=None, *args, **kwargs)[source]#
Bases:
DelegatorCursorDelegator that queries its backends one after the other.
Backends listed in
readersare tried in order and each one only receives the identifiers that previous backends could not resolve. Results retrieved by a reader are handed to every backend listed inwritersfor storage.- Parameters:
- readerslist of str, default []
Names of the backend modules used to retrieve data, in order of preference.
- writerslist of str, default []
Names of the backend modules used to store retrieved data.
- progressbool, default True
Whether to print a progress bar.
- triesint, optional
Number of attempts to download each batch.
- batch_sizeint, optional
Number of accessions per batch.
- threadsint, optional
Number of simultaneous threads.
See also
rotifer.db.ncbi.SequenceCursora concrete sequential delegator
- __getitem__(accessions, *args, **kwargs)[source]#
Fetch data for one or more entries, dictionary style.
- Parameters:
- accessionsstr or list of str
Database identifiers.
- Returns:
- object
The value returned by the delegated cursors: a single result object when a single accession yields a single result, otherwise a list of result objects.
Examples
>>> import rotifer.db.ncbi as ncbi >>> tc = ncbi.TaxonomyCursor(progress=False) >>> t = tc[2599]