arxiv.canonical.domain.version module

Provides the core domain concept and logic for individual versions.

class arxiv.canonical.domain.version.Event(identifier, event_date, event_type, version, categories=None, description='', is_legacy=False, event_agent=None)[source]

Bases: arxiv.canonical.domain.version._EventBase

An announcement-related event.

property event_id

The unique identifier for this event.

Return type

EventIdentifier

classmethod from_dict(data)[source]

Reconstitute from a native dict.

Return type

Event

classmethod get_default_shard()[source]

Get the default listing shard for this event.

Return type

str

property shard

The shard name for this event.

Return type

str

property summary

A summary of this event.

Return type

EventSummary

to_dict()[source]

Generate a native dict representation.

Return type

Dict[str, Any]

version = None

The current state of the version (i.e. after the event).

class arxiv.canonical.domain.version.EventIdentifier(value)[source]

Bases: str

Unique identifier for an Event.

event_date = None

Timestamp of the event.

classmethod from_parts(identifier, event_date, shard)[source]

Generate a event identifier from its parts.

Return type

EventIdentifier

shard = None

Shard ID for the event.

version_id = None

Identifier of the Version to which the event pertains.

class arxiv.canonical.domain.version.EventSummary(identifier, event_date, event_type, event_id, categories=None, description='', is_legacy=False, event_agent=None)[source]

Bases: arxiv.canonical.domain.version._EventBase

A lightweight description of an event.

This has all of the data of the original Event except for the state of the e-print version.

event_id = None

Unique identifier for the event.

classmethod from_dict(data)[source]

Reconstitute from a native dict.

Return type

EventSummary

to_dict()[source]

Generate a native dict representation.

Return type

Dict[str, Any]

class arxiv.canonical.domain.version.EventType[source]

Bases: enum.Enum

Supported event types.

CROSSLIST = 'cross'
JREF = 'jref'
MIGRATE = 'migrate'
MIGRATE_METADATA = 'migrate_metadata'
NEW = 'new'
REPLACED = 'replace'
UPDATED = 'update'
UPDATED_METADATA = 'update_metadata'
WITHDRAWN = 'withdraw'
property is_new_version

Indicate whether or not this event type results in a new version.

Return type

bool

class arxiv.canonical.domain.version.Metadata(primary_classification, secondary_classification, title, abstract, authors, license, comments=None, journal_ref=None, report_num=None, doi=None, msc_class=None, acm_class=None)[source]

Bases: arxiv.canonical.domain.base.CanonicalBase

Submitter-provided descriptive metadata for a version.

add_secondaries(*new_secondaries)[source]

Add cross-list categories for this version.

Return type

None

property all_categories

All classification categories for this version.

Return type

List[str]

classmethod from_dict(data)[source]

Reconstitute from a native dict.

Return type

Metadata

to_dict()[source]

Generate a native dict representation.

Return type

Dict[str, Any]

class arxiv.canonical.domain.version.Version(identifier, announced_date, announced_date_first, submitted_date, updated_date, metadata, source, events=None, previous_versions=None, submitter=None, proxy=None, is_announced=False, is_withdrawn=False, is_legacy=False, reason_for_withdrawal=None, source_type=None, render=None, formats={})[source]

Bases: arxiv.canonical.domain.base.CanonicalBase

Represents a single version of an arXiv e-print in the record.

announced_date = None

Day on which this version was announced.

announced_date_first = None

Day on which the first version of the e-print was announced.

events = None

Events that are specific to this version of the e-print.

formats = None

Dissemination formats for this version.

classmethod from_dict(data)[source]

Reconstitute from a native dict.

Return type

Version

get_format(desired_format)[source]

Get a particular dissemination format for this version.

Return type

CanonicalFile

identifier = None

Unique arXiv identifier for the version.

is_announced = None

Indicate whether or not the version is announced.

is_legacy = None

Indicate whether this record was populated from the legacy system.

is_withdrawn = None

Indicate whether or not the version is withdrawn.

metadata = None

Submitter-provided descriptive metadata for the version.

property number_of_events

Numer of events described by this object (0).

Return type

Literal[0]

property number_of_versions

Number of versions described by this object (1).

Return type

Literal[1]

previous_versions = None

References to previous versions of the e-print.

proxy = None

The proxy that deposited the version on behalf of the submitter.

reason_for_withdrawal = None

The reason for the withdrawal of the e-print.

render = None

Human-readable representation of the e-print.

Usually a PDF generated from the source, but may also be a user-provided PDF.

property size_kilobytes

Size of the source package in kb.

Return type

int

source = None

The original user-submitted source package.

source_type = None

Internal code for the source type.

submitted_date = None

Timestamp when this version was submitted to arXiv.

submitter = None

Person responsible for submitting this version.

to_dict()[source]

Generate a native dict representation.

Return type

Dict[str, Any]

updated_date = None

The last time the record for this version was changed.

class arxiv.canonical.domain.version.VersionReference(identifier, announced_date, submitted_date)[source]

Bases: arxiv.canonical.domain.base.CanonicalBase

An abridged reference to a particular Version.

announced_date = None

Date on which the version was announced.

classmethod from_dict(data)[source]

Reconstitute from a native dict.

Return type

VersionReference

identifier = None

Identifier of the version.

submitted_date = None

Date on which the version was submitted.

to_dict()[source]

Generate a native dict representation.

Return type

Dict[str, Any]