{ "cells": [ { "cell_type": "markdown", "id": "2f80383f", "metadata": {}, "source": [ "# Oldest timestamp example\n", "\n", "This notebook shows how to retrieve the oldest available timestamp for one or more locations.\n", "\n", "API-24SEA endpoint: [https://api.24sea.eu/routes/v1/datasignals/oldest_timestamp](https://api.24sea.eu/docs/v1/#/operations/datasignals_metrics_oldest_timestamp)\n" ] }, { "cell_type": "code", "execution_count": 10, "id": "08d7bbbb", "metadata": {}, "outputs": [], "source": [ "# **Package Imports**\n", "# - From the Python Standard Library\n", "import logging\n", "import os\n", "import sys\n", "\n", "# - API-24SEA\n", "from api_24sea.version import __version__, parse_version\n", "from api_24sea.datasignals.core import API, AsyncAPI\n" ] }, { "cell_type": "code", "execution_count": 11, "id": "29c30e70", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Package Version(major=2, minor=1, patch=6, release=None, num=None)\n" ] } ], "source": [ "# **Package Version**\n", "print(f\"Package {parse_version(__version__)}\")\n", "\n", "# **Notebook Configuration**\n", "logger = logging.getLogger()\n", "logger.setLevel(logging.WARNING)\n" ] }, { "cell_type": "markdown", "id": "4efc9f22", "metadata": {}, "source": [ "
Do not store API credentials in plain text in your notebook. Rather use the python-dotenv package to load environment variables from a .env file.
\n", "| \n", " | site | \n", "location | \n", "oldest_timestamp | \n", "
|---|---|---|---|
| 0 | \n", "windfarm | \n", "wfa01 | \n", "2020-03-01T00:00:00+00:00 | \n", "
| 1 | \n", "windfarm | \n", "wfa02 | \n", "2020-03-01T00:00:00+00:00 | \n", "
| \n", " | site | \n", "location | \n", "oldest_timestamp | \n", "
|---|---|---|---|
| 0 | \n", "windfarm | \n", "wfa01 | \n", "2020-03-01T00:00:00+00:00 | \n", "
| 1 | \n", "windfarm | \n", "wfa02 | \n", "2020-03-01T00:00:00+00:00 | \n", "