Simple Python wrapper of the USGS/EROS Inventory Service Machine-to-Machine API as described in the documents.
UPDATE 2024.12.06
- All USGS methods, data types and errors are now consistent with the USGS API.
- All USGS data types are now classes. Use
.dict
to convert them to a dictionary. - Type hits added to USGS methods and data types.
- The old USGS
login
method will be deprecated in February 2025 (a warning has been added).
Important
You must have machine-to-machine access to execute queries. You can order access here.
INSTALLATION
pip install https://github.com/MrChebur/usgs-machine-to-machine-API/archive/master.zip
CODE EXAMPLES
from usgs_m2m.usgsMethods import API as M2M
api = M2M()
api.loginToken('usgs_username', 'usgs_token')
permissions = api.permissions()
print(permissions)
# {
# 'requestId': '00000000',
# 'version': 'stable',
# 'sessionId': '00000000',
# 'data': ['user', 'download', 'order'],
# 'errorCode': None,
# 'errorMessage': None
# }
See more usage example here.