Module implementing some common utility functions


Given an Enum class it provide an object for serialization/deserialization


enum_class (Type[Enum]) –

Return type:

Dict[str, dict]


Takes a dictionary and removes keys without value


payload (dict) –

Return type:


class sentinelhub.api.utils.AccessSpecification[source]

Bases: TypedDict

Specification of a S3 input or output.

s3: Dict[str, Any]
sentinelhub.api.utils.s3_specification(url, access_key=None, secret_access_key=None, iam_role_arn=None, region=None)[source]

A helper method to build a dictionary used for specifying S3 paths. Consult the access documentation for more information.

In general either use iam_role_arn or access_key plus secret_access_key.

  • url (str) – A URL pointing to an S3 bucket or an object in an S3 bucket.

  • access_key (str | None) – AWS access key that allows programmatic access to the S3 bucket specified in the url field.

  • secret_access_key (str | None) – AWS secret access key which must correspond to the AWS access key.

  • iam_role_arn (str | None) – IAM role ARN, which allows programmatic access to the S3 bucket specified in the url field using the recommended assume IAM role flow.

  • region (str | None) – The region where the S3 bucket is located. If omitted, the region of the Sentinel Hub deployment that the request is submitted to is assumed.


A dictionary of S3 specifications used by the Batch Statistical API

Return type: