Skip to content

API reference

Generated from the source with mkdocstrings.

Client

archeion.ArcheionClient

Bases: BaseApiClient

Client for the arXiv API (https://export.arxiv.org/api).

The API needs no credentials and answers Atom XML, which the client parses into :class:archeion.ArxivEntry models. Requests are paced at one every three seconds over one connection, as the arXiv terms of use ask.

query cached property

The /query route: search, lookup by id, and paging.

default_headers property

Headers sent with every request: the Atom representation.

The sync client ArcheionSyncClient and its QuerySyncClient mirror the async classes method for method.

Query client

archeion.QueryClient

Search and look up papers through /api/query.

query is the arXiv search syntax (ti:transformer AND cat:cs.CL, au:bengio, all:electron); ids restricts the results to arXiv ids. Both may be combined, as the API allows. Every result is one paper version as an :class:ArxivEntry.

batch_get(ids) async

Return the papers for many ids, keyed by the normalized input id.

Sends id_list requests of up to 100 ids. An id without a version maps to the newest version; an id with one maps to that version. Unknown ids are absent from the result.

count(query=None, *, ids=None) async

Return opensearch:totalResults for a query (one 1-result request).

get(id) async

Return one paper by arXiv id, with or without a version.

Accepts 1706.03762, 1706.03762v1, hep-th/9711200, and arXiv: or https://arxiv.org/abs/ forms. Without a version the API answers the newest version. An unknown id raises :class:NotFoundError.

iterate(query=None, *, ids=None, sort_by=None, sort_order=None, page_size=100, limit=None, on_error='raise', failures=None) async

Yield every result, page by page, up to limit or 30,000.

Each page is one request, paced by the client settings (one request every three seconds by default).

search(query=None, *, ids=None, sort_by=None, sort_order=None, start=0, page_size=DEFAULT_PAGE_SIZE, on_error='raise', failures=None) async

Return one page of results.

start is the 0-based offset and page_size the max_results value (at most 2000). start + page_size may not pass 30,000, the documented reach of one query. page.total is opensearch:totalResults; page.meta holds the feed id, updated, start, and per_page.

Settings

archeion.ArcheionSettings

Bases: BaseApiSettings

arXiv-specific client settings.

Inherits timeout, max_retries, max_retry_wait, max_requests_per_second, max_concurrency, user_agent and mailto from :class:bibliofabric.config.BaseApiSettings and sets the arXiv terms of use as defaults: one request every three seconds over one connection. The API needs no credentials.

Models

archeion.ArxivEntry

Bases: BaseModel

One paper version from the arXiv query API.

id is the abstract URL of the version the feed returned (http://arxiv.org/abs/1706.03762v7); :attr:arxiv_id and :attr:version split it. published is the date of version 1 and updated the date of this version.

arxiv_id property

The id without its version, such as 1706.03762.

author_names property

The author names in feed order.

pdf_url property

The URL of the PDF of this version.

version property

The version number, such as 7.

versioned_id property

The id with its version, such as 1706.03762v7.

archeion.ArxivAuthor

Bases: BaseModel

One author of an entry with the affiliations arXiv knows.

Bases: BaseModel

One link element: the abstract page, the PDF, or the DOI.

Atom parser

archeion.parse_feed(text)

Return the feed as {"id", "updated", "total", "start", "per_page", "entries"}.

Raises :class:ConfigurationError when the feed is an error feed (an entry whose id points at https://arxiv.org/api/errors), because the API answers that for malformed ids and queries.