{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from seeq import spy\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;text-align: left;\">Logged in to <strong>http://localhost:34216/api</strong> successfully as <strong>agent_api_key</strong>.<br>Seeq Server Version: <strong>R21.0.44.04</strong><br>Seeq Python Module Version: <strong>0.44.4.136</strong></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Log into Seeq Server if you're not using Seeq Data Lab:\n",
    "spy.login(url='http://localhost:34216', credentials_file='../credentials.key', force=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# spy.search\n",
    "\n",
    "Finds signals (tags), conditions (with capsules), scalars (constants), assets or any other type of item that Seeq indexes or keeps track of.\n",
    "\n",
    "You will generally use this command before executing `spy.pull()`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`spy.search(query, all_properties=False, workbook='Data Lab >> Data Lab Analysis')`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Query Syntax\n",
    "\n",
    "The `query` parameter is a dictionary of _property_: _filter_ values that are applied using AND logic by Seeq Server. Let's use the following examples to illustrate the important parts:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;text-align: left;\">Query successful</div><table><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE;\">Name</td><td style=\"background-color: #EEFFEE;\">Path</td><td style=\"background-color: #EEFFEE;\">Time</td><td style=\"background-color: #EEFFEE;\">Count</td></tr><tr style=\"background-color: #EEFFEE;\"><td>0</td><td>Humid</td><td>Example >> Cooling Tower 1</td><td>00:00:00.07</td><td>8</td></tr></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>Path</th>\n",
       "      <th>Asset</th>\n",
       "      <th>Name</th>\n",
       "      <th>Description</th>\n",
       "      <th>Type</th>\n",
       "      <th>Value Unit Of Measure</th>\n",
       "      <th>Datasource Name</th>\n",
       "      <th>Archived</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>883691F8-360C-43D0-8AF2-32334FCAA604</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area A</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1FC0F814-16FE-41B6-89A9-1038D447A17B</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area B</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B0342E66-8E29-409A-A768-004D4C5E40DA</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area C</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>A46F700C-A8D2-4EB9-99B8-1AEDB8CB4C07</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area K</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>A09B01E9-4E54-45EC-8475-5A8EED783C92</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area G</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>B2A0EF69-86D7-4654-8AD8-8BDAFE9FBA6E</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area H</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4EA3ED33-3747-49EA-A15B-AA997891873F</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area I</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0C2BF2CD-B7CE-43B3-8AFE-A87E1C9BBBE3</td>\n",
       "      <td>Example &gt;&gt; Cooling Tower 1</td>\n",
       "      <td>Area J</td>\n",
       "      <td>Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     ID                        Path   Asset  \\\n",
       "0  883691F8-360C-43D0-8AF2-32334FCAA604  Example >> Cooling Tower 1  Area A   \n",
       "1  1FC0F814-16FE-41B6-89A9-1038D447A17B  Example >> Cooling Tower 1  Area B   \n",
       "2  B0342E66-8E29-409A-A768-004D4C5E40DA  Example >> Cooling Tower 1  Area C   \n",
       "3  A46F700C-A8D2-4EB9-99B8-1AEDB8CB4C07  Example >> Cooling Tower 1  Area K   \n",
       "4  A09B01E9-4E54-45EC-8475-5A8EED783C92  Example >> Cooling Tower 1  Area G   \n",
       "5  B2A0EF69-86D7-4654-8AD8-8BDAFE9FBA6E  Example >> Cooling Tower 1  Area H   \n",
       "6  4EA3ED33-3747-49EA-A15B-AA997891873F  Example >> Cooling Tower 1  Area I   \n",
       "7  0C2BF2CD-B7CE-43B3-8AFE-A87E1C9BBBE3  Example >> Cooling Tower 1  Area J   \n",
       "\n",
       "                Name  Description          Type Value Unit Of Measure  \\\n",
       "0  Relative Humidity          NaN  StoredSignal                     %   \n",
       "1  Relative Humidity          NaN  StoredSignal                     %   \n",
       "2  Relative Humidity          NaN  StoredSignal                     %   \n",
       "3  Relative Humidity          NaN  StoredSignal                     %   \n",
       "4  Relative Humidity          NaN  StoredSignal                     %   \n",
       "5  Relative Humidity          NaN  StoredSignal                     %   \n",
       "6  Relative Humidity          NaN  StoredSignal                     %   \n",
       "7  Relative Humidity          NaN  StoredSignal                     %   \n",
       "\n",
       "  Datasource Name  Archived  \n",
       "0    Example Data     False  \n",
       "1    Example Data     False  \n",
       "2    Example Data     False  \n",
       "3    Example Data     False  \n",
       "4    Example Data     False  \n",
       "5    Example Data     False  \n",
       "6    Example Data     False  \n",
       "7    Example Data     False  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "spy.search({\n",
    "    'Name': 'Humid',\n",
    "    'Path': 'Example >> Cooling Tower 1'\n",
    "})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This query returns anything with `Humid` in its `Name` property that also lives somewhere under `Example >> Cooling Tower 1` in an asset tree.\n",
    "\n",
    "There are several capabilities and some constraints associated with querying:\n",
    "\n",
    "1. The `Name` and `Description` properties are queried upon with the same wildcard and RegEx support as the Data tab in Seeq Workbench: https://seeq12.atlassian.net/wiki/spaces/KB/pages/146472969/Searching+for+Items\n",
    "\n",
    "2. The `Path` property is a _virtual_ property that specifies the path through an asset tree from its root, with `>>` as delimiters for each level in the asset tree.\n",
    "\n",
    "3. The returned `Asset` property is just the leaf asset node in the tree. It can only be used in tandem with the `Path` property.\n",
    "\n",
    "4. For the `Type` property, you can specify just `Signal`, `Condition` or `Scalar` if you want to return both _stored_ and _calculated_ items.\n",
    "\n",
    "5. You can specify `Datasource Name` _or_ you can specify both `Datasource ID` and `Datasource Class` to differentiate between datasources with the same name.\n",
    "\n",
    "6. You can filter on `Data ID`, which is a unique identifier that is generally the same across instances of Seeq Server.\n",
    "\n",
    "7. You can filter on `Archived` and `Cache Enabled` using either `True` or `False` Python boolean values.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Retrieving all properties\n",
    "\n",
    "`spy.search()` only returns a subset of item properties as can be seen in the output above. If you want to retrieve all properties, use `all_properties=True`. Note that this can be an expensive (slow) operation for queries that return many rows."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;text-align: left;\">Query successful</div><table><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE;\">Datasource Name</td><td style=\"background-color: #EEFFEE;\">Name</td><td style=\"background-color: #EEFFEE;\">Time</td><td style=\"background-color: #EEFFEE;\">Count</td></tr><tr style=\"background-color: #EEFFEE;\"><td>0</td><td>Example Data</td><td>Area A_*Humid*</td><td>00:00:00.05</td><td>1</td></tr></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>Name</th>\n",
       "      <th>Description</th>\n",
       "      <th>Type</th>\n",
       "      <th>Value Unit Of Measure</th>\n",
       "      <th>Datasource Name</th>\n",
       "      <th>Archived</th>\n",
       "      <th>Cache Enabled</th>\n",
       "      <th>Data ID</th>\n",
       "      <th>Datasource Class</th>\n",
       "      <th>Datasource ID</th>\n",
       "      <th>Interpolation Method</th>\n",
       "      <th>Key Unit Of Measure</th>\n",
       "      <th>Maximum Interpolation</th>\n",
       "      <th>Source Maximum Interpolation</th>\n",
       "      <th>Source Value Unit Of Measure</th>\n",
       "      <th>Sync Token</th>\n",
       "      <th>Scoped To</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>DAD60F7A-4214-4D82-9C70-4AA55B1AAE9C</td>\n",
       "      <td>Area A_Relative Humidity</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>%</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>[Tag] Area A_Relative Humidity.sim.ts.csv</td>\n",
       "      <td>Time Series CSV Files</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>Linear</td>\n",
       "      <td>ns</td>\n",
       "      <td>2min</td>\n",
       "      <td>2min</td>\n",
       "      <td>%</td>\n",
       "      <td>2020-02-19T23:16:23.906263800Z</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     ID                      Name  \\\n",
       "0  DAD60F7A-4214-4D82-9C70-4AA55B1AAE9C  Area A_Relative Humidity   \n",
       "\n",
       "   Description          Type Value Unit Of Measure Datasource Name  Archived  \\\n",
       "0          NaN  StoredSignal                     %    Example Data     False   \n",
       "\n",
       "   Cache Enabled                                    Data ID  \\\n",
       "0           True  [Tag] Area A_Relative Humidity.sim.ts.csv   \n",
       "\n",
       "        Datasource Class Datasource ID Interpolation Method  \\\n",
       "0  Time Series CSV Files  Example Data               Linear   \n",
       "\n",
       "  Key Unit Of Measure Maximum Interpolation Source Maximum Interpolation  \\\n",
       "0                  ns                  2min                         2min   \n",
       "\n",
       "  Source Value Unit Of Measure                      Sync Token  Scoped To  \n",
       "0                            %  2020-02-19T23:16:23.906263800Z        NaN  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "spy.search({\n",
    "    'Name': 'Area A_*Humid*',\n",
    "    'Datasource Name': 'Example Data'\n",
    "}, all_properties=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Workbook scoping\n",
    "\n",
    "The `workbook=<workbook_path>` parameter allows you to include items in your results that are scoped to a particular workbook. If you exclude the argument, then by default your search results will include both globally-scoped items and workbook-scoped items from the **Data Lab >> Data Lab Analysis** workbook (folder path delimiter by `>>`, workbook name at the end). This workbook generally will only exist if you have previous called `spy.push()`. This default behavior forces your `spy.push()` and subsequent `spy.search()` activities to be _sandboxed_, meaning that they will only be visible to you within a particular workbook.\n",
    "\n",
    "If you want to only return globally-scoped items, specify `workbook=None` as the argument.\n",
    "\n",
    "Another option is to specify `Scoped To` within your query block. You must supply a Workbook ID -- not a workbook path like the `workbook` parameter. This approach will limit your search to just those items scoped to a particular workbook (it will _exclude_ globally-scoped items)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## DataFrame as input\n",
    "\n",
    "Instead of a Python dictionary for the `query` parameter, you can supply a Pandas DataFrame.\n",
    "\n",
    "This is generally useful when you have a DataFrame full of tag names but don't know the Seeq `ID` value and therefore can't retrieve data via `spy.pull()`. Calling `spy.search(data_frame)` effectively \"fills in\" the `ID` field for you wherever possible.\n",
    "\n",
    "The column headers specify the properties to search on and the column values specify the match criteria.\n",
    "\n",
    "If you don't specify wildcards or use a RegEx, the match must be exact. (This behavior is in contrast to the dictionary case, where the non-wildcard/RegEx match is a \"contains\" comparison.) It is assumed that your DataFrame property values should match exactly so that you can have a large set of items to query for and there won't be ambiguity between item names like `F1843CC` and `F1843CC.SP`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Datasource Name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Area A_Temperature</td>\n",
       "      <td>Example Data</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Area B_Compressor Power</td>\n",
       "      <td>Example Data</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Optimize</td>\n",
       "      <td>Example Data</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      Name Datasource Name\n",
       "0       Area A_Temperature    Example Data\n",
       "1  Area B_Compressor Power    Example Data\n",
       "2                 Optimize    Example Data"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "my_items = pd.DataFrame({\n",
    "    'Name': [\n",
    "        'Area A_Temperature',\n",
    "        'Area B_Compressor Power',\n",
    "        'Optimize'\n",
    "    ],\n",
    "    'Datasource Name': 'Example Data'\n",
    "})\n",
    "\n",
    "my_items"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;text-align: left;\">Query successful</div><table><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE;\">Datasource Name</td><td style=\"background-color: #EEFFEE;\">Name</td><td style=\"background-color: #EEFFEE;\">Time</td><td style=\"background-color: #EEFFEE;\">Count</td></tr><tr style=\"background-color: #EEFFEE;\"><td>0</td><td>Example Data</td><td>Area A_Temperature</td><td>00:00:00.05</td><td>1</td></tr><tr style=\"background-color: #EEFFEE;\"><td>1</td><td>Example Data</td><td>Area B_Compressor Power</td><td>00:00:00.06</td><td>1</td></tr><tr style=\"background-color: #EEFFEE;\"><td>2</td><td>Example Data</td><td>Optimize</td><td>00:00:00.07</td><td>0</td></tr></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>Name</th>\n",
       "      <th>Description</th>\n",
       "      <th>Type</th>\n",
       "      <th>Value Unit Of Measure</th>\n",
       "      <th>Datasource Name</th>\n",
       "      <th>Archived</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>AFFFA3F1-7A04-42F9-87F3-05F722FD61E0</td>\n",
       "      <td>Area A_Temperature</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>°F</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>E015D876-EAE6-4908-A797-FDF294126592</td>\n",
       "      <td>Area B_Compressor Power</td>\n",
       "      <td>NaN</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>kW</td>\n",
       "      <td>Example Data</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     ID                     Name  Description  \\\n",
       "0  AFFFA3F1-7A04-42F9-87F3-05F722FD61E0       Area A_Temperature          NaN   \n",
       "1  E015D876-EAE6-4908-A797-FDF294126592  Area B_Compressor Power          NaN   \n",
       "\n",
       "           Type Value Unit Of Measure Datasource Name  Archived  \n",
       "0  StoredSignal                    °F    Example Data     False  \n",
       "1  StoredSignal                    kW    Example Data     False  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "spy.search(my_items)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that there are no results with `Optimize` in the name because it does not exactly match any items."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
