start at geo-db

This commit is contained in:
luptmoor
2026-03-04 14:11:42 +01:00
commit 2fe03e22d0
6 changed files with 132 additions and 0 deletions

38
sentinel.py Normal file
View File

@@ -0,0 +1,38 @@
import requests
class Sentinel:
def __init__ (self, user, pw,
id="cdse-public",
type="password",
auth_url="https://identity.dataspace.copernicus.eu/auth/realms/CDSE/protocol/openid-connect/token"
):
self.user = user;
self.password = pw;
self.auth_url = auth_url;
self.login_data = {
"client_id": id,
"username": self.user,
"password": self.password,
"grant_type": type,
}
def login(self):
response = requests.post(self.auth_url, data=self.login_data);
self.access_token = response.json()["access_token"];
print(f"Login with user {self.user} successful.");
if __name__ == "__main__":
sat = Sentinel("test", "endex");
sat.login();