goat.authorities package¶
Submodules¶
goat.authorities.util module¶
Helper functions for parsing authority descriptions.
Bases:
listAdds
getsupport to a list.Return the value of
keyin the first object in list.
Return the value of
keyin each object in list.
Bases:
dict
Generates a function that retrives the CDATA content or attribute value of an element.
env : dict
function
Split a path string into its constituent parts.
path_string : str
path : list attribute : str or None
Generate a function that performs an HTTP request based on the configuration in
config.config : dict glob : dict
- function
- Expects keyword arguments defined in the configuration. If provided,
headerswill be pulled out and passed as headers in the request.
Generate a recursive function that follows the path in
tags, starting atelem.
Detect the multi-value flag (
*) in a path part (tag).tag : str
- tuple
- tag name (str), multiple (bool)
Generate a function that will retrieve data of interest from a
JSONDataobject.- path_string : str
- See docs for how this should be written. TODO: write the docs.
- nsmap: dict
- Not used.
picker_factory : function
function
Parse raw JSON response content.
raw : unicode
lxml.etree.Element
Parse raw XML response content.
raw : unicode
lxml.etree.Element
Extract data from an
lxml.etree.Elementusing a configuration schema.config : dict data :
lxml.etree.Elementpath_parser : function glob : dict nsmap : dictlist
Generate a function that will retrieve data of interest from an
lxml.etree.Element.- path_string : str
- See docs for how this should be written. TODO: write the docs.
- nsmap: dict
- See the
lxml.etreedocs.
picker_factory : function
function
Generates a function that simply returns a passed
lxml.etree.Element.env : dict
function
Module contents¶
Bases:
objectConfiguration-driven manager for authority services.
- config : str
- Name of an authority configuration in
authorities. Will look for{path}/{config}.json. - path : str
- Location of configurations.
Get a concept record from the configured authority.
Although both
identifierandlocal_identifierare declared as optional, it is a good idea to pass them both and let the configuration sort things out.- identifier : str
- Used to populate the
idparameter in the request. - local_identifier : str
- Used to populate the
local_idparameter in the request.
dict
Search for concept records in the configured authority.
- params : kwargs
- Query parameters used to populate the search request.
list
Bases:
object