{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from seeq import spy\n",
    "import pandas as pd\n",
    "\n",
    "# Set the compatibility option so that you maximize the chance that SPy will remain compatible with your notebook/script\n",
    "spy.options.compatibility = 193"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;color:black; text-align: left;\">Logged in to <strong>http://localhost:34216</strong> as <strong>agent_api_key</strong>.<br>Seeq Server Version: <strong>R66.0.0-SNAPSHOT</strong><br>Seeq SDK Module Version: <strong>66.0.0</strong> @ C:\\git\\crab\\sdk\\pypi\\seeq\\sdk<br>Seeq SPy Module Version: <strong>193.0</strong> @ C:\\git\\crab\\sdk\\pypi\\seeq\\spy</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.acl\n",
    "\n",
    "Retrieves and modifies access control configuration for signals, conditions, scalars, metrics, workbooks, assets or any other item in Seeq that supports access control.\n",
    "\n",
    "_ACL_ is an acronym for _Access Control List_, which is a simple list of users and user groups that have _Read_, _Write_ and/or _Manage_ access for an item. Access control is often hierarchical in nature, with leaf nodes of an asset tree or workbooks within a folder inheriting the access control of their parent."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Modifying ACLs for Pushed Data\n",
    "\n",
    "In the following example, we will push some data and then modify the ACLs for that data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "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>BITDEP(ft)</th>\n",
       "      <th>BLOCKCOMP(ft)</th>\n",
       "      <th>DEP_RTN(ft)</th>\n",
       "      <th>DEPTH(ft)</th>\n",
       "      <th>FLOWIN(USgal/min)</th>\n",
       "      <th>FLOWOUTPC(%)</th>\n",
       "      <th>ROP_AVG(ft/h)</th>\n",
       "      <th>DIFP(psi)</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TIME(unitless)</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2018-07-25 23:00:01-06:00</th>\n",
       "      <td>4630.217</td>\n",
       "      <td>74.813</td>\n",
       "      <td>4627.0</td>\n",
       "      <td>4630.217</td>\n",
       "      <td>799.857</td>\n",
       "      <td>40.799</td>\n",
       "      <td>142.698</td>\n",
       "      <td>454.214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-07-25 23:00:03-06:00</th>\n",
       "      <td>4630.354</td>\n",
       "      <td>74.735</td>\n",
       "      <td>4627.5</td>\n",
       "      <td>4630.354</td>\n",
       "      <td>799.857</td>\n",
       "      <td>40.576</td>\n",
       "      <td>142.698</td>\n",
       "      <td>481.383</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-07-25 23:00:05-06:00</th>\n",
       "      <td>4630.470</td>\n",
       "      <td>74.619</td>\n",
       "      <td>4627.5</td>\n",
       "      <td>4630.470</td>\n",
       "      <td>799.857</td>\n",
       "      <td>39.929</td>\n",
       "      <td>142.698</td>\n",
       "      <td>487.502</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-07-25 23:00:07-06:00</th>\n",
       "      <td>4630.588</td>\n",
       "      <td>74.501</td>\n",
       "      <td>4627.5</td>\n",
       "      <td>4630.588</td>\n",
       "      <td>799.857</td>\n",
       "      <td>40.305</td>\n",
       "      <td>210.705</td>\n",
       "      <td>561.480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2018-07-25 23:00:09-06:00</th>\n",
       "      <td>4630.699</td>\n",
       "      <td>74.390</td>\n",
       "      <td>4627.5</td>\n",
       "      <td>4630.699</td>\n",
       "      <td>799.292</td>\n",
       "      <td>40.245</td>\n",
       "      <td>210.705</td>\n",
       "      <td>610.968</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                           BITDEP(ft)  BLOCKCOMP(ft)  DEP_RTN(ft)  DEPTH(ft)  \\\n",
       "TIME(unitless)                                                                 \n",
       "2018-07-25 23:00:01-06:00    4630.217         74.813       4627.0   4630.217   \n",
       "2018-07-25 23:00:03-06:00    4630.354         74.735       4627.5   4630.354   \n",
       "2018-07-25 23:00:05-06:00    4630.470         74.619       4627.5   4630.470   \n",
       "2018-07-25 23:00:07-06:00    4630.588         74.501       4627.5   4630.588   \n",
       "2018-07-25 23:00:09-06:00    4630.699         74.390       4627.5   4630.699   \n",
       "\n",
       "                           FLOWIN(USgal/min)  FLOWOUTPC(%)  ROP_AVG(ft/h)  \\\n",
       "TIME(unitless)                                                              \n",
       "2018-07-25 23:00:01-06:00            799.857        40.799        142.698   \n",
       "2018-07-25 23:00:03-06:00            799.857        40.576        142.698   \n",
       "2018-07-25 23:00:05-06:00            799.857        39.929        142.698   \n",
       "2018-07-25 23:00:07-06:00            799.857        40.305        210.705   \n",
       "2018-07-25 23:00:09-06:00            799.292        40.245        210.705   \n",
       "\n",
       "                           DIFP(psi)  \n",
       "TIME(unitless)                        \n",
       "2018-07-25 23:00:01-06:00    454.214  \n",
       "2018-07-25 23:00:03-06:00    481.383  \n",
       "2018-07-25 23:00:05-06:00    487.502  \n",
       "2018-07-25 23:00:07-06:00    561.480  \n",
       "2018-07-25 23:00:09-06:00    610.968  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import csv\n",
    "csv_file = pd.read_csv('Support Files/csv_import_example.csv', parse_dates=['TIME(unitless)'], index_col='TIME(unitless)')\n",
    "csv_file.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;color:black; text-align: left;\">Pushed successfully to datasource <strong>Seeq Data Lab [Datasource ID: Seeq Data Lab]</strong> and scoped to workbook ID <strong>0EF5BF0E-F8F4-FF80-8B2E-79BE4A4A6182</strong><br>Click the following link to see what you pushed in Seeq:<br><a href=\"http://localhost:34216/0EF5BE2D-2738-FFA0-81E0-D2B058859C4D/workbook/0EF5BF0E-F8F4-FF80-8B2E-79BE4A4A6182/worksheet/0EF5BF0E-F94A-66B0-8A86-41B70847AA41\" target=\"_blank\">http://localhost:34216/0EF5BE2D-2738-FFA0-81E0-D2B058859C4D/workbook/0EF5BF0E-F8F4-FF80-8B2E-79BE4A4A6182/worksheet/0EF5BF0E-F94A-66B0-8A86-41B70847AA41</a></div><table class=\"tex2jax_ignore\" style=\"color:black;\"><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE; text-align: right;\">Count</td><td style=\"background-color: #EEFFEE; text-align: right;\">Pages</td><td style=\"background-color: #EEFFEE; text-align: left;\">Result</td><td style=\"background-color: #EEFFEE; text-align: right;\">Time</td><td style=\"background-color: #EEFFEE; text-align: left;\">Type</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">BITDEP(ft)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.28</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">BLOCKCOMP(ft)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.37</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">DEP_RTN(ft)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.40</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">DEPTH(ft)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.50</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">FLOWIN(USgal/min)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.56</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">FLOWOUTPC(%)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.58</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">ROP_AVG(ft/h)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.42</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">DIFP(psi)</td><td style=\"text-align: right; vertical-align: top;\">11485</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"text-align: left; vertical-align: top;\">Success</td><td style=\"vertical-align: top;\">00:00:00.38</td><td style=\"text-align: left; vertical-align: top;\">StoredSignal</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>Push Count</th>\n",
       "      <th>Push Time</th>\n",
       "      <th>Push Result</th>\n",
       "      <th>Name</th>\n",
       "      <th>ID</th>\n",
       "      <th>Type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>BITDEP(ft)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.280081</td>\n",
       "      <td>Success</td>\n",
       "      <td>BITDEP(ft)</td>\n",
       "      <td>0EF5BF0E-FCC7-FF90-BFC8-CF7E8444428B</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BLOCKCOMP(ft)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.371618</td>\n",
       "      <td>Success</td>\n",
       "      <td>BLOCKCOMP(ft)</td>\n",
       "      <td>0EF5BF0E-FDC3-7700-A8CC-DB1FF5768530</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DEP_RTN(ft)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.397070</td>\n",
       "      <td>Success</td>\n",
       "      <td>DEP_RTN(ft)</td>\n",
       "      <td>0EF5BF0E-FDC3-7700-8ACB-D54B4CE9C3B1</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DEPTH(ft)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.502246</td>\n",
       "      <td>Success</td>\n",
       "      <td>DEPTH(ft)</td>\n",
       "      <td>0EF5BF0E-FFA4-6650-A617-8E71FB07DDCE</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FLOWIN(USgal/min)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.564563</td>\n",
       "      <td>Success</td>\n",
       "      <td>FLOWIN(USgal/min)</td>\n",
       "      <td>0EF5BF0E-FEE8-6680-94F9-7E0C227B5DCD</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FLOWOUTPC(%)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.578577</td>\n",
       "      <td>Success</td>\n",
       "      <td>FLOWOUTPC(%)</td>\n",
       "      <td>0EF5BF0F-00BA-FB70-BD45-E5FF74533BB6</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ROP_AVG(ft/h)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.424654</td>\n",
       "      <td>Success</td>\n",
       "      <td>ROP_AVG(ft/h)</td>\n",
       "      <td>0EF5BF0E-FFE1-66E0-8A96-81EFBE90895B</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DIFP(psi)</th>\n",
       "      <td>11485.0</td>\n",
       "      <td>0 days 00:00:00.377629</td>\n",
       "      <td>Success</td>\n",
       "      <td>DIFP(psi)</td>\n",
       "      <td>0EF5BF0F-01A0-7350-940B-5AD80A39B886</td>\n",
       "      <td>StoredSignal</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Push Count              Push Time Push Result  \\\n",
       "BITDEP(ft)            11485.0 0 days 00:00:00.280081     Success   \n",
       "BLOCKCOMP(ft)         11485.0 0 days 00:00:00.371618     Success   \n",
       "DEP_RTN(ft)           11485.0 0 days 00:00:00.397070     Success   \n",
       "DEPTH(ft)             11485.0 0 days 00:00:00.502246     Success   \n",
       "FLOWIN(USgal/min)     11485.0 0 days 00:00:00.564563     Success   \n",
       "FLOWOUTPC(%)          11485.0 0 days 00:00:00.578577     Success   \n",
       "ROP_AVG(ft/h)         11485.0 0 days 00:00:00.424654     Success   \n",
       "DIFP(psi)             11485.0 0 days 00:00:00.377629     Success   \n",
       "\n",
       "                                Name                                    ID  \\\n",
       "BITDEP(ft)                BITDEP(ft)  0EF5BF0E-FCC7-FF90-BFC8-CF7E8444428B   \n",
       "BLOCKCOMP(ft)          BLOCKCOMP(ft)  0EF5BF0E-FDC3-7700-A8CC-DB1FF5768530   \n",
       "DEP_RTN(ft)              DEP_RTN(ft)  0EF5BF0E-FDC3-7700-8ACB-D54B4CE9C3B1   \n",
       "DEPTH(ft)                  DEPTH(ft)  0EF5BF0E-FFA4-6650-A617-8E71FB07DDCE   \n",
       "FLOWIN(USgal/min)  FLOWIN(USgal/min)  0EF5BF0E-FEE8-6680-94F9-7E0C227B5DCD   \n",
       "FLOWOUTPC(%)            FLOWOUTPC(%)  0EF5BF0F-00BA-FB70-BD45-E5FF74533BB6   \n",
       "ROP_AVG(ft/h)          ROP_AVG(ft/h)  0EF5BF0E-FFE1-66E0-8A96-81EFBE90895B   \n",
       "DIFP(psi)                  DIFP(psi)  0EF5BF0F-01A0-7350-940B-5AD80A39B886   \n",
       "\n",
       "                           Type  \n",
       "BITDEP(ft)         StoredSignal  \n",
       "BLOCKCOMP(ft)      StoredSignal  \n",
       "DEP_RTN(ft)        StoredSignal  \n",
       "DEPTH(ft)          StoredSignal  \n",
       "FLOWIN(USgal/min)  StoredSignal  \n",
       "FLOWOUTPC(%)       StoredSignal  \n",
       "ROP_AVG(ft/h)      StoredSignal  \n",
       "DIFP(psi)          StoredSignal  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "push_results = spy.push(data=csv_file, workbook='SPy Documentation Examples >> spy.acl')\n",
    "push_results"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "After pushing, we can use the returned DataFrame (`push_results`) to modify the ACLs:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;color:black; text-align: left;\">Pushed ACLs successfully.</div><table class=\"tex2jax_ignore\" style=\"color:black;\"><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE; text-align: right;\">Count</td><td style=\"background-color: #EEFFEE; text-align: right;\">Time</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">0</td><td style=\"text-align: right; vertical-align: top;\">8</td><td style=\"vertical-align: top;\">00:00:00.59</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>Name</th>\n",
       "      <th>ID</th>\n",
       "      <th>Type</th>\n",
       "      <th>Push Result</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>BITDEP(ft)</th>\n",
       "      <td>BITDEP(ft)</td>\n",
       "      <td>0EF5BF0E-FCC7-FF90-BFC8-CF7E8444428B</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BLOCKCOMP(ft)</th>\n",
       "      <td>BLOCKCOMP(ft)</td>\n",
       "      <td>0EF5BF0E-FDC3-7700-A8CC-DB1FF5768530</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DEP_RTN(ft)</th>\n",
       "      <td>DEP_RTN(ft)</td>\n",
       "      <td>0EF5BF0E-FDC3-7700-8ACB-D54B4CE9C3B1</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DEPTH(ft)</th>\n",
       "      <td>DEPTH(ft)</td>\n",
       "      <td>0EF5BF0E-FFA4-6650-A617-8E71FB07DDCE</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FLOWIN(USgal/min)</th>\n",
       "      <td>FLOWIN(USgal/min)</td>\n",
       "      <td>0EF5BF0E-FEE8-6680-94F9-7E0C227B5DCD</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FLOWOUTPC(%)</th>\n",
       "      <td>FLOWOUTPC(%)</td>\n",
       "      <td>0EF5BF0F-00BA-FB70-BD45-E5FF74533BB6</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ROP_AVG(ft/h)</th>\n",
       "      <td>ROP_AVG(ft/h)</td>\n",
       "      <td>0EF5BF0E-FFE1-66E0-8A96-81EFBE90895B</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DIFP(psi)</th>\n",
       "      <td>DIFP(psi)</td>\n",
       "      <td>0EF5BF0F-01A0-7350-940B-5AD80A39B886</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                Name                                    ID  \\\n",
       "BITDEP(ft)                BITDEP(ft)  0EF5BF0E-FCC7-FF90-BFC8-CF7E8444428B   \n",
       "BLOCKCOMP(ft)          BLOCKCOMP(ft)  0EF5BF0E-FDC3-7700-A8CC-DB1FF5768530   \n",
       "DEP_RTN(ft)              DEP_RTN(ft)  0EF5BF0E-FDC3-7700-8ACB-D54B4CE9C3B1   \n",
       "DEPTH(ft)                  DEPTH(ft)  0EF5BF0E-FFA4-6650-A617-8E71FB07DDCE   \n",
       "FLOWIN(USgal/min)  FLOWIN(USgal/min)  0EF5BF0E-FEE8-6680-94F9-7E0C227B5DCD   \n",
       "FLOWOUTPC(%)            FLOWOUTPC(%)  0EF5BF0F-00BA-FB70-BD45-E5FF74533BB6   \n",
       "ROP_AVG(ft/h)          ROP_AVG(ft/h)  0EF5BF0E-FFE1-66E0-8A96-81EFBE90895B   \n",
       "DIFP(psi)                  DIFP(psi)  0EF5BF0F-01A0-7350-940B-5AD80A39B886   \n",
       "\n",
       "                           Type Push Result  \n",
       "BITDEP(ft)         StoredSignal     Success  \n",
       "BLOCKCOMP(ft)      StoredSignal     Success  \n",
       "DEP_RTN(ft)        StoredSignal     Success  \n",
       "DEPTH(ft)          StoredSignal     Success  \n",
       "FLOWIN(USgal/min)  StoredSignal     Success  \n",
       "FLOWOUTPC(%)       StoredSignal     Success  \n",
       "ROP_AVG(ft/h)      StoredSignal     Success  \n",
       "DIFP(psi)          StoredSignal     Success  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# This will remove the Everyone group by replacing with only me\n",
    "spy.acl.push(push_results, {\n",
    "    'ID': spy.user.id,\n",
    "    'Read': True,\n",
    "    'Write': True,\n",
    "    'Manage': True\n",
    "}, replace=True, disable_inheritance=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Modifying ACLs for Pushed Workbooks\n",
    "\n",
    "You can also modify the access control for the workbook that was created:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;color:black; text-align: left;\">Pushed ACLs successfully.</div><table class=\"tex2jax_ignore\" style=\"color:black;\"><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE; text-align: right;\">Count</td><td style=\"background-color: #EEFFEE; text-align: right;\">Time</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">0</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"vertical-align: top;\">00:00:00.04</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>Push Result</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0EF5BF0E-F8F4-FF80-8B2E-79BE4A4A6182</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     ID Push Result\n",
       "0  0EF5BF0E-F8F4-FF80-8B2E-79BE4A4A6182     Success"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "spy.acl.push(push_results.spy.workbook_id, {\n",
    "    'ID': spy.user.id,\n",
    "    'Read': True,\n",
    "    'Write': True,\n",
    "    'Manage': True\n",
    "}, replace=True, disable_inheritance=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Alternatively, you can search for workbooks and modify them that way:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;color:black; text-align: left;\">Pushed ACLs successfully.</div><table class=\"tex2jax_ignore\" style=\"color:black;\"><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE; text-align: right;\">Count</td><td style=\"background-color: #EEFFEE; text-align: right;\">Time</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">0</td><td style=\"text-align: right; vertical-align: top;\">1</td><td style=\"vertical-align: top;\">00:00:00.05</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>Archived</th>\n",
       "      <th>Created At</th>\n",
       "      <th>Creator ID</th>\n",
       "      <th>Creator Name</th>\n",
       "      <th>Creator Username</th>\n",
       "      <th>ID</th>\n",
       "      <th>Name</th>\n",
       "      <th>Owner ID</th>\n",
       "      <th>Owner Name</th>\n",
       "      <th>Owner Username</th>\n",
       "      <th>Path</th>\n",
       "      <th>Pinned</th>\n",
       "      <th>Search Folder ID</th>\n",
       "      <th>Type</th>\n",
       "      <th>Updated At</th>\n",
       "      <th>Workbook Type</th>\n",
       "      <th>Push Result</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>2024-08-16 16:59:44.120409400+00:00</td>\n",
       "      <td>0EF58FC1-C55E-F990-AB3A-A59ED4E0F416</td>\n",
       "      <td>Agent API Key</td>\n",
       "      <td>agent_api_key</td>\n",
       "      <td>0EF5BF0E-F8F4-FF80-8B2E-79BE4A4A6182</td>\n",
       "      <td>spy.acl</td>\n",
       "      <td>0EF58FC1-C55E-F990-AB3A-A59ED4E0F416</td>\n",
       "      <td>Agent API Key</td>\n",
       "      <td>agent_api_key</td>\n",
       "      <td>SPy Documentation Examples</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0EF5BE2D-2738-FFA0-81E0-D2B058859C4D</td>\n",
       "      <td>Workbook</td>\n",
       "      <td>2024-08-16 16:59:45.744990600+00:00</td>\n",
       "      <td>Analysis</td>\n",
       "      <td>Success</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Archived                          Created At  \\\n",
       "0       NaN 2024-08-16 16:59:44.120409400+00:00   \n",
       "\n",
       "                             Creator ID   Creator Name Creator Username  \\\n",
       "0  0EF58FC1-C55E-F990-AB3A-A59ED4E0F416  Agent API Key    agent_api_key   \n",
       "\n",
       "                                     ID     Name  \\\n",
       "0  0EF5BF0E-F8F4-FF80-8B2E-79BE4A4A6182  spy.acl   \n",
       "\n",
       "                               Owner ID     Owner Name Owner Username  \\\n",
       "0  0EF58FC1-C55E-F990-AB3A-A59ED4E0F416  Agent API Key  agent_api_key   \n",
       "\n",
       "                         Path  Pinned                      Search Folder ID  \\\n",
       "0  SPy Documentation Examples     NaN  0EF5BE2D-2738-FFA0-81E0-D2B058859C4D   \n",
       "\n",
       "       Type                          Updated At Workbook Type Push Result  \n",
       "0  Workbook 2024-08-16 16:59:45.744990600+00:00      Analysis     Success  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "workbooks = spy.workbooks.search({'Name': 'spy.acl', 'Path': 'SPy Documentation Examples'})\n",
    "spy.acl.push(workbooks, {\n",
    "    'Name': 'Everyone',\n",
    "    'Read': True,\n",
    "    'Write': True,\n",
    "    'Manage': False\n",
    "})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Retrieving ACLs\n",
    "\n",
    "You can use the same approach to retrieve ACLs for a set of items:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"background-color: #EEFFEE;color:black; text-align: left;\">Pulled ACLs successfully.</div><table class=\"tex2jax_ignore\" style=\"color:black;\"><tr><td style=\"background-color: #EEFFEE;\"></td><td style=\"background-color: #EEFFEE; text-align: right;\">Count</td><td style=\"background-color: #EEFFEE; text-align: right;\">Time</td></tr><tr style=\"background-color: #EEFFEE;\"><td style=\"vertical-align: top;\">0</td><td style=\"text-align: right; vertical-align: top;\">8</td><td style=\"vertical-align: top;\">00:00:00.10</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>Name</th>\n",
       "      <th>ID</th>\n",
       "      <th>Type</th>\n",
       "      <th>Pull Result</th>\n",
       "      <th>Access Control</th>\n",
       "      <th>Permissions Inheritance Disabled</th>\n",
       "      <th>Permissions From Datasource</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>BITDEP(ft)</th>\n",
       "      <td>BITDEP(ft)</td>\n",
       "      <td>0EF5BF0E-FCC7-FF90-BFC8-CF7E8444428B</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BLOCKCOMP(ft)</th>\n",
       "      <td>BLOCKCOMP(ft)</td>\n",
       "      <td>0EF5BF0E-FDC3-7700-A8CC-DB1FF5768530</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DEP_RTN(ft)</th>\n",
       "      <td>DEP_RTN(ft)</td>\n",
       "      <td>0EF5BF0E-FDC3-7700-8ACB-D54B4CE9C3B1</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DEPTH(ft)</th>\n",
       "      <td>DEPTH(ft)</td>\n",
       "      <td>0EF5BF0E-FFA4-6650-A617-8E71FB07DDCE</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FLOWIN(USgal/min)</th>\n",
       "      <td>FLOWIN(USgal/min)</td>\n",
       "      <td>0EF5BF0E-FEE8-6680-94F9-7E0C227B5DCD</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FLOWOUTPC(%)</th>\n",
       "      <td>FLOWOUTPC(%)</td>\n",
       "      <td>0EF5BF0F-00BA-FB70-BD45-E5FF74533BB6</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ROP_AVG(ft/h)</th>\n",
       "      <td>ROP_AVG(ft/h)</td>\n",
       "      <td>0EF5BF0E-FFE1-66E0-8A96-81EFBE90895B</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DIFP(psi)</th>\n",
       "      <td>DIFP(psi)</td>\n",
       "      <td>0EF5BF0F-01A0-7350-940B-5AD80A39B886</td>\n",
       "      <td>StoredSignal</td>\n",
       "      <td>Success</td>\n",
       "      <td>...</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                Name                                    ID  \\\n",
       "BITDEP(ft)                BITDEP(ft)  0EF5BF0E-FCC7-FF90-BFC8-CF7E8444428B   \n",
       "BLOCKCOMP(ft)          BLOCKCOMP(ft)  0EF5BF0E-FDC3-7700-A8CC-DB1FF5768530   \n",
       "DEP_RTN(ft)              DEP_RTN(ft)  0EF5BF0E-FDC3-7700-8ACB-D54B4CE9C3B1   \n",
       "DEPTH(ft)                  DEPTH(ft)  0EF5BF0E-FFA4-6650-A617-8E71FB07DDCE   \n",
       "FLOWIN(USgal/min)  FLOWIN(USgal/min)  0EF5BF0E-FEE8-6680-94F9-7E0C227B5DCD   \n",
       "FLOWOUTPC(%)            FLOWOUTPC(%)  0EF5BF0F-00BA-FB70-BD45-E5FF74533BB6   \n",
       "ROP_AVG(ft/h)          ROP_AVG(ft/h)  0EF5BF0E-FFE1-66E0-8A96-81EFBE90895B   \n",
       "DIFP(psi)                  DIFP(psi)  0EF5BF0F-01A0-7350-940B-5AD80A39B886   \n",
       "\n",
       "                           Type Pull Result  \\\n",
       "BITDEP(ft)         StoredSignal     Success   \n",
       "BLOCKCOMP(ft)      StoredSignal     Success   \n",
       "DEP_RTN(ft)        StoredSignal     Success   \n",
       "DEPTH(ft)          StoredSignal     Success   \n",
       "FLOWIN(USgal/min)  StoredSignal     Success   \n",
       "FLOWOUTPC(%)       StoredSignal     Success   \n",
       "ROP_AVG(ft/h)      StoredSignal     Success   \n",
       "DIFP(psi)          StoredSignal     Success   \n",
       "\n",
       "                                                      Access Control  \\\n",
       "BITDEP(ft)                                                       ...   \n",
       "BLOCKCOMP(ft)                                                    ...   \n",
       "DEP_RTN(ft)                                                      ...   \n",
       "DEPTH(ft)                                                        ...   \n",
       "FLOWIN(USgal/min)                                                ...   \n",
       "FLOWOUTPC(%)                                                     ...   \n",
       "ROP_AVG(ft/h)                                                    ...   \n",
       "DIFP(psi)                                                        ...   \n",
       "\n",
       "                  Permissions Inheritance Disabled Permissions From Datasource  \n",
       "BITDEP(ft)                                    True                       False  \n",
       "BLOCKCOMP(ft)                                 True                       False  \n",
       "DEP_RTN(ft)                                   True                       False  \n",
       "DEPTH(ft)                                     True                       False  \n",
       "FLOWIN(USgal/min)                             True                       False  \n",
       "FLOWOUTPC(%)                                  True                       False  \n",
       "ROP_AVG(ft/h)                                 True                       False  \n",
       "DIFP(psi)                                     True                       False  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pull_acl_df = spy.acl.pull(push_results)\n",
    "pull_acl_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Each entry in the table now has an `Access Control` column, and each cell in that column is an embedded DataFrame you can access like so:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "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>ID</th>\n",
       "      <th>Type</th>\n",
       "      <th>Name</th>\n",
       "      <th>Username</th>\n",
       "      <th>Email</th>\n",
       "      <th>Directory</th>\n",
       "      <th>Archived</th>\n",
       "      <th>Enabled</th>\n",
       "      <th>Redacted</th>\n",
       "      <th>Role</th>\n",
       "      <th>Origin Type</th>\n",
       "      <th>Origin Name</th>\n",
       "      <th>Read</th>\n",
       "      <th>Write</th>\n",
       "      <th>Manage</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0ef5bf0f-098a-f930-aebf-d1d5f3817b57</th>\n",
       "      <td>0EF58FC1-C55E-F990-AB3A-A59ED4E0F416</td>\n",
       "      <td>User</td>\n",
       "      <td>Agent API Key</td>\n",
       "      <td>agent_api_key</td>\n",
       "      <td>None</td>\n",
       "      <td>Seeq</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                        ID  \\\n",
       "0ef5bf0f-098a-f930-aebf-d1d5f3817b57  0EF58FC1-C55E-F990-AB3A-A59ED4E0F416   \n",
       "\n",
       "                                      Type           Name       Username  \\\n",
       "0ef5bf0f-098a-f930-aebf-d1d5f3817b57  User  Agent API Key  agent_api_key   \n",
       "\n",
       "                                     Email Directory Archived Enabled  \\\n",
       "0ef5bf0f-098a-f930-aebf-d1d5f3817b57  None      Seeq    False    True   \n",
       "\n",
       "                                     Redacted  Role Origin Type Origin Name  \\\n",
       "0ef5bf0f-098a-f930-aebf-d1d5f3817b57    False  None         NaN         NaN   \n",
       "\n",
       "                                      Read Write Manage  \n",
       "0ef5bf0f-098a-f930-aebf-d1d5f3817b57  True  True   True  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "acl_df = pull_acl_df.at['BITDEP(ft)', 'Access Control']\n",
    "acl_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Detailed Help\n",
    "\n",
    "All SPy functions have detailed documentation to help you use them. Just execute `help(spy.<func>)` like\n",
    "you see below.\n",
    "\n",
    "**Make sure you re-execute the cell below to see the latest documentation. It otherwise might be from an\n",
    "earlier version of SPy.**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function push in module seeq.spy.acl._push:\n",
      "\n",
      "push(items: 'Union[pd.DataFrame, dict, list, str, Item]', acl: 'Union[pd.DataFrame, dict, list]', *, replace: 'bool' = False, disable_inheritance: 'bool' = None, errors: 'Optional[str]' = None, quiet: 'Optional[bool]' = None, status: 'Optional[Status]' = None, session: 'Optional[Session]' = None) -> 'pd.DataFrame'\n",
      "    Pushes new access control entries against a set of items as specified\n",
      "    by their IDs. The most common way to invoke this command is directly\n",
      "    after having done a spy.search() or spy.push() and produced a DataFrame\n",
      "    full of items to work with.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    items : {pandas.DataFrame, dict, list, str, Item}\n",
      "        The item IDs to push against. This argument can take the following\n",
      "        form:\n",
      "    \n",
      "        - a DataFrame with an \"ID\" column\n",
      "        - a single dict with an \"ID\" key\n",
      "        - a list of dicts with \"ID\" keys\n",
      "        - a single Workbook object\n",
      "        - a list of Workbook objects\n",
      "        - a single string representing the ID of the item\n",
      "        - a list of strings representing the IDs of the items\n",
      "        - a SPy Item instance\n",
      "    \n",
      "    acl : {pandas.DataFrame, dict, list}\n",
      "        The Access Control List can be either a Pandas DataFrame\n",
      "        a list of dicts, or just a dict. The dict or DataFrame rows must\n",
      "        consist of either 'ID' OR ('Name' or 'Username') to specify the\n",
      "        identity and then a 'Read', 'Write' and/or 'Manage' entry that is\n",
      "        a boolean True or False value.\n",
      "    \n",
      "    replace : {bool}, optional, default False\n",
      "        - If False, then existing access control entries will not be disturbed\n",
      "          but new entries will be added.\n",
      "        - If True, then existing access control entries will be removed\n",
      "          and replaced with the entries from the acl argument.\n",
      "    \n",
      "    disable_inheritance : {bool}, optional, default None\n",
      "        - If None, then the inheritance will remain unchanged. (This is the\n",
      "          default behavior.)\n",
      "        - If False, then the ACL inherits from either the datasource or the\n",
      "          workbook (for signals/scalars/conditions/assets/metrics). Workbooks\n",
      "          inherit their ACLs from their parent folder.\n",
      "        - If True, then the ACL will no longer inherit from the parent.\n",
      "    \n",
      "    errors : {'raise', 'catalog'}, default 'raise'\n",
      "        If 'raise', any errors encountered will cause an exception. If\n",
      "        'catalog', errors will be added to a 'Push Result' column in the\n",
      "        status.df DataFrame.\n",
      "    \n",
      "    quiet : bool, default False\n",
      "        If True, suppresses progress output. Note that when status is\n",
      "        provided, the quiet setting of the Status object that is passed\n",
      "        in takes precedence.\n",
      "    \n",
      "    status : spy.Status, optional\n",
      "        If specified, the supplied Status object will be updated as the command\n",
      "        progresses. It gets filled in with the same information you would see\n",
      "        in Jupyter in the blue/green/red table below your code while the\n",
      "        command is executed. The table itself is accessible as a DataFrame via\n",
      "        the status.df property.\n",
      "    \n",
      "    session : spy.Session, optional\n",
      "        If supplied, the Session object (and its Options) will be used to\n",
      "        store the login session state. This is useful to log in to different\n",
      "        Seeq servers at the same time or with different credentials.\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    pandas.DataFrame\n",
      "        A DataFrame with the metadata for the items pushed, along with any\n",
      "        errors (in the 'Push Result' column).\n",
      "    \n",
      "        Additionally, the following properties are stored on the \"spy\"\n",
      "        attribute of the output DataFrame:\n",
      "    \n",
      "        =================== ===================================================\n",
      "        Property            Description\n",
      "        =================== ===================================================\n",
      "        func                A str value of 'spy.acl.push'\n",
      "        kwargs              A dict with the values of the input parameters\n",
      "                            passed to spy.acl.push to get the output DataFrame\n",
      "        status              A spy.Status object with the status of the\n",
      "                            spy.acl.push call\n",
      "        =================== ===================================================\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    Search for signals with the name 'Hydrocracker' and add a single ACL for Walter:\n",
      "    \n",
      "    >>> search_results = spy.search({'Name': 'Hydrocracker'})\n",
      "    >>> push_results = spy.acl.push(search_results, {'Username': 'walter.reed@va.com', 'Read': True})\n",
      "    \n",
      "    Add multiple ACLs -- one for Reed Abook (a user) and one for the Everyone group:\n",
      "    \n",
      "    >>> search_results = spy.search({'Name': 'Hydrocracker'})\n",
      "    >>> push_results = spy.acl.push(search_results, [{\n",
      "    >>>                                 'Username': 'reed.abook@seeq.com',\n",
      "    >>>                                 'Read': True,\n",
      "    >>>                                 'Write': True,\n",
      "    >>>                                 'Manage': True\n",
      "    >>>                             }, {\n",
      "    >>>                                 'Name': 'Everyone',\n",
      "    >>>                                 'Type': 'UserGroup',\n",
      "    >>>                                 'Read': True\n",
      "    >>>                             }])\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(spy.acl.push)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function pull in module seeq.spy.acl._pull:\n",
      "\n",
      "pull(items: 'Union[pd.DataFrame, dict, list, str, Item]', *, include_my_effective_permissions: 'bool' = False, errors: 'Optional[str]' = None, quiet: 'Optional[bool]' = None, status: 'Optional[Status]' = None, session: 'Optional[Session]' = None) -> 'pd.DataFrame'\n",
      "    Pulls access control entries for a set of items as specified\n",
      "    by their IDs. The most common way to invoke this command is directly\n",
      "    after having done a spy.search() and produced a DataFrame full of\n",
      "    items to work with.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    items : {pandas.DataFrame, dict, list, str, Item}\n",
      "        The item IDs to pull for. This argument can take the following form:\n",
      "    \n",
      "        - a DataFrame with an \"ID\" column\n",
      "        - a single dict with an \"ID\" key\n",
      "        - a list of dicts with \"ID\" keys\n",
      "        - a single Workbook object\n",
      "        - a list of Workbook objects\n",
      "        - a single string representing the ID of the item\n",
      "        - a list of strings representing the IDs of the items\n",
      "        - a SPy Item instance\n",
      "    \n",
      "    include_my_effective_permissions : bool, default False\n",
      "        If True, adds 'Read/Write/Manage Permission' columns to the output\n",
      "        DataFrame that reflect the calling user's permissions for the item.\n",
      "    \n",
      "    errors : {'raise', 'catalog'}, default 'raise'\n",
      "        If 'raise', any errors encountered will cause an exception. If\n",
      "        'catalog', errors will be added to a 'Pull Result' column in the\n",
      "        status.df DataFrame.\n",
      "    \n",
      "    quiet : bool, default False\n",
      "        If True, suppresses progress output. Note that when status is\n",
      "        provided, the quiet setting of the Status object that is passed\n",
      "        in takes precedence.\n",
      "    \n",
      "    status : spy.Status, optional\n",
      "        If specified, the supplied Status object will be updated as the command\n",
      "        progresses. It gets filled in with the same information you would see\n",
      "        in Jupyter in the blue/green/red table below your code while the\n",
      "        command is executed. The table itself is accessible as a DataFrame via\n",
      "        the status.df property.\n",
      "    \n",
      "    session : spy.Session, optional\n",
      "        If supplied, the Session object (and its Options) will be used to\n",
      "        store the login session state. This is useful to log in to different\n",
      "        Seeq servers at the same time or with different credentials.\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    pandas.DataFrame\n",
      "        A DataFrame with the metadata for the items pulled and an\n",
      "        'Access Control' column with an embedded DataFrame in each cell that\n",
      "        represents the Access Control List.\n",
      "    \n",
      "        Additionally, the following properties are stored on the \"spy\"\n",
      "        attribute of the output DataFrame:\n",
      "    \n",
      "        =================== ===================================================\n",
      "        Property            Description\n",
      "        =================== ===================================================\n",
      "        func                A str value of 'spy.acl.pull'\n",
      "        kwargs              A dict with the values of the input parameters\n",
      "                            passed to spy.acl.pull to get the output DataFrame\n",
      "        status              A spy.Status object with the status of the\n",
      "                            spy.acl.pull call\n",
      "        =================== ===================================================\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    Search for signals with the name 'Humid' on the asset tree under\n",
      "    'Example >> Cooling Tower 1', then retrieve ACLs for the results:\n",
      "    \n",
      "    >>> search_results = spy.search({'Name': 'Humid', 'Path': 'Example >> Cooling Tower 1'})\n",
      "    >>> pull_results = spy.acl.pull(search_results)\n",
      "    >>> pull_results.at[0, 'Access Control']  # Retrieves an inner DataFrame representing the ACL\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(spy.acl.pull)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.11",
   "language": "python",
   "name": "python311"
  },
  "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.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
