diff --git a/_sources/book/cooltools/Chapter.ipynb b/_sources/book/cooltools/Chapter.ipynb index f137757..feec4ec 100644 --- a/_sources/book/cooltools/Chapter.ipynb +++ b/_sources/book/cooltools/Chapter.ipynb @@ -1611,6 +1611,60 @@ "\n", "print(config[\"DOMAIN\"])" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Work with Notion via Python with" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Did you know you can interact with Notion via Python?\n", + "\n", + "`notion-client` is a Python SDK for working with the Notion API.\n", + "\n", + "You can create databases, search for items, interact with pages, etc.\n", + "\n", + "Check the example below." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!pip install notion-client" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from notion_client import Client\n", + "\n", + "notion = Client(\"\")\n", + "\n", + "print(notion.users.list())\n", + "\n", + "my_page = notion.databases.query(\n", + " **{\n", + " \"database_id\": \"897e5a76-ae52-4b48-9fdf-e71f5945d1af\",\n", + " \"filter\": {\n", + " \"property\": \"Landmark\",\n", + " \"rich_text\": {\n", + " \"contains\": \"Bridge\",\n", + " },\n", + " },\n", + " }\n", + " )" + ] } ], "metadata": { diff --git a/_sources/book/machinelearning/timeseries.ipynb b/_sources/book/machinelearning/timeseries.ipynb index 5902bba..ec94296 100644 --- a/_sources/book/machinelearning/timeseries.ipynb +++ b/_sources/book/machinelearning/timeseries.ipynb @@ -203,6 +203,55 @@ "mlf.fit(df)\n", "mlf.predict(12)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Lightning Fast Time Series Forecasting with `statsforecast`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Do you want to perform lightning fast time series forecasting?\n", + "\n", + "Try `statsforecast` by Nixtla.\n", + "\n", + "`statsforecast` lets you run statistical models on your time series data.\n", + "\n", + "It’s up to 20x faster than existing libraries like pmdarima and statsmodels." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!pip install statsforecast" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from statsforecast import StatsForecast\n", + "from statsforecast.models import AutoARIMA\n", + "from statsforecast.utils import AirPassengersDF\n", + "\n", + "df = AirPassengersDF\n", + "sf = StatsForecast(\n", + " models = [AutoARIMA(season_length = 12)],\n", + " freq = 'M'\n", + ")\n", + "\n", + "sf.fit(df)\n", + "sf.predict(h=12, level=[95])" + ] } ], "metadata": { diff --git a/book/cooltools/Chapter.html b/book/cooltools/Chapter.html index aeda34e..c196bb8 100644 --- a/book/cooltools/Chapter.html +++ b/book/cooltools/Chapter.html @@ -440,6 +440,7 @@

Contents

  • 2.1.31. Calculate Code Metrics with radon
  • 2.1.32. Better Alternative to requests
  • 2.1.33. Managing Configurations with python-dotenv
  • +
  • 2.1.34. Work with Notion via Python with
  • @@ -1416,6 +1417,43 @@

    2.1.33. Managing Configurations with +
    +

    2.1.34. Work with Notion via Python with#

    +

    Did you know you can interact with Notion via Python?

    +

    notion-client is a Python SDK for working with the Notion API.

    +

    You can create databases, search for items, interact with pages, etc.

    +

    Check the example below.

    +
    +
    +
    !pip install notion-client
    +
    +
    +
    +
    +
    +
    +
    from notion_client import Client
    +
    +notion = Client("<NOTION_TOKEN>")
    +
    +print(notion.users.list())
    +
    +my_page = notion.databases.query(
    +        **{
    +            "database_id": "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
    +            "filter": {
    +                "property": "Landmark",
    +                "rich_text": {
    +                    "contains": "Bridge",
    +                },
    +            },
    +        }
    +    )
    +
    +
    +
    +
    +