Logo Lanfrica

Pivot-Madagascar/pridec_gee

Domaine:

environment and energygeospatial

Type de record:

software
Créateur:
Piv
Hôte:
A python package to import environmental data from Google Earth Engine into DHIS2 Instances # pridec-gee A python library to extract environmental and climate variables from DHIS2 polygons and optionally import the data into a DHIS2 instance ## Pre-requisites ### DHIS2 Instance Any DHIS2 instance can be used for the extraction of climate variables if it has associated polygons for the orgUnits of interest. If you would like to import the climate variables into the DHIS2 instance, the PRIDE-C metadata must already be in place. Please see `docs/pridec-climate-metadata.json` for a list of dataElements to create. More info can be found at this configuration repo. For testing, it is recommended that you use a local instance via the DHIS2 CLI. You will need to either create a personal access token to access this account or have access to a username/password that can acces the geojson data and POST dataElements. ### Google Earth Engine Service Account This workflow requires an activated GEE service account, project, and service token. The information for this is stored in `.gee-private-key.json`. You can create your account following instructions here. The GEE account can then either be authenticated via script or interactively: ``` #via script credentials = ee.ServiceAccountCredentials(GEE_SERVICE_ACCOUNT, ".gee-private-key.json") ee.Initialize(credentials) #interactively ee.Authenticate() ee.Initialize(project=os.environ.get("GEE_PROJECT")) ``` ### Python This requires Python>=3.12. ## Installation **via github** ``` pip install git+github.com ``` **via pyPI** ``` pip install pridec_gee ``` ## Usage ### Create `.env` file The library uses several sensitive variables that can be provided via script or `.env` file. An example `.env` file is below: ``` DHIS_URL='your-dhis-url.com' DHIS_TOKEN='YOUR_DHIS_TOKEN' #or userame and password DHIS_USER='your-dhis-username' DHIS_PWD='your-dhis-password' PARENT_OU='parent-orgunit-uid' #usually an 11 character string from DHIS2, corresponding to parent uni …

Licenses