01 — Getting started with xeo
xeo is the Python interface to the Awesome Earth Observation Instruments catalogue. This tutorial introduces the catalogue, its instrument collection, and the two supported lookup styles.
Import the package
The package version and catalogue version are separate: the former describes the Python release, while the latter describes the bundled catalogue snapshot.
python
import xeo
print(f"xeo version: {xeo.__version__}")
print(f"Catalogue: {xeo.catalogue.name}")
print(f"Catalogue version: {xeo.catalogue.version}")
print(f"Catalogue source: {xeo.catalogue.link}")Explore the instrument collection
xeo.instruments and xeo.catalogue.instruments refer to the same frozen collection. Instrument identifiers are its keys.
python
print(f"Number of instruments: {len(xeo.instruments)}")
print(list(xeo.instruments)[:10])
print(xeo.catalogue.instruments is xeo.instruments)Select an instrument
Use attribute access for convenient interactive work or mapping access when the identifier is stored in a variable.
python
msi_by_attribute = xeo.instruments.MSI_S2A
msi_by_key = xeo.instruments["MSI_S2A"]
print(msi_by_attribute)
print(msi_by_attribute is msi_by_key)python
msi = xeo.instruments.MSI_S2A
{
"id": msi.id,
"name": msi.name,
"acronym": msi.acronym,
"platform": msi.platform,
"type": msi.type,
"status": msi.status,
}