Publication Reference Processing Modules¶
hedwig.publication.ads¶
- hedwig.publication.ads.get_pub_info_ads(bibcodes)¶
Get information on a list of bibcodes.
- Returns:
a dictionary by bibcode
- hedwig.publication.ads.get_pub_info_doi(dois)¶
Get information on a list of DOIs.
- Returns:
a dictionary by DOI.
- hedwig.publication.ads._get_pub_info_ads_generic(type_, codes)¶
Get information via ADS for a given type of code.
- Parameters:
type_ – can be “bibcode” or “doi”
codes – list of codes to query
- hedwig.publication.ads._escape_term(string)¶
hedwig.publication.arxiv¶
- hedwig.publication.arxiv.element_text(element)¶
- hedwig.publication.arxiv.get_pub_info_arxiv(article_ids)¶
Get information on a list of article IDs.
- Returns:
a dictionary by article ID
hedwig.publication.poll¶
- class hedwig.publication.poll.PubTypeInfo(set, query_function)¶
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('set', 'query_function')¶
- classmethod _make(iterable)¶
Make a new PubTypeInfo object from a sequence or iterable
- _replace(**kwds)¶
Return a new PubTypeInfo object replacing specified fields with new values
- query_function¶
Alias for field number 1
- set¶
Alias for field number 0
- hedwig.publication.poll.process_publication_references(db, dry_run=False)¶
Function to process newly added publication references.
Searches for publication references in the NEW state and organizes them by type. Then the collection of references of each type is passed to the
_process_ref_type()function.- Returns:
the total number of references processed
- hedwig.publication.poll._process_ref_type(db, type_, query_function, references, dry_run=False)¶
Look up references of a given type using the specified query function and update their entries in the database.
The state of the publication reference is set to READY if it is processed successfully or ERROR otherwise.
Note that references should be given as a set (of unique values) and database updates are performed by matching by type_ and reference description (rather than by prev_proposal_pub ID) to allow multiple copies of the same reference to be resolved together.
- Parameters:
db – database control object
type_ – type of reference being updated
query_function – function to look up lists of references
references – set of references to update
dry_run – enable dry run mode if true
- Returns:
the number of references successfully processed
hedwig.publication.url¶
- hedwig.publication.url.make_publication_url(type_, reference)¶
Make an URL for the given reference, if possible, or return None otherwise.