arxiv.canonical.domain.identifier module

Provides the concept of an arXiv identifier.

class arxiv.canonical.domain.identifier.Identifier(value)[source]

Bases: str

An arXiv e-print identifier.

Supports both old-style (archive.category/YYMMNNN) and new-style (YYMM.NNNNN) identifiers.

property category_part

For old-style identifiers, conveys the primary category.

Return type

str

classmethod from_parts(year, month, inc)[source]

Generate a new-style identifier from its parts.

Return type

Identifier

property incremental_part

The part of the identifier that is incremental.

Return type

int

property month

Month in which the first version of the e-print was announced.

Return type

int

property numeric_part

The entire numeric component of the identifier.

For new-style identifiers, this is the entire identifier.

Return type

str

property year

Year in which the first version of the e-print was announced.

Return type

int

property yymm

Numeric part conveying the original announcement year and month.

Return type

str

exception arxiv.canonical.domain.identifier.InvalidIdentifier[source]

Bases: ValueError

A value was encountered that is not a valid arXiv identifier.

class arxiv.canonical.domain.identifier.VersionedIdentifier(value)[source]

Bases: str

An arXiv identifier for a specific Version.

This is an Identifier with a version (v{N}) affix.

property category_part

For old-style identifiers, conveys the primary category.

Return type

str

classmethod from_parts(arxiv_id, version)[source]

Generate a new-style versioned identifier from its parts.

Return type

VersionedIdentifier

property incremental_part

The part of the identifier that is incremental.

Return type

int

property is_old_style

Indicate whether this is an old-style identifier.

Return type

int

property month

Month in which the first version of the e-print was announced.

Return type

int

property numeric_part

The entire numeric component of the identifier.

For new-style identifiers, this is the entire identifier.

Return type

str

property year

Year in which the first version of the e-print was announced.

Return type

int

property yymm

Numeric part conveying the original announcement year and month.

Return type

str