qa4sm-api
Python client library for interacting with the QA4SM (Quality Assurance for Soil Moisture) validation service. QA4SM is an online platform for validating (satellite) soil moisture datasets.
Features
API Client: Python API for QA4SM.eu web service
Command Line Interface: Convenient CLI for common operations
Result Download: Download NetCDF, graphics, and summary statistics
Search datasets in the service, download validation configurations, …
Programmatically trigger validation runs
Coming soon:
Programmatically upload your data for validation
Installation
Install from PyPI:
pip install qa4sm-api
Or from source:
git clone https://github.com/awst-austria/qa4sm-api.git
cd qa4sm-api
pip install -e .
Verify installation
Run the following commands in your console to verify that the page was installed.
# Test installation
qa4sm --version
# Check available commands
qa4sm --help
Authentication
In order to use the full API, you need to authenticate with QA4SM via your user token.
Go to https://qa4sm.eu/ui/user-profile and request an API token
Choose one of the following 2 options to add the token to the local file ~/.qa4smapirc to use the API
Option 1: Manual setup
Create ~/.qa4smapirc (Linux/MacOs) or %USERPROFILE%\.qa4smapirc (Windows) with your credentials:
[qa4sm.eu]
token: your_api_token_here
username: your_username
Option 2: Automated setup
qa4sm api setup
This prompts for your username and password and stores your API token in ~/.qa4smapirc.
Documentation
Full documentation is available at https://awst-austria.github.io/qa4sm-api/
Quick Start
Here are some example commands on using the API in a python application. See the full documentation at https://awst-austria.github.io/qa4sm-api/ for more examples.
>>> from qa4sm_api.client_api import Connection, ValidationConfiguration
>>> conn = Connection()
Hi, <username>! You're successfully logged in at https://qa4sm.eu/api/!
>>> conn.datasets()[['short_name']]
short_name
id
1 C3S_combined
2 SMAP_L3
3 ASCAT
4 ISMN
5 GLDAS
6 ESA_CCI_SM_combined
7 SMOS_IC
... ...
>>> conn.versions("C3S_combined")
short_name pretty_name ... time_range_end geographical_range
1 C3S_V201706 v201706 ... 2022-10-10 None
10 C3S_V201812 v201812 ... 2018-12-31 None
28 C3S_V201912 v201912 ... 2019-12-31 None
31 C3S_V202012 v202012 ... 2020-12-31 None
45 C3S_V202212 v202212 ... 2025-07-20 None
58 C3S_V202312 v202312 ... 2025-07-20 None
70 C3S_V202505 v202505 ... 2024-12-31 None
>>> config = conn.download_configuration("9aeb663b-e24e-4541-8331-6ec3e0318d1f")
>>> print(config.data)
{'name_tag': 'Test Case QA4SM_VA_metrics - Test scaling_no_scaling_DEFAULT', 'interval_from': '1978-11-01', 'interval_to': '2024-12-31', 'temporal_matching': 12, 'anomalies_method': 'none', 'anomalies_from': None, 'anomalies_to': None, 'min_lat': 34.0, 'min_lon': -11.2, 'max_lat': 71.6, 'max_lon': 48.3, 'scaling_method': 'none', 'metrics': [{'id': 'tcol', 'value': False}, {'id': 'bootstrap_tcol_cis', 'value': False}, {'id': 'stability_metrics', 'value': False}], 'intra_annual_metrics': {'intra_annual_metrics': False, 'intra_annual_type': '', 'intra_annual_overlap': None}, 'dataset_configs': [{'dataset_id': 1, 'version_id': 70, 'variable_id': 1, 'is_spatial_reference': False, 'is_temporal_reference': True, 'is_scaling_reference': False, 'basic_filters': [1], 'parametrised_filters': []}, {'dataset_id': 4, 'version_id': 69, 'variable_id': 4, 'is_spatial_reference': True, 'is_temporal_reference': False, 'is_scaling_reference': False, 'basic_filters': [1, 2], 'parametrised_filters': [{'id': 18, 'parameters': 'AMMA-CATCH,DAHRA,TAHMO,SD_DEM,CHINA,CTP_SMTMN,HiWATER_EHWSN,HSC_SEOLMACHEON,IIT_KANPUR,KHOREZM,MAQU,MONGOLIA,MySMNet,RUSWET-AGRO,RUSWET-GRASS,RUSWET-VALDAI,SKKU,SW-WHU,KIHS_CMC,KIHS_SMC,VDS,NAQU,NGARI,SMN-SDR,SONTE-China,WIT-Network,AACES,OZNET,SASMAS,BIEBRZA_S-1,CALABRIA,CAMPANIA,FMI,FR_Aqui,GROW,GTK,HOBE,HYDROL-NET_PERUGIA,IMA_CAN1,METEROBS,MOL-RAO,ORACLE,REMEDHUS,RSMN,SMOSMANIA,SWEX_POLAND,TERENO,UDC_SMOS,UMBRIA,UMSUOL,VAS,WEGENERNET,WSMN,HOAL,IPE,COSMOS-UK,LABFLUX,NVE,Ru_CFR,STEMS,TWENTE,XMS-CAT,ARM,AWDN,BNZ-LTER,FLUXNET-AMERIFLUX,ICN,IOWA,PBO_H2O,RISMA,SCAN,SNOTEL,SOILSCAPE,USCRN,USDA-ARS,TxSON,LAB-net,PTSMN'}, {'id': 24, 'parameters': '0.00,0.10'}]}], 'settings_changes': {'filters': [], 'anomalies': False, 'scaling': False, 'variables': [], 'versions': []}}
>>> r = conn.start_validation(config)
>>> print(r.status)
'SCHEDULED'
CLI Commands
qa4sm api setup - Configure authentication
qa4sm api check - Verify authentication
qa4sm validate <CONFIG.json> - Submit a validation run
qa4sm download config <RUN_ID> - Download configuration
qa4sm download results <RUN_ID> - Download validation results
Use qa4sm --help for all commands.
Testing
Run tests:
pip install -e ".[testing]"
pytest
Metadata
Release files for qa4sm-api 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| qa4sm_api-0.2.tar.gz | 54.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qa4sm_api-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.1 kB
Release files / qa4sm_api-0.2.tar.gz
| Download URL | qa4sm_api-0.2.tar.gz |
|---|---|
| Size | 54.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c36c8c35e8ef5fe64b95c45d5ab083cc76275adc211fcbfbd23aa41ec663214c
|
|
BLAKE2b-256 checksum How to use checksums |
b1bc12676c38cde57c31b903e951f8fd7e2c7bbe809367a586c0174dbdc17b01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / qa4sm_api-0.2-py3-none-any.whl
| Download URL | qa4sm_api-0.2-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7285b44b17f6c7bd406426ae3850d0b276e8e2cdc164f1ed5991830d60b7a5a0
|
|
BLAKE2b-256 checksum How to use checksums |
f70a5d1eb45a55f76aa75433c4c94443e02841601de6ec7473f5db04fad92ca1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for qa4sm-api 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.