Utils
AgriquestBlocks
Bases: Enum
Available AgriQuest Block codes
Source code in geosyspy/utils/constants.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
AgriquestCommodityCode
Bases: Enum
Available AgriQuest Commodity values
Source code in geosyspy/utils/constants.py
54 55 56 57 58 59 |
|
AgriquestFranceBlockCode
Bases: Enum
Available AgriQuest Block codes dedicated to France
Source code in geosyspy/utils/constants.py
62 63 64 65 66 67 68 |
|
AgriquestWeatherType
Bases: Enum
Available AgriQuest Weather types
Source code in geosyspy/utils/constants.py
101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
CropIdSeason
Bases: Enum
Available season values for analytics processor Zarc
Source code in geosyspy/utils/constants.py
124 125 126 127 128 129 |
|
Emergence
Bases: Enum
Type of Emergence query used for Emergence analytics processor
Source code in geosyspy/utils/constants.py
45 46 47 48 49 50 51 |
|
Env
Bases: Enum
Environment to target (PROD, PREPROD)
Source code in geosyspy/utils/constants.py
23 24 25 26 27 28 |
|
GeosysApiEndpoints
Bases: Enum
Available Geosys APIs Endpoints
Source code in geosyspy/utils/constants.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
Harvest
Bases: Enum
Type of Harvest query used for Harvest analytics processor
Source code in geosyspy/utils/constants.py
38 39 40 41 42 43 |
|
Region
Bases: Enum
Region to target (NA)
Source code in geosyspy/utils/constants.py
31 32 33 34 35 |
|
SatelliteImageryCollection
Bases: Enum
Available imagery collections
Source code in geosyspy/utils/constants.py
4 5 6 7 8 9 10 11 |
|
WeatherTypeCollection
Bases: Enum
Available weather collections
Source code in geosyspy/utils/constants.py
14 15 16 17 18 19 20 |
|
ZarcCycleType
Bases: Enum
Available season values for analytics processor Zarc
Source code in geosyspy/utils/constants.py
132 133 134 135 136 137 138 139 |
|
ZarcSoilType
Bases: Enum
Available Soil Type values for analytics processor Zarc
Source code in geosyspy/utils/constants.py
115 116 117 118 119 120 121 122 |
|
Helper
Source code in geosyspy/utils/helper.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
convert_to_wkt(geometry)
staticmethod
convert a geometry (WKT or geoJson) to WKT Args: geometry : A string representing the geometry (WKT or geoJson)
Returns: |
|
---|
Source code in geosyspy/utils/helper.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
get_matched_str_from_pattern(pattern, text)
staticmethod
Returns the first occurence of the matched pattern in text.
Parameters: |
|
---|
Returns: |
|
---|
Source code in geosyspy/utils/helper.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
is_valid_wkt(geometry)
staticmethod
check if the geometry is a valid WKT Args: geometry : A string representing the geometry
Returns: |
|
---|
Source code in geosyspy/utils/helper.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
HttpClient
Source code in geosyspy/utils/http_client.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
get(url_endpoint, headers={})
Gets the url_endpopint.
Parameters: |
|
---|
Returns: |
|
---|
Source code in geosyspy/utils/http_client.py
50 51 52 53 54 55 56 57 58 59 60 |
|
patch(url_endpoint, payload)
Patchs payload to the url_endpoint.
Parameters: |
|
---|
Returns: |
|
---|
Source code in geosyspy/utils/http_client.py
75 76 77 78 79 80 81 82 83 84 85 86 |
|
post(url_endpoint, payload, headers={})
Posts payload to the url_endpoint.
Parameters: |
|
---|
Returns: |
|
---|
Source code in geosyspy/utils/http_client.py
62 63 64 65 66 67 68 69 70 71 72 73 |
|
renew_access_token(func)
Decorator used to wrap the Geosys class's http methods.
This decorator wraps the geosys http methods (get,post...) and checks whether the used token is still valid or not. If not, it fetches a new token and uses it to make another request.
Source code in geosyspy/utils/http_client.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Oauth2Api
Source code in geosyspy/utils/oauth2_client.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
__authenticate()
Authenticates the http_client to the API.
This method connects the user to the API which generates a token that will be valid for one hour. A refresh token is also generated, which makes it possible for the http methods wrappers to get a new token once the previous one is no more valid through the renew_access_token decorator. This method is only run once when a Geosys object is instantiated.
Source code in geosyspy/utils/oauth2_client.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
__init__(client_id, client_secret, username, password, enum_env, enum_region, bearer_token=None)
Initializes a Geosys instance with the required credentials to connect to the GEOSYS API.
Source code in geosyspy/utils/oauth2_client.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
get_refresh_token()
Fetches a new token.
Source code in geosyspy/utils/oauth2_client.py
61 62 63 64 65 66 67 68 |
|