Installation¶
Requirements¶
Python 3.8+
Internet connection for STAC API access
Install from PyPI¶
pip install landsatlook-stac
Development Installation¶
For development or to get the latest features:
git clone https://github.com/your-username/landstac.git
cd landstac
pip install -e .
Dependencies¶
landstac automatically installs these required packages:
pystac-client- STAC API clientrequests- HTTP librarybeautifulsoup4- HTML parsing for authenticationrasterio- Geospatial raster I/Orioxarray- xarray integration for rasteriotqdm- Progress bars
Authentication Setup¶
To access protected Landsat assets, you need a USGS ERS account:
Register at https://ers.cr.usgs.gov/register/
Create a
credentials.jsonfile in your working directory:
{
"username": "your_usgs_username",
"password": "your_usgs_password",
"token": null
}
Alternatively, set environment variables:
export USGS_USER="your_username"
export USGS_PASS="your_password"
Verification¶
Test your installation:
import landstac
stac = landstac.LandsatLookSTAC()
print(f"Connected to: {stac.url}")
# Test a simple search (no authentication required)
items = stac.search(
collections=["landsat-c2l2-sr"],
max_items=1
)
print(f"Search successful: found {len(items)} item(s)")