The DataGarden SDK

For convenience, we provide a Python SDK for the Datagarden API. This SDK allows you to easily access the Datagarden API and take advantage of the data models and validation features. When using the SDK, you no longer have to deal with the API directly and can make use of the more functional interface of the SDK

The SDK is fully documented on ReadTheDocs. Read all about the SDK in the extensive documentation.

A quick example

The SDK allows you to easily retrieve Economics data for a country from the Datagarden.

			# retrieve economics data for germany
  >>> from the-datagarden import DataGardenAPI
  >>> 
  >>> my_api = DataGardenAPI()
  >>> germany = my_api.germany 
  >>> german_economics = germany.economics() 
  >>> my_dataframe = german_economics.full_model_to_pandas() # or full_model_to_polars()
			
		

This will give you a dataframe `my_dataframe` with Demographic data for Germany. The dataframe will allow you to do further analysis, combine the regional economics data with your ownj data, or export the data in a variety of formats. The `germany_economics` object in this example is an instance of class `TheDataGardenRegionalDataModel`. This class is defined in the DataGarden SDK and provides methods to extend the scope of the data by for example adding economics data for german subregions, or changing the data range for which the economics data is retrieved.

Installing the Datagarden SDK

The Datagarden SDK is available on PyPI and can be installed using pip or any other package manager.


    $ pip install the-datagarden