Bases: astropy.vo.client.vos_catalog.VOSBase
A class to represent a collection of VOSCatalog.
Parameters: | tree : JSON tree |
---|---|
Raises: | VOSError
|
Attributes Summary
version | Database version number. |
Methods Summary
add_catalog(name, cat[, allow_duplicate_url]) | Add a catalog to database. |
add_catalog_by_url(name, url, **kwargs) | Like add_catalog() but the catalog is created with only the given name and access URL. |
create_empty() | Create an empty database of VO services. |
delete_catalog(name) | Delete a catalog from database with given name. |
delete_catalog_by_url(url) | Like delete_catalog() but using access URL. |
from_json(filename, **kwargs) | Create a database of VO services from a JSON file. |
from_registry(registry_url[, timeout]) | Create a database of VO services from VO registry URL. |
get_catalog(name) | Get one catalog of given name. |
get_catalog_by_url(url) | Like get_catalog() but using access URL look-up. |
get_catalogs() | Iterator to get all catalogs. |
get_catalogs_by_url(url) | Like get_catalogs() but using access URL look-up. |
list_catalogs([pattern, sort]) | List catalog names. |
list_catalogs_by_url([pattern, sort]) | Like list_catalogs() but using access URL. |
merge(other, **kwargs) | Merge two database together. |
to_json(filename[, clobber]) | Write database content to a JSON file. |
Attributes Documentation
Database version number.
Methods Documentation
Add a catalog to database.
Parameters: | name : str
cat : VOSCatalog
allow_duplicate_url : bool
|
---|---|
Raises: | VOSError
DuplicateCatalogName
DuplicateCatalogURL
|
Like add_catalog() but the catalog is created with only the given name and access URL.
Parameters: | name : str
url : str
kwargs : dict
|
---|
Create an empty database of VO services.
Empty database format:
{
"__version__": 1,
"catalogs" : {
}
}
Returns: | db : VOSDatabase
|
---|
Delete a catalog from database with given name.
Parameters: | name : str
|
---|---|
Raises: | MissingCatalog
|
Like delete_catalog() but using access URL. On multiple matches, all matches are deleted.
Create a database of VO services from a JSON file.
Example JSON format for Cone Search:
{
"__version__": 1,
"catalogs" : {
"My Cone Search": {
"capabilityClass": "ConeSearch",
"title": "My Cone Search",
"url": "http://foo/cgi-bin/search?CAT=bar&",
...
},
"Another Cone Search": {
...
}
}
}
Parameters: | filename : str
kwargs : dict
|
---|---|
Returns: | db : VOSDatabase
|
Create a database of VO services from VO registry URL.
This is described in detail in Building the Database from Registry, except for the validate_xxx keys that are added by the validator itself.
Parameters: | registry_url : str
timeout : number
kwargs : dict
|
---|---|
Returns: | db : VOSDatabase
|
Raises: | VOSError
|
Get one catalog of given name.
Parameters: | name : str
|
---|---|
Returns: | obj : VOSCatalog |
Raises: | MissingCatalog
|
Like get_catalog() but using access URL look-up. On multiple matches, only first match is returned.
Iterator to get all catalogs.
Like get_catalogs() but using access URL look-up.
List catalog names.
Parameters: | pattern : str or None
sort : bool
|
---|---|
Returns: | out_arr : list of str
|
Like list_catalogs() but using access URL.
Merge two database together.
Parameters: | other : VOSDatabase
kwargs : dict
|
---|---|
Returns: | db : VOSDatabase
|
Raises: | VOSError
|
Write database content to a JSON file.
Parameters: | filename : str
clobber : bool
|
---|---|
Raises: | OSError
|