gavo.protocols.simbadinterface module

A caching proxy for CDS’ Simbad object resolver.

class gavo.protocols.simbadinterface.ObjectCache[source]

Bases: object

a cache for simbad queries kept in dc.metastore.

This used to be file-based, and used different keys for different purposes. The different keys didn’t seem to be useful, so they’re ignored now.

This only caches positive responses; there’s too much that can go wrong when caching negatives, and the expectation is that negatives are so varying that there’s little to win anyway.

The values passed in are json-encoded (for simbad, these are dictionaries).

addItem(key, value)[source]

adds an item to the cache.

value is json-encoded before writing it.


returns a previously stored object of key.

This raises a KeyError if nothing has been stored before.

class gavo.protocols.simbadinterface.Sesame[source]

Bases: object

is a simple interface to the simbad name resolver.

svc_urls = ['', '']

returns ra and dec from Simbad for identifier.

It raises a KeyError if Simbad doesn’t know identifier.