gavo.protocols.vocabularies module¶
A shallow interface to IVOA vocabularies.
- class gavo.protocols.vocabularies.SubjectMeta(content='', format='plain')[source]¶
Bases:
MetaValue
A MetaValue translating UAT terms to their labels in HTML.
This follows the assumption that HTML is what humans look at, anything else is either computers or nerds.
- gavo.protocols.vocabularies.download_file(url: str, cache: str, show_progress: bool, http_headers: Dict[str, str]) str [source]¶
a partial implementation of astropy.utils.data.download_file to be used until we can rely on astropy 4.
We actually ignore cache and show_progress…
- gavo.protocols.vocabularies.get_label(voc: Dict[str, Any], term: str) str [source]¶
returns the label of term if it’s in the desise vocabulary voc, term capitalised otherwise.
- gavo.protocols.vocabularies.get_vocabulary(voc_name: str, force_update: bool = False) Dict[str, Any] [source]¶
returns an IVOA vocabulary in its desise form.
See Vocabularies in the VO 2 to see what is inside of this.
This will use a cache to avoid repeated updates, but it will attempt to re-download if the cached copy is older than 6 months.
Use force_update to expire the cache immediately