{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", " PATSTAT Explorer\n", "
\n", "
\n", " Patent analysis & visualization on EPO PATSTAT\n", "
\n", "
\n", " mtc.berlin\n", "  ·  EPO Technology & Innovation Programme\n", "
\n", "
\n", "
\n", " Search and analyse patent data from the EPO PATSTAT database —\n", " applicant trends, co-filing networks, citation flows,\n", " technology classifications, and full-text search.\n", "

\n", " Includes an AI Query Interface powered by the\n", " mtc.berlin PATSTAT MCP\n", " server — ask questions in natural language and let Claude\n", " explore the schema and build SQL for you.\n", "
\n", "
\n", "
\n", "
▶  Run the cell below to start
\n", "
\n", " First launch downloads & installs everything (~1–2 min).
\n", " Subsequent starts are fast (~10 s).\n", "
\n", "
\n", "
\n", " To stop: run stop() in a new cell or restart the kernel.\n", "
\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "import subprocess, os, sys\n", "from pathlib import Path\n", "from IPython.display import display, HTML, clear_output\n", "\n", "REPO_URL = \"https://github.com/mtcberlin/epo-tip-svelte-patstat-explorer.git\"\n", "APP_DIR = Path.home() / \"patstat_svelte\"\n", "\n", "def _status(msg):\n", " clear_output(wait=True)\n", " display(HTML(f\"\"\"\n", "
\n", "
⏳ {msg}
\n", "
\"\"\"))\n", "\n", "if (APP_DIR / \".git\").is_dir():\n", " _status(\"Updating PATSTAT Explorer...\")\n", " subprocess.run([\"git\", \"-C\", str(APP_DIR), \"pull\", \"--ff-only\"],\n", " capture_output=True, text=True)\n", "else:\n", " _status(\"Downloading PATSTAT Explorer (first run)...\")\n", " subprocess.run([\"git\", \"clone\", REPO_URL, str(APP_DIR)],\n", " capture_output=True, text=True, check=True)\n", "\n", "os.chdir(str(APP_DIR))\n", "\n", "# launch.py uses __file__ to find PROJECT_DIR — provide it for exec()\n", "launch_path = str(APP_DIR / \"launch.py\")\n", "exec(compile(open(launch_path).read(), launch_path, \"exec\"), {**globals(), \"__file__\": launch_path})" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3.12.0" } }, "nbformat": 4, "nbformat_minor": 4 }