Skip to content

OData

Namespace

cdse.odata.api.OData

OData(transport: Transport, base_url: str)

Entry point for the OData catalogue resources.

Products

cdse.odata.products.ProductsResource

ProductsResource(transport: Transport, base_url: str)

Access the Products collection of the OData catalogue.

search

search(
    query: str | FilterBuilder | None = None,
    *,
    order_by: str | None = None,
    top: int | None = None,
    skip: int | None = None,
    expand: Sequence[str] | None = None,
    select: Sequence[str] | None = None,
) -> Iterator[Product]

Yield products matching the query, following paging links lazily.

Parameters:

Name Type Description Default
query str | FilterBuilder | None

A :class:FilterBuilder or a raw $filter string.

None
order_by str | None

An $orderby clause such as "ContentDate/Start desc".

None
top int | None

Page size for the first request.

None
skip int | None

Number of leading results to skip.

None
expand Sequence[str] | None

Related data to include, for example ["Attributes"].

None
select Sequence[str] | None

Specific fields to return.

None

search_page

search_page(
    query: str | FilterBuilder | None = None,
    *,
    order_by: str | None = None,
    top: int | None = None,
    skip: int | None = None,
    expand: Sequence[str] | None = None,
    select: Sequence[str] | None = None,
    count: bool = False,
) -> ProductPage

Return a single page of results, optionally including the total count.

get

get(
    product_id: str, *, expand: Sequence[str] | None = None
) -> Product

Fetch a single product by its UUID.

count

count(query: str | FilterBuilder | None = None) -> int

Return the number of products matching the query.

filter_list

filter_list(names: Sequence[str]) -> list[Product]

Resolve a list of product names in a single bulk request.

download

download(
    product_id: str,
    destination: str | Path,
    *,
    chunk_size: int = DEFAULT_CHUNK_SIZE,
    resume: bool = False,
) -> Path

Download a whole product to destination as a zip archive.

list_nodes

list_nodes(product_id: str, *path: str) -> list[Node]

List the nodes inside a product, optionally at a nested path.

Calling without a path lists the product root; passing node names descends into the file tree.

download_node

download_node(
    product_id: str,
    *path: str,
    destination: str | Path,
    chunk_size: int = DEFAULT_CHUNK_SIZE,
    resume: bool = False,
) -> Path

Download a single file node from inside a product.

Bursts

cdse.odata.bursts.BurstsResource

BurstsResource(transport: Transport, base_url: str)

Access the Bursts collection of the OData catalogue.

search

search(
    query: str | FilterBuilder | None = None,
    *,
    burst_id: int | None = None,
    parent_product_id: str | None = None,
    swath: str | None = None,
    polarisation: str | None = None,
    intersects: str | None = None,
    start: datetime | date | None = None,
    end: datetime | date | None = None,
    order_by: str | None = None,
    top: int | None = None,
    skip: int | None = None,
) -> Iterator[Burst]

Yield bursts matching the query, following paging links lazily.

The keyword arguments are convenience filters that are combined with a logical and; query may add a raw expression or builder on top.

search_page

search_page(
    query: str | FilterBuilder | None = None,
    *,
    order_by: str | None = None,
    top: int | None = None,
    skip: int | None = None,
    count: bool = False,
) -> BurstPage

Return a single page of bursts.

get

get(burst_id: str) -> Burst

Fetch a single burst by its UUID.

count

count(query: str | FilterBuilder | None = None) -> int

Return the number of bursts matching the query.

Deleted products

cdse.odata.deleted.DeletedProductsResource

DeletedProductsResource(
    transport: Transport, base_url: str
)

Access the DeletedProducts collection of the OData catalogue.

search

search(
    query: str | FilterBuilder | None = None,
    *,
    order_by: str | None = None,
    top: int | None = None,
    skip: int | None = None,
    expand: Sequence[str] | None = None,
    select: Sequence[str] | None = None,
) -> Iterator[DeletedProduct]

Yield deleted products matching the query, following paging links.

search_page

search_page(
    query: str | FilterBuilder | None = None,
    *,
    order_by: str | None = None,
    top: int | None = None,
    skip: int | None = None,
    expand: Sequence[str] | None = None,
    select: Sequence[str] | None = None,
    count: bool = False,
) -> DeletedProductPage

Return a single page of deleted products.

count

count(query: str | FilterBuilder | None = None) -> int

Return the number of deleted products matching the query.

Attributes

cdse.odata.attributes.AttributesResource

AttributesResource(transport: Transport, base_url: str)

Access the Attributes collection of the OData catalogue.

list

list(
    collection: str | None = None,
) -> list[AttributeDefinition]

List queryable attributes, optionally scoped to a collection.

Parameters:

Name Type Description Default
collection str | None

A collection name such as SENTINEL-1. When omitted, attributes for all collections are returned.

None

Query builder

cdse.odata.query

Builders for OData $filter and $orderby expressions.

These helpers assemble the query strings that the OData API expects while taking care of the awkward details: escaping string literals, formatting timestamps, and choosing the correct attribute type. A raw escape hatch is always available through :meth:FilterBuilder.raw for expressions that are not covered here.

FilterBuilder

FilterBuilder()

Accumulate filter conditions and join them with a logical and.

raw

raw(expression: str) -> FilterBuilder

Add a raw filter expression verbatim.

name

name(value: str) -> FilterBuilder

Match products whose name equals value exactly.

name_contains

name_contains(value: str) -> FilterBuilder

Match products whose name contains value.

collection

collection(name: str) -> FilterBuilder

Restrict the query to a collection, for example SENTINEL-2.

online

online(value: bool = True) -> FilterBuilder

Match products by their online (immediately available) status.

acquired_between

acquired_between(
    start: datetime | date, end: datetime | date
) -> FilterBuilder

Match products sensed within the given range (inclusive).

published_between

published_between(
    start: datetime | date, end: datetime | date
) -> FilterBuilder

Match products published within the given range (inclusive).

deleted_between

deleted_between(
    start: datetime | date, end: datetime | date
) -> FilterBuilder

Match products deleted within the given range (DeletedProducts only).

deletion_cause

deletion_cause(cause: str) -> FilterBuilder

Match deleted products by their deletion cause (DeletedProducts only).

intersects

intersects(
    geometry: str, *, srid: int = 4326
) -> FilterBuilder

Match products intersecting a WKT geometry, for example a polygon.

attribute

attribute(
    name: str,
    operator: ComparisonOperator,
    value: int | float | str | datetime | date,
) -> FilterBuilder

Match products by a named attribute, choosing the type automatically.

For example attribute("cloudCover", "le", 40.0) filters on cloud cover. The attribute type is inferred from the Python value.

build

build() -> str

Return the combined filter expression.

escape_literal

escape_literal(value: str) -> str

Escape a string for use inside a single quoted OData literal.

OData escapes a single quote by doubling it.

build_orderby

build_orderby(
    field: str, direction: SortDirection = "asc"
) -> str

Build an $orderby clause, for example ContentDate/Start desc.

resolve_filter

resolve_filter(
    query: str | FilterBuilder | None,
) -> str | None

Resolve a query argument to a $filter string, or None when empty.

Models

cdse.odata.models

Typed models for OData responses.

The OData API returns JSON with PascalCase field names. These models expose the data with idiomatic snake_case attributes while accepting the original names on input. Fields that only appear when requested through $expand or that depend on the product are optional, so a partial response still validates.

ContentDate

Bases: BaseModel

The sensing time span of a product.

Checksum

Bases: BaseModel

A checksum entry for a product.

Attribute

Bases: BaseModel

A single product attribute, returned when expanding Attributes.

Location

Bases: BaseModel

A physical location of the product data, from $expand=Locations.

Asset

Bases: BaseModel

An asset such as a quicklook, from $expand=Assets.

Product

Bases: BaseModel

A catalogue product.

Only id and name are guaranteed to be present. Everything else is optional so that responses narrowed with $select still validate.

DeletedProduct

Bases: Product

A product that has been removed from the catalogue.

ProductPage

Bases: BaseModel

A single page of a products query.

DeletedProductPage

Bases: BaseModel

A single page of a deleted products query.

Burst

Bases: BaseModel

A Sentinel-1 SLC burst from the Bursts collection.

BurstPage

Bases: BaseModel

A single page of a bursts query.

Bases: BaseModel

A link to the children of a node.

Node

Bases: BaseModel

A node in a product's internal file tree.

The exact response shape for node listings is not fully documented; the fields here are parsed leniently and unknown keys are ignored, so the shape should be confirmed against the live API before relying on it.

is_directory property

is_directory: bool

Whether this node has children and is therefore a directory.

AttributeDefinition

Bases: BaseModel

A queryable attribute exposed by the Attributes endpoint.

The response shape for this endpoint is not documented in detail, so the model is lenient and should be confirmed against the live API.