Entity

class elg.entity.Entity(id: int, resource_name: str, resource_short_name: List[str], resource_type: str, entity_type: str, description: str, keywords: List[str], detail: str, licences: List[str], languages: List[str], country_of_registration: List[str], creation_date: str, last_date_updated: str, functional_service: bool, functions: List[str], intended_applications: List[str], views: int, downloads: int, size: int, service_execution_count: int, status: str, under_construction: bool, domain: str, record: Optional[dict] = None, **kwargs)

Class to represent every ELG entity

classmethod from_id(id: int, domain: str = 'live', use_cache: bool = True, cache_dir: str = '~/.cache/elg')

Class method to init an Entity object from its id.

Parameters
  • id (int) – id of the entity.

  • domain (str, optional) – ELG domain you want to use. “live” to use the public ELG, “dev” to use the development ELG and another value to use a local ELG. Defaults to “live”.

  • use_cache (bool, optional) – True if you want to use cached files. Defaults to True.

  • cache_dir (str, optional) – path to the cache_dir. Set it to None to not store any cached files. Defaults to “~/.cache/elg”.

Returns

Entity object.

Return type

elg.Entity

classmethod from_search_result(result: dict, domain: str = 'live')

Class method to init an Entity object from a search result.

Parameters
  • result (dict) – result of the search API.

  • domain (str, optional) – ELG domain you want to use. “live” to use the public ELG, “dev” to use the development ELG and another value to use a local ELG. Defaults to “live”.

Returns

Entity object.

Return type

elg.Entity