Getting Started with

The DataGarden

Welcome to The DataGarden – your one-stop solution for accessing high-quality public data from multiple sources and countries, all through a unified API.

What is The DataGarden?

The DataGarden provides:

  • Aggregated Public Data: High-quality, reliable data from diverse public sources worldwide.
  • Regional: Not only country statistics but also statistics for states, counties, cities and even zip codes.
  • A Unified API: Consistent, single-point access to all datasets.
  • Unified Data Models: All data, regardless of source, is standardized into common data models.
  • Ease of Integration: A Python SDK for smooth integration into your workflows.

How It Works

1. Accessing the API

The DataGarden API allows you to:

  • Query datasets across models like demographics, economy, health, etc.
  • Retrieve data at levels of regionality such as countries, states, counties, etc.
  • Retrieve the region hierarchy for a given region.
  • Find out what data is available for a given set of regions.

2. Using the Python SDK

The Python SDK simplifies API interaction and adds additional features to the data models.

Installing the SDK

              
pip install the-datagarden
              
          

Quick Start

            
  >>> 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.

Getting Started Steps

  1. Sign Up and Get Your API Key: Visit the-datagarden.io
  2. Explore the Documentation: Check our Datagarden Data Models
  3. Explore the API: Check our Datagarden API Documentation
  4. Review SDK: Check on Github The Python SDK Repository
  5. Review SDK Documentation: on Read the docs The Python SDK Documentation
  6. Or Contact us at support@the-datagarden.io

Start today and unlock the potential of public data with The DataGarden!