search.services.metadata module¶
Provides acces to paper metadata from the core arXiv repository.
The primary entrypoint to this module is retrieve()
, which retrieves
DocMeta
for a published arXiv paper.
DocMetaSession
encapsulates configuration parameters and a connection
to the docmeta endpoint(s) for thread-safety and efficiency. The functions
mentioned above load the appropriate instance of DocMetaSession
depending on the context of the request.
-
exception
search.services.metadata.
BadResponse
[source]¶ Bases:
OSError
The response from the metadata service was malformed.
-
exception
search.services.metadata.
ConnectionFailed
[source]¶ Bases:
OSError
Could not connect to the metadata service.
-
class
search.services.metadata.
DocMetaSession
(*endpoints, verify_cert=True)[source]¶ Bases:
object
An HTTP session with the docmeta endpoint.
-
exception
search.services.metadata.
RequestFailed
[source]¶ Bases:
OSError
The metadata endpoint returned an unexpected status code.
-
exception
search.services.metadata.
SecurityException
[source]¶ Bases:
search.services.metadata.ConnectionFailed
Raised when SSL connection fails.
-
search.services.metadata.
bulk_retrieve
(self, document_ids)[source]¶ Retrieve metadata for an arXiv paper.
Parameters: document_ids (List[str]) –
Returns: Return type: Raises: Return type:
-
search.services.metadata.
current_session
()[source]¶ Get/create
DocMetaSession
for this context.Return type: DocMetaSession
-
search.services.metadata.
get_session
(app=None)[source]¶ Get a new session with the docmeta endpoint.
Return type: DocMetaSession