PyWIG

The main entry point for starting the integration is the PyWig class. The following example show you how to initialise the class to start exploring the WatchItGrow data.

wig = Wig()
wig.authenticate_basic('your_wig_username', 'your_wig_password)

Next up you can use of the functions below to start interacting with your fields and data in WatchItGrow.

class pywig.Wig(env: str = 'prod')[source]

Class that is used to interact with the WatchItGrow API

authenticate_basic(username: str, password: str)[source]

Authenticate with WIG using your username and password

Parameters:
  • username – Username of your WIG account

  • password – Password of your WIG account

get_field_details(id) Field[source]

Retrieve a field based on its ID

Parameters:

id – ID of the field to retrieve

Returns:

Field object containing the full field details

Return type:

Field

get_fields() List[Field][source]

Retrieve all fields linked to the authenticated user

Returns:

List of field objects containing the basic field information

Return type:

List

get_meteo(field_id: str, key: str, start_date: date = None, end_date: date = None) List[MeteoStat][source]

Retrieve the meteo statistics for the selected field

Parameters:
  • field_id – ID of the field for which to retrieve the meteo statistics

  • key – Key that represents what type of meteo information should be fetched.

For fields inside of Belgium, the supported keys are (AVERAGE_TEMPERATURE, MAXIMUM_TEMPERATURE, MINIMUM_TEMPERATURE, RAINFALL). For fields outside of Belgium, the supported keys are (TEMPERATURE, RAINFALL). :param start_date: The date from where to retrieve the meteo data :param end_date: The end date for the meteo data retrieval :return: A list of MeteoStat entries :rtype: List