sentinelhub.api.base

Module implementing some utility functions not suitable for other utility modules

class sentinelhub.api.base.SentinelHubService(config=None)[source]

Bases: object

A base class for classes interacting with different Sentinel Hub APIs

Parameters

config (Optional[SHConfig]) – A configuration object with required parameters sh_client_id, sh_client_secret, and sh_auth_base_url which is used for authentication and sh_base_url which defines the service deployment that will be used.

class sentinelhub.api.base.SentinelHubFeatureIterator(*args, exception_message=None, **kwargs)[source]

Bases: FeatureIterator[Dict[str, Any]]

Feature iterator for the most common implementation of feature pagination at Sentinel Hub services

Parameters
  • args – Arguments passed to FeatureIterator

  • exception_message – A message to be raised if no features are found

  • kwargs – Keyword arguments passed to FeatureIterator

class sentinelhub.api.base.BaseCollection(name, s3_bucket, additional_data, collection_id=None, user_id=None, created=None, no_data=None, other_data=<factory>)[source]

Bases: object

Dataclass to hold data about a collection

Parameters
name: str
s3_bucket: str
additional_data: Optional[_AdditionalData]
collection_id: Optional[str] = None
user_id: Optional[str] = None
created: Optional[datetime] = None
no_data: Optional[Union[int, float]] = None
other_data: Optional[CatchAllVar]
dataclass_json_config = {'letter_case': <function camelcase>, 'undefined': Undefined.INCLUDE}
classmethod from_dict(kvs, *, infer_missing=False)
Parameters

kvs (Optional[Union[dict, list, str, int, float, bool]]) –

Return type

A

classmethod from_json(s, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw)
Parameters

s (Union[str, bytes, bytearray]) –

Return type

A

classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
Parameters
  • infer_missing (bool) –

  • many (bool) –

  • partial (bool) –

Return type

SchemaF[A]

to_data_collection()[source]

Returns a DataCollection enum for this collection

Return type

DataCollection

to_dict(encode_json=False)
Return type

Dict[str, Optional[Union[dict, list, str, int, float, bool]]]

to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)
Parameters
Return type

str