### Install Bundesrat Python Package with Setuptools Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/README.md Install the Python package using Setuptools. This command can be used to install for the current user or all users. ```sh python setup.py install --user ``` -------------------------------- ### API Client Initialization and Setup Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Shows the basic setup for using the Destatis API client. It includes importing necessary modules and initializing the API client within a context manager. This is a prerequisite for making any API calls. ```python import time from deutschland import destatis from deutschland.destatis.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www-genesis.destatis.de/genesisWS/rest/2020 ``` -------------------------------- ### Install Deutschland Package Source: https://github.com/bundesapi/deutschland/blob/main/README.md Install the package using pip. Ensure you are using a supported Python version (3.9-3.12). ```bash pip install deutschland ``` -------------------------------- ### Get Cube Metadata with Destatis API Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Demonstrates how to fetch cube metadata using the DefaultApi. Ensure the Destatis library is installed and configured. Optional parameters like username, password, name, area, and language can be provided. ```python import time from deutschland import destatis from deutschland.destatis.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www-genesis.destatis.de/genesisWS/rest/2020 # See configuration.py for a list of all supported configuration parameters. configuration = destatis.Configuration( host = "https://www-genesis.destatis.de/genesisWS/rest/2020" ) # Enter a context with an instance of the API client with destatis.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) username = "GAST" # str | (optional) if omitted the server will use the default value of "GAST" password = "GAST" # str | (optional) if omitted the server will use the default value of "GAST" name = "name_example" # str | (optional) area = "free" # str | (optional) if omitted the server will use the default value of "free" language = "de" # str | (optional) if omitted the server will use the default value of "de" # example passing only required values which don't have defaults set # and optional values try: api_instance.cube_meta(username=username, password=password, name=name, area=area, language=language) except destatis.ApiException as e: print("Exception when calling DefaultApi->cube_meta: %s\n" % e) ``` -------------------------------- ### Get Product Categories (Python) Source: https://github.com/bundesapi/deutschland/blob/main/docs/zoll/docs/DefaultApi.md Retrieves product category data from the Zoll API. This example demonstrates both basic and optional parameter usage. Ensure the 'zoll' library is installed. ```python import time from deutschland import zoll from deutschland.zoll.api import default_api from deutschland.zoll.model.categories import Categories from pprint import pprint # Defining the host is optional and defaults to https://www.bundesfinanzministerium.de/SiteGlobals/Functions/Apps/retrieve # See configuration.py for a list of all supported configuration parameters. configuration = zoll.Configuration( host = "https://www.bundesfinanzministerium.de/SiteGlobals/Functions/Apps/retrieve" ) # Enter a context with an instance of the API client with zoll.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) last_modified_date = "" # str | (optional) if omitted the server will use the default value of "" # example passing only required values which don't have defaults set try: # Produktkategorien api_response = api_instance.kategorien_get() pprint(api_response) except zoll.ApiException as e: print("Exception when calling DefaultApi->kategorien_get: %s\n" % e) # example passing only required values which don't have defaults set # and optional values try: # Produktkategorien api_response = api_instance.kategorien_get(last_modified_date=last_modified_date) pprint(api_response) except zoll.ApiException as e: print("Exception when calling DefaultApi->kategorien_get: %s\n" % e) ``` -------------------------------- ### Get Currency Exchange Rates (Python) Source: https://github.com/bundesapi/deutschland/blob/main/docs/zoll/docs/DefaultApi.md Retrieves currency exchange rate data from the Zoll API. This example shows a basic call to the endpoint. Ensure the 'zoll' library is installed. ```python import time from deutschland import zoll from deutschland.zoll.api import default_api from deutschland.zoll.model.exchange_rates import ExchangeRates from pprint import pprint # Defining the host is optional and defaults to https://www.bundesfinanzministerium.de/SiteGlobals/Functions/Apps/retrieve # See configuration.py for a list of all supported configuration parameters. configuration = zoll.Configuration( host = "https://www.bundesfinanzministerium.de/SiteGlobals/Functions/Apps/retrieve" ) # Enter a context with an instance of the API client with zoll.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) # example passing only required values which don't have defaults set try: # Währungskurse api_response = api_instance.kurse_app_kurs_export_txt_get() pprint(api_response) except zoll.ApiException as e: print("Exception when calling DefaultApi->kurse_app_kurs_export_txt_get: %s\n" % e) ``` -------------------------------- ### Install Bundesrat Python Package Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/README.md Install the Python package directly from the GitHub repository using pip. This command may require root permissions. ```sh pip install git+https://github.com/bundesAPI/deutschland.git ``` -------------------------------- ### Get Termine Data (XML) Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/docs/DefaultApi.md Fetches appointment data in XML format using the Bundesrat API. This requires the 'deutschland' library and proper API client setup. ```python import time from deutschland import bundesrat from deutschland.bundesrat.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www.bundesrat.de # See configuration.py for a list of all supported configuration parameters. configuration = bundesrat.Configuration( host = "https://www.bundesrat.de" ) # Enter a context with an instance of the API client with bundesrat.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) view = "renderXml" # str | Xml Ausabe # example passing only required values which don't have defaults set try: # Termine api_response = api_instance.i_osv302_termine_termine_table_xml_get(view) pprint(api_response) except bundesrat.ApiException as e: print("Exception when calling DefaultApi->i_osv302_termine_termine_table_xml_get: %s\n" % e) ``` -------------------------------- ### Import Bundesrat Package Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/README.md Import the necessary bundesrat module after installation. ```python from deutschland import bundesrat ``` -------------------------------- ### Import Destatis Package Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/README.md Import the Destatis module after installation. This is the first step before you can use any of the library's functionalities. ```python from deutschland import destatis ``` -------------------------------- ### Get Station Overview Source: https://github.com/bundesapi/deutschland/blob/main/docs/ladestationen/docs/DefaultApi.md Retrieves an overview of charging stations with various filtering and output options. ```APIDOC ## GET /stations ### Description Retrieves a list of charging stations with options to filter by geometry, fields, and spatial relationships. ### Method GET ### Endpoint /stations ### Parameters #### Query Parameters - **geometry** (str) - Required - Geometry filter. URL-encoded JSON object of type `Geometry`. - **out_fields** (str) - Optional - Selection of fields to be output, separated by commas. Defaults to "*". - **geometry_type** (str) - Optional - Type of the Geometry. If omitted, the server will use the default value of "". - **f** (str) - Optional - Output format of the data. Defaults to 'html'. - **object_ids** (str) - Optional - Comma-separated list of IDs (integer), filters by individual objects. - **order_by_fields** (str) - Optional - Field(s) to order the results by. - **return_geometry** (bool) - Optional - Whether to return geometry information. - **spatial_rel** (str) - Optional - Spatial Relationships to apply. - **in_sr** (int) - Optional - Input Spatial Reference. - **out_sr** (int) - Optional - Output Spatial Reference. - **max_record_count_factor** (int) - Optional - Factor to adjust the maximum record count. - **result_type** (str) - Optional - Type of result to return. - **quantization_parameters** (str) - Optional - URL-encoded JSON object of type `QuantizationParameter`. - **where** (str) - Optional - SQL "where" clause for filtering. - **having** (str) - Optional - SQL "having" clause for filtering aggregated results. - **time** (int) - Optional - Filter by time. - **distance** (str) - Optional - Filter by distance. - **units** (str) - Optional - Units for distance calculations. - **geometry_precision** (str) - Optional - Precision for geometry operations. - **feature_encoding** (str) - Optional - Encoding format for features. - **group_by_fields_for_statistics** (str) - Optional - Fields to group by for statistical calculations. - **cache_hint** (bool) - Optional - Hint for caching. - **return_extent_only** (bool) - Optional - Whether to return only the extent. - **return_z** (bool) - Optional - Whether to return Z values. - **return_ids_only** (bool) - Optional - Whether to return only IDs. - **return_centroid** (bool) - Optional - Whether to return the centroid. - **return_exceeded_limit_features** (bool) - Optional - Whether to return features exceeding the limit. - **datum_transformation** (str) - Optional - Datum transformation to apply. - **result_offset** (str) - Optional - Offset for results. - **apply_vcs_projection** (bool) - Optional - Whether to apply VCS projection. - **out_statistics** (str) - Optional - Statistical calculations to perform. - **return_distinct_values** (bool) - Optional - Whether to return distinct values. - **multipatch_option** (str) - Optional - Option for multipatch features. - **return_m** (bool) - Optional - Whether to return M values. - **max_allowable_offset** (int) - Optional - Maximum allowable offset. - **return_count_only** (bool) - Optional - Whether to return only the count. - **return_unique_ids_only** (bool) - Optional - Whether to return only unique IDs. - **return_query_geometry** (bool) - Optional - Whether to return the query geometry. - **result_record_count** (int) - Optional - The number of records to return. - **sql_format** (str) - Optional - Format for SQL queries. - **token** (str) - Optional - Authentication token. - **return_geodetic** (bool) - Optional - Whether to return geodetic information. ### Response #### Success Response (200) - **StationOverview** (StationOverview) - Description of the returned station overview object. #### Response Example (Example response body would be detailed here if provided in source) ``` -------------------------------- ### Import smard Package Source: https://github.com/bundesapi/deutschland/blob/main/docs/smard/README.md Import the smard package after installation. This is the first step before using any of its functionalities. ```python from deutschland import smard ``` -------------------------------- ### Import Bundestag Package Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundestag/README.md Import the necessary bundestag module after installation. This is a prerequisite for using the API client. ```python from deutschland import bundestag ``` -------------------------------- ### Call whoami API Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Demonstrates how to call the whoami endpoint to get information about the current user. The user_agent parameter is optional. ```python configuration = destatis.Configuration( host = "https://www-genesis.destatis.de/genesisWS/rest/2020" ) with destatis.ApiClient() as api_client: api_instance = default_api.DefaultApi(api_client) user_agent = "user-agent_example" try: api_instance.whoami(user_agent=user_agent) except destatis.ApiException as e: print("Exception when calling DefaultApi->whoami: %s\n" % e) ``` -------------------------------- ### Basic API Usage Example Source: https://github.com/bundesapi/deutschland/blob/main/docs/lebensmittelwarnung/README.md Demonstrates how to initialize the API client, configure authentication, and make a request to list all food and product warnings. Includes error handling for API exceptions. ```python import time from deutschland import lebensmittelwarnung from pprint import pprint from deutschland.lebensmittelwarnung.api import default_api from deutschland.lebensmittelwarnung.model.inline_object import InlineObject from deutschland.lebensmittelwarnung.model.response import Response # Defining the host is optional and defaults to https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api # See configuration.py for a list of all supported configuration parameters. configuration = lebensmittelwarnung.Configuration( host = "https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: ApiKeyAuth configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client with lebensmittelwarnung.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) inline_object = InlineObject( food=RequestOptions( rows=500, sort="publishedDate desc, title asc", start=11, fq=["publishedDate > 1630067654000"], ), products=RequestOptions( rows=500, sort="publishedDate desc, title asc", start=11, fq=["publishedDate > 1630067654000"], ), ) # InlineObject | (optional) try: # Liste aller Lebensmittel und Produktwarnungen api_response = api_instance.list_warnungen(inline_object=inline_object) pprint(api_response) except lebensmittelwarnung.ApiException as e: print("Exception when calling DefaultApi->list_warnungen: %s\n" % e) ``` -------------------------------- ### Initialize and Use Bundesrat API Client Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/README.md Demonstrates how to initialize the API client, set the host, and make a request to retrieve member data in XML format. Includes error handling for API exceptions. ```python import time from deutschland import bundesrat from pprint import pprint from deutschland.bundesrat.api import default_api # Defining the host is optional and defaults to https://www.bundesrat.de # See configuration.py for a list of all supported configuration parameters. configuration = bundesrat.Configuration( host = "https://www.bundesrat.de" ) # Enter a context with an instance of the API client with bundesrat.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) view = "renderXml" # str | Xml Ausabe try: # Mitglieder api_response = api_instance.i_os_shared_docs2_mitglieder_mitglieder_table_xml_get(view) pprint(api_response) except bundesrat.ApiException as e: print("Exception when calling DefaultApi->i_os_shared_docs2_mitglieder_mitglieder_table_xml_get: %s\n" % e) ``` -------------------------------- ### Get Bundesrat Präsidium XML Data Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/docs/DefaultApi.md Retrieves XML data for the Bundesrat Präsidium. Ensure the 'deutschland' library is installed and configured. ```python import time from deutschland import bundesrat from deutschland.bundesrat.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www.bundesrat.de # See configuration.py for a list of all supported configuration parameters. configuration = bundesrat.Configuration( host = "https://www.bundesrat.de" ) # Enter a context with an instance of the API client with bundesrat.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) view = "renderXml" # str | Xml Ausabe # example passing only required values which don't have defaults set try: # Präsidium api_response = api_instance.i_osv305_bundesrat_praesidium_bundesrat_praesidium_xml_get(view) pprint(api_response) except bundesrat.ApiException as e: print("Exception when calling DefaultApi->i_osv305_bundesrat_praesidium_bundesrat_praesidium_xml_get: %s\n" % e) ``` -------------------------------- ### Get Bundesrat API Endpoints Overview XML Data Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/docs/DefaultApi.md Retrieves an XML overview of the Bundesrat API endpoints. Ensure the 'deutschland' library is installed. ```python import time from deutschland import bundesrat from deutschland.bundesrat.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www.bundesrat.de # See configuration.py for a list of all supported configuration parameters. configuration = bundesrat.Configuration( host = "https://www.bundesrat.de" ) # Enter a context with an instance of the API client with bundesrat.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) view = "renderXml" # str | Xml Ausabe # example passing only required values which don't have defaults set try: # Übersicht API Endpunkte api_response = api_instance.i_osv3_startlist_table_xml_get(view) pprint(api_response) except bundesrat.ApiException as e: print("Exception when calling DefaultApi->i_osv3_startlist_table_xml_get: %s\n" % e) ``` -------------------------------- ### Get Aktuelles Data (XML) Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/docs/DefaultApi.md Retrieves current events data in XML format from the Bundesrat API. Ensure the 'deutschland' library is installed and configured. ```python import time from deutschland import bundesrat from deutschland.bundesrat.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www.bundesrat.de # See configuration.py for a list of all supported configuration parameters. configuration = bundesrat.Configuration( host = "https://www.bundesrat.de" ) # Enter a context with an instance of the API client with bundesrat.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) view = "renderXml" # str | Xml Ausabe # example passing only required values which don't have defaults set try: # Aktuelles api_response = api_instance.i_osv301_aktuelles_aktuelles_table_xml_get(view) pprint(api_response) except bundesrat.ApiException as e: print("Exception when calling DefaultApi->i_osv301_aktuelles_aktuelles_table_xml_get: %s\n" % e) ``` -------------------------------- ### Initialize Bundestag API Client and Fetch Article Details Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundestag/README.md Demonstrates how to initialize the API client, set the host, and fetch details for a specific news article using its ID. Includes error handling for API exceptions. ```python import time from deutschland import bundestag from pprint import pprint from deutschland.bundestag.api import default_api # Defining the host is optional and defaults to https://www.bundestag.de # See configuration.py for a list of all supported configuration parameters. configuration = bundestag.Configuration( host = "https://www.bundestag.de" ) # Enter a context with an instance of the API client with bundestag.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) article_id = 849630 # int | ID des Nachrichtenbeitrags try: # Artikel Details api_response = api_instance.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get(article_id) pprint(api_response) except bundestag.ApiException as e: print("Exception when calling DefaultApi->blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get: %s\n" % e) ``` -------------------------------- ### Python: Fetch Cubefile Data with DefaultApi Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Demonstrates how to instantiate the DefaultApi client and call the cubefile method. It shows how to pass both required and optional parameters, including authentication credentials and various data filtering options. Includes error handling for API exceptions. ```python with destatis.ApiClient() as api_client: api_instance = default_api.DefaultApi(api_client) username = "GAST" password = "GAST" name = "name_example" area = "free" values = "true" metadata = "false" additionals = "false" contents = "contents_example" startyear = "startyear_example" endyear = "endyear_example" timeslices = "timeslices_example" regionalvariable = "regionalvariable_example" regionalkey = "regionalkey_example" classifyingvariable1 = "classifyingvariable1_example" classifyingkey1 = "classifyingkey1_example" classifyingvariable2 = "classifyingvariable2_example" classifyingkey2 = "classifyingkey2_example" classifyingvariable3 = "classifyingvariable3_example" classifyingkey3 = "classifyingkey3_example" format = "csv" stand = "01.01.1970 01:00" language = "de" try: api_instance.cubefile(username=username, password=password, name=name, area=area, values=values, metadata=metadata, additionals=additionals, contents=contents, startyear=startyear, endyear=endyear, timeslices=timeslices, regionalvariable=regionalvariable, regionalkey=regionalkey, classifyingvariable1=classifyingvariable1, classifyingkey1=classifyingkey1, classifyingvariable2=classifyingvariable2, classifyingkey2=classifyingkey2, classifyingvariable3=classifyingvariable3, classifyingkey3=classifyingkey3, format=format, stand=stand, language=language) except destatis.ApiException as e: print("Exception when calling DefaultApi->cubefile: %s\n" % e) ``` -------------------------------- ### Get Red Notices with DefaultApi Source: https://github.com/bundesapi/deutschland/blob/main/docs/interpol/docs/DefaultApi.md Fetches a list of Red Notices using various optional query parameters. Ensure the 'interpol' library is installed and configured. ```python import time from deutschland import interpol from deutschland.interpol.api import default_api from deutschland.interpol.model.red_notices import RedNotices from pprint import pprint # Defining the host is optional and defaults to https://ws-public.interpol.int # See configuration.py for a list of all supported configuration parameters. configuration = interpol.Configuration( host = "https://ws-public.interpol.int" ) # Enter a context with an instance of the API client with interpol.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) forename = "DANIELA" # str | First name (optional) name = "Klette" # str | Last name (optional) nationality = "DE" # str | Two digit country code (optional) age_max = 120 # int | maximum age (optional) age_min = 18 # int | minimum age (optional) free_text = "" # str | Free text query (optional) sex_id = "F" # str | Free text query (optional) arrest_warrant_country_id = "DE" # str | Two digit country code (optional) page = 1 # int | pagination - starts with 1 (optional) result_per_page = 200 # int | resultPerPage (optional) # example passing only required values which don't have defaults set # and optional values try: # Get Red Notices api_response = api_instance.notices_v1_red_get(forename=forename, name=name, nationality=nationality, age_max=age_max, age_min=age_min, free_text=free_text, sex_id=sex_id, arrest_warrant_country_id=arrest_warrant_country_id, page=page, result_per_page=result_per_page) pprint(api_response) except interpol.ApiException as e: print("Exception when calling DefaultApi->notices_v1_red_get: %s\n" % e) ``` -------------------------------- ### Initialize and Use DefaultApi Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Demonstrates how to initialize the API client and create an instance of the DefaultApi class. It shows how to pass various optional parameters to the map2timeseries method and includes basic error handling. ```python with destatis.ApiClient() as api_client: api_instance = default_api.DefaultApi(api_client) username = "GAST" password = "GAST" name = "name_example" area = "free" maptype = "0" classes = "5" classification = "0" zoom = "2" contents = "contents_example" startyear = "startyear_example" endyear = "endyear_example" timeslices = "timeslices_example" regionalvariable = "regionalvariable_example" regionalkey = "regionalkey_example" classifyingvariable1 = "classifyingvariable1_example" classifyingkey1 = "classifyingkey1_example" classifyingvariable2 = "classifyingvariable2_example" classifyingkey2 = "classifyingkey2_example" classifyingvariable3 = "classifyingvariable3_example" classifyingkey3 = "classifyingkey3_example" format = "png" stand = "01.01.1970 01:00" language = "de" try: api_instance.map2timeseries(username=username, password=password, name=name, area=area, maptype=maptype, classes=classes, classification=classification, zoom=zoom, contents=contents, startyear=startyear, endyear=endyear, timeslices=timeslices, regionalvariable=regionalvariable, regionalkey=regionalkey, classifyingvariable1=classifyingvariable1, classifyingkey1=classifyingkey1, classifyingvariable2=classifyingvariable2, classifyingkey2=classifyingkey2, classifyingvariable3=classifyingvariable3, classifyingkey3=classifyingkey3, format=format, stand=stand, language=language) except destatis.ApiException as e: print("Exception when calling DefaultApi->map2timeseries: %s\n" % e) ``` -------------------------------- ### Get Biwapp Map Data - Python Source: https://github.com/bundesapi/deutschland/blob/main/docs/nina/docs/DefaultApi.md Retrieves Biwapp alert data for map display. This endpoint requires no parameters. Ensure the 'deutschland' library is installed and configured. ```python import time from deutschland import nina from deutschland.nina.api import default_api from deutschland.nina.model.map_warnings import MapWarnings from pprint import pprint # Defining the host is optional and defaults to https://warnung.bund.de/api31 # See configuration.py for a list of all supported configuration parameters. configuration = nina.Configuration( host = "https://warnung.bund.de/api31" ) # Enter a context with an instance of the API client with nina.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) # example, this endpoint has no required or optional parameters try: # Biwapp Meldungen api_response = api_instance.biwapp_map_data_json_get() pprint(api_response) except nina.ApiException as e: print("Exception when calling DefaultApi->biwapp_map_data_json_get: %s\n" % e) ``` -------------------------------- ### Destatis API Client Initialization and Chart Retrieval Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/README.md Example demonstrating how to initialize the Destatis API client and call the `chart2result` method. It shows how to configure the API host and set various parameters for chart retrieval. Handles potential API exceptions. ```python import time from deutschland import destatis from pprint import pprint from deutschland.destatis.api import default_api # Defining the host is optional and defaults to https://www-genesis.destatis.de/genesisWS/rest/2020 # See configuration.py for a list of all supported configuration parameters. configuration = destatis.Configuration( host = "https://www-genesis.destatis.de/genesisWS/rest/2020" ) # Enter a context with an instance of the API client with destatis.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) username = "GAST" # str | (optional) (default to "GAST") password = "GAST" # str | (optional) (default to "GAST") name = "name_example" # str | (optional) area = "free" # str | (optional) (default to "free") charttype = "0" # str | (optional) (default to "0") drawpoints = "false" # str | (optional) (default to "false") zoom = "2" # str | (optional) (default to "2") focus = "false" # str | (optional) (default to "false") tops = "false" # str | (optional) (default to "false") format = "png" # str | (optional) (default to "png") language = "de" # str | (optional) (default to "de") try: api_instance.chart2result(username=username, password=password, name=name, area=area, charttype=charttype, drawpoints=drawpoints, zoom=zoom, focus=focus, tops=tops, format=format, language=language) except destatis.ApiException as e: print("Exception when calling DefaultApi->chart2result: %s\n" % e) ``` -------------------------------- ### Python Login Check Example Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Demonstrates how to perform a login check using the Destatis API. Ensure the configuration host is set correctly. Handles potential API exceptions. ```python import time from deutschland import destatis from deutschland.destatis.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www-genesis.destatis.de/genesisWS/rest/2020 # See configuration.py for a list of all supported configuration parameters. configuration = destatis.Configuration( host = "https://www-genesis.destatis.de/genesisWS/rest/2020" ) # Enter a context with an instance of the API client with destatis.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) username = "username_example" # str | (optional) password = "password_example" # str | (optional) language = "de" # str | (optional) if omitted the server will use the default value of "de" # example passing only required values which don't have defaults set # and optional values try: api_instance.logincheck(username=username, password=password, language=language) except destatis.ApiException as e: print("Exception when calling DefaultApi->logincheck: %s\n" % e) ``` -------------------------------- ### Get Red Notice Images Source: https://github.com/bundesapi/deutschland/blob/main/docs/interpol/docs/DefaultApi.md Use this method to retrieve images associated with a specific Red Notice. Ensure the 'interpol' library is installed and configured. The notice_id is a required parameter. ```python import time from deutschland import interpol from deutschland.interpol.api import default_api from deutschland.interpol.model.red_notice_detail_images import RedNoticeDetailImages from pprint import pprint # Defining the host is optional and defaults to https://ws-public.interpol.int # See configuration.py for a list of all supported configuration parameters. configuration = interpol.Configuration( host = "https://ws-public.interpol.int" ) # Enter a context with an instance of the API client with interpol.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) notice_id = "1993-27493" # str | Notice ID # example passing only required values which don't have defaults set try: # Get Red Notice Images api_response = api_instance.notices_v1_red_notice_id_images_get(notice_id) pprint(api_response) except interpol.ApiException as e: print("Exception when calling DefaultApi->notices_v1_red_notice_id_images_get: %s\n" % e) ``` -------------------------------- ### Get Plenum Kompakt Data (XML) Source: https://github.com/bundesapi/deutschland/blob/main/docs/bundesrat/docs/DefaultApi.md Retrieves compact plenary session data in XML format from the Bundesrat API. Ensure the 'deutschland' library is installed and the API client is initialized. ```python import time from deutschland import bundesrat from deutschland.bundesrat.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www.bundesrat.de # See configuration.py for a list of all supported configuration parameters. configuration = bundesrat.Configuration( host = "https://www.bundesrat.de" ) # Enter a context with an instance of the API client with bundesrat.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) view = "renderXml" # str | Xml Ausabe # example passing only required values which don't have defaults set try: # Plenum Kompakt api_response = api_instance.i_osv303_plenum_plenum_kompakt_table_xml_get(view) pprint(api_response) except bundesrat.ApiException as e: print("Exception when calling DefaultApi->i_osv303_plenum_plenum_kompakt_table_xml_get: %s\n" % e) ``` -------------------------------- ### Fetch Table Data with Default Parameters Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Demonstrates how to fetch table data using the `tablefile` method. It shows how to initialize the API client and the DefaultApi instance, and how to call the `tablefile` method with various optional parameters. Includes error handling for API exceptions. ```python with destatis.ApiClient() as api_client: api_instance = default_api.DefaultApi(api_client) username = "GAST" password = "GAST" name = "name_example" area = "free" compress = "false" transpose = "false" startyear = "startyear_example" endyear = "endyear_example" timeslices = "timeslices_example" regionalvariable = "regionalvariable_example" regionalkey = "regionalkey_example" classifyingvariable1 = "classifyingvariable1_example" classifyingkey1 = "classifyingkey1_example" classifyingvariable2 = "classifyingvariable2_example" classifyingkey2 = "classifyingkey2_example" classifyingvariable3 = "classifyingvariable3_example" classifyingkey3 = "classifyingkey3_example" format = "csv" job = "false" stand = "01.01.1970 01:00" language = "de" try: api_instance.tablefile(username=username, password=password, name=name, area=area, compress=compress, transpose=transpose, startyear=startyear, endyear=endyear, timeslices=timeslices, regionalvariable=regionalvariable, regionalkey=regionalkey, classifyingvariable1=classifyingvariable1, classifyingkey1=classifyingkey1, classifyingvariable2=classifyingvariable2, classifyingkey2=classifyingkey2, classifyingvariable3=classifyingvariable3, classifyingkey3=classifyingkey3, format=format, job=job, stand=stand, language=language) except destatis.ApiException as e: print("Exception when calling DefaultApi->tablefile: %s\n" % e) ``` -------------------------------- ### Configure and Use Job Search API Source: https://github.com/bundesapi/deutschland/blob/main/docs/jobsuche/docs/DefaultApi.md Demonstrates how to configure the API client with an access token and make a job search request using various optional parameters. Handles potential API exceptions. ```python import jobsuche from jobsuche import DefaultApi from pprint import pprint # Configure OAuth2 access token for authorization: clientCredAuth configuration = jobsuche.Configuration( host = "https://api-con.arbeitsagentur.de/prod/jobboerse/jobsuche-service" ) configuration.access_token = 'YOUR_ACCESS_TOKEN' # Enter a context with an instance of the API client with jobsuche.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = DefaultApi(api_client) was = "Referatsleiter" # str | Freitext suche Jobtitel (optional) wo = "Berlin" # str | Freitext suche Beschäftigungsort (optional) page = 1 # int | Ergebnissseite (optional) size = 50 # int | Anzahl von Ergebnissen (optional) arbeitgeber = "Deutsche%20Bahn%20AG_W4qFQypjw_IWOJAkn2NMSE-Yf-mRbt_6_PvZr0FLdX4%3D" # str | Arbeitgeber der Stelle (optional) fct_aktualitaet = 30 # int | Anzahl der Tage, seit der Job veröffentlicht wurde. Kann zwischen 0 und 100 Tagen liegen. (optional) fct_arbeitsvermittlung = "MIT_AV" # str | Gibt an, ob Jobs von externen Arbeitsvermittlungen in die Suchergebnisse einbezogen werden sollen. (optional) fct_angebotsart = "ARBEIT" # str | (optional) fct_befristung = "UNBEFRISTET" # str | Kann mehrere Werte haben z.B. FCT.BEFRISTUNG=UNBEFRISTET&FCT.BEFRISTUNG=KEINE_ANGABE. (optional) fct_arbeitszeitmodell = "VOLLZEIT" # str | Kann mehrere Werte haben z.B. FCT.ARBEITSZEITMODELL=HEIM_TELEARBEIT&FCT.ARBEITSZEITMODELL=MINIJOB (optional) fct_behinderung = "AN" # str | (optional) fct_aktion = "AN" # str | Wenn AN, werden nur Jobs die im Kontext von Corona angeboten werden angezeigt. (optional) if omitted the server will use the default value of "AN" fct_umkreis = 25 # int | Umkreis in Kilometern von Wo-Parameter. (z.B. 25 oder 200) (optional) # example passing only required values which don't have defaults set # and optional values try: # Jobsuche api_response = api_instance.pc_v2_app_jobs_get(was=was, wo=wo, page=page, size=size, arbeitgeber=arbeitgeber, fct_aktualitaet=fct_aktualitaet, fct_arbeitsvermittlung=fct_arbeitsvermittlung, fct_angebotsart=fct_angebotsart, fct_befristung=fct_befristung, fct_arbeitszeitmodell=fct_arbeitszeitmodell, fct_behinderung=fct_behinderung, fct_aktion=fct_aktion, fct_umkreis=fct_umkreis) pprint(api_response) except jobsuche.ApiException as e: print("Exception when calling DefaultApi->pc_v2_app_jobs_get: %s\n" % e) ``` -------------------------------- ### Initialize Destatis API Client Source: https://github.com/bundesapi/deutschland/blob/main/docs/destatis/docs/DefaultApi.md Demonstrates how to initialize the Destatis API client with a custom host configuration. This is useful for specifying a different API endpoint if needed. ```python import time from deutschland import destatis from deutschland.destatis.api import default_api from pprint import pprint # Defining the host is optional and defaults to https://www-genesis.destatis.de/genesisWS/rest/2020 # See configuration.py for a list of all supported configuration parameters. configuration = destatis.Configuration( host = "https://www-genesis.destatis.de/genesisWS/rest/2020" ) ``` -------------------------------- ### Get Corona Rules by AGS - Python Source: https://github.com/bundesapi/deutschland/blob/main/docs/nina/docs/DefaultApi.md Fetches Corona regulations for a specific administrative region (AGS). Requires the 'ags' parameter, which is a string representing the official administrative key. Ensure the 'deutschland' library is installed and configured. ```python import time from deutschland import nina from deutschland.nina.api import default_api from deutschland.nina.model.ags_covid_rules import AGSCovidRules from pprint import pprint # Defining the host is optional and defaults to https://warnung.bund.de/api31 # See configuration.py for a list of all supported configuration parameters. configuration = nina.Configuration( host = "https://warnung.bund.de/api31" ) # Enter a context with an instance of the API client with nina.ApiClient() as api_client: # Create an instance of the API class api_instance = default_api.DefaultApi(api_client) ags = "091620000000" # str | Amtlicher Gebietsschlüssel - kann z.B. von [hier](https://www.xrepository.de/api/xrepository/urn:de:bund:destatis:bevoelkerungsstatistik:schluessel:rs_2021-07-31/download/Regionalschl_ssel_2021-07-31.json) bezogen werden. # example passing only required values which don't have defaults set try: # Corona Regelungen nach AGS api_response = api_instance.appdata_covid_covidrules_deags_json_get(ags) pprint(api_response) except nina.ApiException as e: print("Exception when calling DefaultApi->appdata_covid_covidrules_deags_json_get: %s\n" % e) ```