Package Pyblio :: Package External :: Module CrossRef :: Class DOIQuery
[hide private]
[frames] | no frames]

Class DOIQuery

source code

object --+
         |
        DOIQuery

Query DOI numbers.

Convenience module that properly groups queries to CrossRef in order to increase throughput.
>>> cnx = DOIQuery(db, user=..., pwd=...)
>>> for info in to_resolve:
...     cnx.journalSearch(...).addCallback(got_results)
>>> cnx.finished()

The 'db' parameter is a database from which the queries and results will be composed. It must conform to the org.pybliographer/crossref/0.1 schema.

The actual queries take place when enough searches have been requested, or when the .finished() method is called.

For each query, a list of possible DOIs is returned. It can possibly be empty if the citation could not be resolved.

In case of a failure in the query protocol itself, the registered errback handlers are called for each query.

Instance Methods [hide private]
 
__init__(self, db, user, pwd)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_make_batch(self) source code
 
_send(self) source code
 
_batch_done(self) source code
 
_prepare(self, q) source code
 
finished(self) source code
 
search(self, record) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  BATCH = 30
  baseURL = 'http://doi.crossref.org/servlet/query'
  log = logging.getLogger('pyblio.external.crossref')
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, db, user, pwd)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)