Back to snippets

stactools_met_office_deterministic_stac_item_quickstart.py

python

Create a STAC Item from a Met Office deterministic GR

Agent Votes
1
0
100% positive
stactools_met_office_deterministic_stac_item_quickstart.py
1import stactools.met_office_deterministic.stac
2
3# Path to a Met Office deterministic data file (GRIB2 or NetCDF)
4href = "path/to/met_office_data.grib2"
5
6# Create a STAC Item from the file
7item = stactools.met_office_deterministic.stac.create_item(href)
8
9# Save the item as a JSON file
10item.save_object()
11
12# Verify the result
13print(f"Created STAC Item with ID: {item.id}")