arxiv.canonical.integrity.core module

Base classes and concepts for the integrity system.

class arxiv.canonical.integrity.core.IntegrityBase(name, record=None, members=None, manifest=None, checksum=None)[source]

Bases: typing.Generic

Generic base class for all integrity collections.

Provides a uniform protocol for integrity collections, while allowing the name, record, member name, and member types to vary from subclass to subclass.

calculate_checksum()[source]
Return type

str

property checksum

The checksum of this integrity collection.

Return type

str

extend_manifest(member)[source]
Return type

None

classmethod from_record(record, checksum=None, calculate_new_checksum=True)[source]
Return type

~_Self

property is_valid

Indicates whether or not this collection has a valid checksum.

Return type

bool

iter_members()[source]
Return type

Iterable[~_Member]

classmethod make_manifest(members)[source]

Make a Manifest for this integrity collection.

Return type

Manifest

classmethod make_manifest_entry(member)[source]
Return type

ManifestEntry

property manifest

The Manifest of this integrity collection.

Return type

Manifest

property manifest_name

Get the name of this object for a parent manifest.

Return type

str

member_type = None

The type of members contained by an instance of a register class.

property members

The members of this collection.

Return type

Mapping[~_MemberName, ~_Member]

property number_of_events

int

Type

rtype

property number_of_versions

int

Type

rtype

property record

The record associated with this collection.

Return type

~_Record

set_record(record)[source]
Return type

None

update_checksum()[source]

Set the checksum for this record.

Return type

None

update_or_extend_manifest(member, checksum)[source]

Update the checksum on a manifest entry, or add a new entry.

Return type

None

class arxiv.canonical.integrity.core.IntegrityEntry(name, record=None, members=None, manifest=None, checksum=None)[source]

Bases: arxiv.canonical.integrity.core.IntegrityEntryBase

Integrity concept for a single entry in the record.

calculate_checksum()[source]
Return type

str

classmethod from_record(record, checksum=None, calculate_new_checksum=True)[source]

Generate an IntegrityEntry from a :class:`.RecordEntry.

Return type

~_Self

record_type

alias of arxiv.canonical.record.core.RecordEntry

class arxiv.canonical.integrity.core.IntegrityEntryBase(name, record=None, members=None, manifest=None, checksum=None)[source]

Bases: arxiv.canonical.integrity.core.IntegrityBase

class arxiv.canonical.integrity.core.IntegrityEntryMembers[source]

Bases: arxiv.canonical.util.GenericMonoDict

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

Consistent with Mapping[str, IntegrityEntry].