Skip to content

constants

Constants used within the library.

FRONTMATTER_ID module-attribute

FRONTMATTER_ID = '0'

Paper ID that signals that a paper is frontmatter.

NO_BIBKEY module-attribute

NO_BIBKEY = '__NO_BIBKEY__'

Sentinel value to be set on a newly created paper, before its bibkey is generated.

NO_PERSON_ID module-attribute

NO_PERSON_ID = '__NO_PERSON_ID__'

Sentinel value to be set on a NameSpecification to temporarily unlink it from a Person.

RE_BIBKEY module-attribute

RE_BIBKEY = compile(f'^([a-z][a-z0-9-]+)|({NO_BIBKEY})$')

A regular expression matching a valid bibkey (following our conventions).

RE_COLLECTION_ID module-attribute

RE_COLLECTION_ID = compile(
    "([0-9]{4}\\.[a-z0-9]+)|([A-Z][0-9]{2})"
)

A regular expression matching any valid collection ID.

RE_EVENT_ID module-attribute

RE_EVENT_ID = compile('^[a-z0-9]+-[0-9]{4}$')

A regular expression matching a valid event ID.

RE_ISO_DATE module-attribute

RE_ISO_DATE = compile('^[0-9]{4}-[0-9]{2}-[0-9]{2}$')

A regular expression matching a date in ISO format.

RE_ITEM_ID module-attribute

RE_ITEM_ID = compile('[a-z0-9]+')

A regular expression matching any valid volume or paper ID.

RE_ORCID module-attribute

RE_ORCID = compile(
    "[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]"
)

A regular expression matching any string that looks like an ORCID.

RE_VENUE_ID module-attribute

RE_VENUE_ID = compile('^[a-z][a-z0-9]+$')

A regular expression matching a valid venue ID.

RE_VERIFIED_PERSON_ID module-attribute

RE_VERIFIED_PERSON_ID = compile(
    f"([a-z][\-a-z0-9]+)|({NO_PERSON_ID})"
)

A regular expression matching any valid verified person ID.

UNKNOWN_INGEST_DATE module-attribute

UNKNOWN_INGEST_DATE = date(1900, 1, 1)

Default ingestion date.