datacube.index.Index

class datacube.index.Index(db: datacube.drivers.postgres._connections.PostgresDb)[source]

Access to the datacube index.

DON’T INITIALISE THIS DIRECTLY (it will break in the future). Use datacube.index.index_connect() or access property .index on your existing datacube.api.core.Datacube.

These are thread safe. But not multiprocess safe once a connection is made (db connections cannot be shared between processes) You can close idle connections before forking by calling close(), provided you know no other connections are active. Or else use a separate instance of this class in each process.

Variables:
  • datasets (datacube.index._datasets.DatasetResource) – store and retrieve datacube.model.Dataset
  • products (datacube.index._products.ProductResource) – store and retrieve datacube.model.DatasetType (should really be called Product)
  • metadata_types (datacube.index._metadata_types.MetadataTypeResource) – store and retrieve datacube.model.MetadataType
  • users (UserResource) – user management
__init__(db: datacube.drivers.postgres._connections.PostgresDb) → None[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(db) Initialize self.
close() Close any idle connections database connections.
from_config(config[, application_name, …])
get_dataset_fields(doc)
init_db([with_default_types, with_permissions])

Attributes

url