harvester.endpoint package
Submodules
harvester.endpoint.oads module
- class harvester.endpoint.oads.IndexFileParser(use_oads_ext: bool)[source]
Bases:
object
- apply_assets(record: Dict[str, str], item: Item)[source]
Create and add STAC Assets from the provided information
- apply_eo_extension(record: Dict[str, str], item: Item)[source]
Apply properties from the EO extension spec
- apply_oads_extension(record: Dict[str, str], item: Item)[source]
Apply properties from the non-standard OADS extension spec
- apply_properties(record: Dict[str, str], item: Item)[source]
Apply any optional properties currently in the core spec
- apply_sar_extension(record: Dict[str, str], item: Item)[source]
Apply properties from the SAR extension spec
- apply_sat_extension(record: Dict[str, str], item: Item)[source]
Apply properties from the SAT extension spec
- apply_version_extension(record: Dict[str, str], item: Item)[source]
Apply properties from the Version extension spec
- apply_view_extension(record: Dict[str, str], item: Item)[source]
Apply properties from the View extension spec
- class harvester.endpoint.oads.OADSEndpoint(url: str, use_oads_ext: bool = False)[source]
Bases:
Endpoint
- harvest() Iterator[dict] [source]
Harvests an OADS system. First performs a “Scan” operation to get the list of index files which are subsequently retrieved and parsed.
- harvest_index_file(index_file_name: str) Iterator[dict] [source]
Harvests a single index file and yields the contents as STAC Items
- type = 'OADS'
- harvester.endpoint.oads.create_oads_endpoint(resource_config: ResourceConfig) Endpoint [source]
harvester.endpoint.opensearch module
- class harvester.endpoint.opensearch.AtomFormat[source]
Bases:
OpenSearchFormat
- mimetype: str = 'application/atom+xml'
- class harvester.endpoint.opensearch.GeoJSONFormat(property_mapping: Dict[str, str])[source]
Bases:
OpenSearchFormat
- mimetype: str = 'application/json'
- parse(response: Response) SearchPage [source]
Parser of different opensearch formats
- Parameters:
response (requests.Response) – response fetched from server
- Returns:
a single search page
- Return type:
- class harvester.endpoint.opensearch.OpenSearchEndpoint(url: str, format_config: OpenSearchFormat, query: OpenSearchQuery)[source]
Bases:
Endpoint
- NS = {'': 'http://www.w3.org/2005/Atom', 'cql': 'http://a9.com/-/opensearch/extensions/cql/1.0/', 'dc': 'http://purl.org/dc/elements/1.1/', 'eo': 'http://a9.com/-/opensearch/extensions/eo/1.0/', 'geo': 'http://a9.com/-/opensearch/extensions/geo/1.0/', 'georss': 'http://www.georss.org/georss/', 'media': 'http://search.yahoo.com/mrss/', 'opensearch': 'http://a9.com/-/spec/opensearch/1.1/', 'owc': 'http://www.opengis.net/owc/1.0/', 'parameters': 'http://a9.com/-/spec/opensearch/extensions/parameters/1.0/', 'time': 'http://a9.com/-/opensearch/extensions/time/1.0/'}
- harvest() Iterator[dict] [source]
Starts the harvesting of the resource, returning an iterator of the harvested items.
- type = 'OpenSearch'
- class harvester.endpoint.opensearch.OpenSearchFormat[source]
Bases:
ABC
- mimetype: str
- abstract parse(response: Response) SearchPage [source]
Parser of different opensearch formats
- Parameters:
response (requests.Response) – response fetched from server
- Returns:
a single search page
- Return type:
- class harvester.endpoint.opensearch.SearchPage(index: int, total: int, records: List[dict] = <factory>)[source]
Bases:
object
- index: int
- records: List[dict]
- total: int
- harvester.endpoint.opensearch.create_atom_format(format_config: FormatConfig) OpenSearchFormat [source]
- harvester.endpoint.opensearch.create_geojson_format(format_config: FormatConfig) OpenSearchFormat [source]
- harvester.endpoint.opensearch.create_opensearch_endpoint(resource_config: ResourceConfig) Endpoint [source]
- harvester.endpoint.opensearch.create_opensearch_format(format_config: FormatConfig) OpenSearchFormat [source]
- harvester.endpoint.opensearch.create_opensearch_query(query_config: QueryConfig) OpenSearchQuery [source]
harvester.endpoint.query module
- class harvester.endpoint.query.Query(time: TimeConfig = TimeConfig(begin='2023-05-10T11:32:48.827412', end='2023-05-10T11:32:48.827420'), bbox: str | None = None, collection: str | None = None)[source]
Bases:
ABC
harvester.endpoint.request module
harvester.endpoint.stacapi module
- class harvester.endpoint.stacapi.STACAPIEndpoint(url: str, query: StacAPIQuery)[source]
Bases:
Endpoint
- harvest() Iterator[dict] [source]
Starts the harvesting of the resource, returning an iterator of the harvested items.
- type = 'STACAPI'
- harvester.endpoint.stacapi.create_stacapi_endpoint(resource_config: ResourceConfig) Endpoint [source]
- harvester.endpoint.stacapi.create_stacapi_query(query_config: QueryConfig) StacAPIQuery [source]
Module contents
- class harvester.endpoint.OADSEndpoint(url: str, use_oads_ext: bool = False)[source]
Bases:
Endpoint
- harvest() Iterator[dict] [source]
Harvests an OADS system. First performs a “Scan” operation to get the list of index files which are subsequently retrieved and parsed.
- harvest_index_file(index_file_name: str) Iterator[dict] [source]
Harvests a single index file and yields the contents as STAC Items
- type = 'OADS'
- class harvester.endpoint.OpenSearchEndpoint(url: str, format_config: OpenSearchFormat, query: OpenSearchQuery)[source]
Bases:
Endpoint
- NS = {'': 'http://www.w3.org/2005/Atom', 'cql': 'http://a9.com/-/opensearch/extensions/cql/1.0/', 'dc': 'http://purl.org/dc/elements/1.1/', 'eo': 'http://a9.com/-/opensearch/extensions/eo/1.0/', 'geo': 'http://a9.com/-/opensearch/extensions/geo/1.0/', 'georss': 'http://www.georss.org/georss/', 'media': 'http://search.yahoo.com/mrss/', 'opensearch': 'http://a9.com/-/spec/opensearch/1.1/', 'owc': 'http://www.opengis.net/owc/1.0/', 'parameters': 'http://a9.com/-/spec/opensearch/extensions/parameters/1.0/', 'time': 'http://a9.com/-/opensearch/extensions/time/1.0/'}
- harvest() Iterator[dict] [source]
Starts the harvesting of the resource, returning an iterator of the harvested items.
- type = 'OpenSearch'
- class harvester.endpoint.STACAPIEndpoint(url: str, query: StacAPIQuery)[source]
Bases:
Endpoint
- harvest() Iterator[dict] [source]
Starts the harvesting of the resource, returning an iterator of the harvested items.
- type = 'STACAPI'
- harvester.endpoint.create_oads_endpoint(resource_config: ResourceConfig) Endpoint [source]
- harvester.endpoint.create_opensearch_endpoint(resource_config: ResourceConfig) Endpoint [source]
- harvester.endpoint.create_stacapi_endpoint(resource_config: ResourceConfig) Endpoint [source]
- harvester.endpoint.get_endpoint(resource_config: ResourceConfig) Endpoint | None [source]
Retrieves endpoint from mapping if found
- Parameters:
resource_config (ResourceConfig) – Resource configuration
- Returns:
Initialized endpoint from ENDPOINT_MAP
- Return type:
Optional[Endpoint]