arxiv.canonical.record.core module

Base classes and core concepts for arxiv.canonical.record.

class arxiv.canonical.record.core.RecordBase(name, members, domain)[source]

Bases: typing.Generic

Generic base class for record collections in this module.

This produces a uniform protocol for record collections, while allowing name, member, and member name types to vary across collection subclasses.

classmethod make_manifest_key(name)[source]

Generate a full key that can be used to store a manifest.

Return type

Key

class arxiv.canonical.record.core.RecordEntry(key, stream, domain)[source]

Bases: typing.Generic

An entry in the canonical record.

Comprised of a RecordStream and a domain representation of the entry (i.e. the application-level interpretation of the stream).

classmethod from_domain(d)[source]
Return type

~_Self

key = None

Full key (path) at which the entry is stored.

property name

str

Type

rtype

classmethod to_domain(stream)[source]
Return type

~_EDomain

class arxiv.canonical.record.core.RecordEntryMembers[source]

Bases: arxiv.canonical.util.GenericMonoDict

A dict that returns only :class: .RecordEntry instances.

Consistent with Mapping[str, RecordEntry].

class arxiv.canonical.record.core.RecordStream[source]

Bases: tuple

A single bitstream in the record.

property content

Raw content of the entry.

property content_type

MIME-type of the content.

property domain

Alias for field number 0

property size_bytes

Size of content in bytes.