Welcome to The DataGarden – your one-stop solution for accessing high-quality public data from multiple sources and countries, all through a unified API.
The DataGarden provides:
The DataGarden API allows you to:
The Python SDK simplifies API interaction and adds additional features to the data models.
pip install the-datagarden
>>> from the_datagarden import TheDataGardenAPI
# Initialize the client with your API key
>>> client_api = TheDataGardenAPI(email="your.email@example.com", password="your_password")
# Retrieve a country object
>>> germany = client_api.germany
# Retrieving demographics data for Germany
>>> germany_demographics = germany.demographics
>>> germany_demographics(period_from="2010-01-01")
TheDataGardenRegionalDataModel : Demographics : (count=29)
# Convert demographics data to a dataframe
>>> dataframe = germany_demographics.full_model_to_polars()
The dataframe now gives you full access the demographics data for Germany as of 2010-01-01. In this example the 29 records in the dataframe contains demographic data from Germnay for a specific year. The data frame contains columns from metadata like period, period type, source and region for which the data is available next to the actual demographic data. Adding the demographic data for german states can be done using the parameter region_level=1 as state is the first level of regionality below the country level.
>>> from the_datagarden import TheDataGardenAPI
# Initialize the client with your API key
>>> client_api = TheDataGardenAPI(email="your.email@example.com", password="your_password")
# Retrieve a country object
>>> germany = client_api.germany
# Retrieving demographics data for Germany
>>> germany_demographics = germany.demographics
>>> germany_demographics(period_from="2010-01-01")
TheDataGardenRegionalDataModel : Demographics : (count=29)
# As this is only demographic data for the country germany we can now add the data for the states of germany
>>> germany_demographics(period_from="2010-01-01", region_level=1)
TheDataGardenRegionalDataModel : Demographics : (count=253)
>>> dataframe = germany_demographics.full_model_to_polars()
The dataframe now contains the 253 records of demographic data for Germany and the states of Germany for the period 2010-01-01. With the metdata columns in the data frame you can easily select for which region(type) and period you want to use the data.
For more options on how to use the SDK to get more data out of the API please refer to the The DataGarden SDK on Read the Docs.Start today and unlock the potential of public data with The DataGarden!