<jupyter_start><jupyter_text>DMI  InstallationRun the following cell to install osiris-sdk.<jupyter_code>!pip install osiris-sdk --upgrade<jupyter_output><empty_output><jupyter_text>Access to datasetThere are two ways to get access to a dataset1. Service Principle2. Access Token Config file with Service PrincipleIf done with **Service Principle** it is adviced to add the following file with **tenant_id**, **client_id**, and **client_secret**:The structure of **conf.ini**:```[Authorization]tenant_id = client_id = client_secret = [Egress]url = ``` Config file if using Access TokenIf done with **Access Token** then assign it to a variable (see example below).The structure of **conf.ini**:```[Egress]url = ```The egress-url can be [found here](https://github.com/Open-Dataplatform/examples/blob/main/README.md).  ImportsExecute the following cell to import the necessary libraries<jupyter_code>import pandas as pd
from io import BytesIO
from osiris.apis.egress import Egress
from osiris.core.azure_client_authorization import ClientAuthorization
from configparser import ConfigParser<jupyter_output><empty_output><jupyter_text>Initialize Egress with Service Principle<jupyter_code>config = ConfigParser()
config.read('conf.ini')

client_auth = ClientAuthorization(tenant_id=config['Authorization']['tenant_id'],
                                  client_id=config['Authorization']['client_id'],
                                  client_secret=config['Authorization']['client_secret'])

egress = Egress(client_auth=client_auth,
                egress_url=config['Egress']['url'])<jupyter_output><empty_output><jupyter_text>Intialize Egress with Access Token<jupyter_code>config = ConfigParser()
config.read('conf.ini')

access_token = 'REPLACE WITH ACCESS TOKEN HERE'

client_auth = ClientAuthorization(access_token=access_token)

egress = Egress(client_auth=client_auth,
                egress_url=config['Egress']['url'])<jupyter_output><empty_output><jupyter_text>List all DMI stations for a given monthTo list all the available stations for a given month run the following code.Feel free to change the month using the format: YYYY-MM<jupyter_code># We restrict to only list the first 10 stations
egress.download_dmi_list(from_date='2021-01')[:10]<jupyter_output><empty_output><jupyter_text>Download DMI data for a given station and time periodTo download the data for a given station (lon, lat) for a time period (from_date, to_date) execute the following cell.You can find the available values of **lon** and **lat** from the previous call.The **from_date** and **to_date** syntax is [described here](https://github.com/Open-Dataplatform/examples/blob/main/README.md).<jupyter_code>parquet_content = egress.download_dmi_file(lon=15.19, 
                                           lat=55.00, 
                                           from_date='2021-01', 
                                           to_date='2021-03')

data = pd.read_parquet(BytesIO(parquet_content))

data.head()
data.dtypes<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10161662817551963, 'fraction_numerical': 0.010557571758495546, 'mean_word_length': 4.553113553113553, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '333226', 'license': 'MIT', 'n_tokens_mistral': 902, 'n_tokens_neox': 874, 'n_words': 235, 'path': 'dmi/Example - DMI.ipynb', 'repo_name': 'Open-Dataplatform/examples', 'size': '3031'}