arxiv.canonical.register.api module¶
Provides the main public API for the canonical register.
See RegisterAPI
.
-
class
arxiv.canonical.register.api.
Register
(name, domain, record, integrity, members=None)[source]¶ Bases:
arxiv.canonical.register.core.Base
-
domain_type
¶ alias of
arxiv.canonical.domain.Canon
-
integrity_type
¶ alias of
arxiv.canonical.integrity.Integrity
-
member_type
= typing.Union[arxiv.canonical.register.listing.RegisterListings, arxiv.canonical.register.eprint.RegisterEPrints]¶
-
record_type
¶ alias of
arxiv.canonical.record.Record
-
-
class
arxiv.canonical.register.api.
RegisterAPI
(storage, sources, name='all')[source]¶ Bases:
arxiv.canonical.core.IRegisterAPI
The main public API for the register.
-
load_events
(selector)[source]¶ Load all :class:`.Event`s for a day, month, or year.
Returns an
Event
generator that loads event data lazily from the underlying storage, so that in general we are loading only the data that we are actually consuming. Events are generated in order.But be warned! Evaluating the entire generator all at once (e.g. by coercing it to a
list
) may load a considerable amount of data into memory (and use a lot of i/o), especially if events for an entire year are loaded.- Parameters
selector (int, tuple, or
datetime.date
) – Indicates the year (int), month (Tuple[int, int]), or day for which events should be loaded.- Returns
generator – Yields
Event
instances in chronological order.int – An estimate of the number of events that will be generated. Note that the actual number may change (especially for large selections) because the record may be updated while the generator is being consumed.
- Return type
-