{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Basics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/Users/valery/Documents/_code/arche/src\n"
     ]
    }
   ],
   "source": [
    "%cd ../../../src"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Bare"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:01:59.316035Z",
     "start_time": "2019-03-22T21:01:45.087Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script><script>requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min']},});if(!window._Plotly) {require(['plotly'],function(plotly) {window._Plotly=plotly;});}</script>"
      ],
      "text/vnd.plotly.v1+html": [
       "<script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script><script type=\"text/javascript\">if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script><script>requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min']},});if(!window._Plotly) {require(['plotly'],function(plotly) {window._Plotly=plotly;});}</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from arche import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Any project requires auth which is done with an api key set in `SH_APIKEY`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:01:39.943889Z",
     "start_time": "2019-03-22T21:01:39.940823Z"
    }
   },
   "outputs": [],
   "source": [
    "a = Arche(\"381798/1/1\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:01:50.955877Z",
     "start_time": "2019-03-22T21:01:39.951101Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b51f679e218c4932bd4b1e32671c81a1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(IntProgress(value=0, description='Fetching 0:1000 from 381798/1/1', max=1000, style=ProgressSty…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8fab9507b38c4636bc900cab55c13245",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(IntProgress(value=0, description='Flattening df', max=6, style=ProgressStyle(description_width=…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Job Outcome:\n",
      "\tFinished\n",
      "\n",
      "Job Errors:\n",
      "\tNo errors\n",
      "\n",
      "Responses Per Item Ratio:\n",
      "\tNumber of responses / Number of scraped items - 1.05\n",
      "\n",
      "Fields Coverage:\n",
      "\tPASSED\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Fields Coverage (1 message(s)):\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><div id=\"91e8d9ca-ded4-4f83-9b3d-2b697b4e725e\" style=\"height: 450px; width: 100%;\" class=\"plotly-graph-div\"></div><script type=\"text/javascript\">window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";\n",
       "if (document.getElementById(\"91e8d9ca-ded4-4f83-9b3d-2b697b4e725e\")) {\n",
       "    Plotly.newPlot(\"91e8d9ca-ded4-4f83-9b3d-2b697b4e725e\", [{\"orientation\": \"h\", \"x\": [1000, 1000, 1000, 998], \"y\": [\"title\", \"price\", \"category\", \"description\"], \"type\": \"bar\", \"uid\": \"cd3a375c-f419-4606-8a5d-2042e78bef94\"}], {\"annotations\": [{\"showarrow\": false, \"text\": \"99.80%\", \"x\": 0, \"xref\": \"paper\", \"y\": \"description\", \"yref\": \"y\"}, {\"showarrow\": false, \"text\": \"100.00%\", \"x\": 0, \"xref\": \"paper\", \"y\": \"category\", \"yref\": \"y\"}], \"bargap\": 0.1, \"height\": 450, \"hovermode\": \"y\", \"margin\": {\"l\": 200, \"t\": 35}, \"template\": {\"data\": {\"barpolar\": [{\"marker\": {\"line\": {\"color\": \"rgb(237,237,237)\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"bar\": [{\"marker\": {\"line\": {\"color\": \"rgb(237,237,237)\", \"width\": 0.5}}, \"type\": \"bar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"rgb(51,51,51)\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"rgb(51,51,51)\"}, \"baxis\": {\"endlinecolor\": \"rgb(51,51,51)\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"rgb(51,51,51)\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"choropleth\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"contourcarpet\"}], \"contour\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"contour\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"heatmapgl\"}], \"heatmap\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"heatmap\"}], \"histogram2dcontour\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"histogram2dcontour\"}], \"histogram2d\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"histogram2d\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"histogram\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"parcoords\"}], \"scatter3d\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattermapbox\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterpolargl\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterpolar\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatter\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"rgb(237,237,237)\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"rgb(217,217,217)\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowhead\": 0, \"arrowwidth\": 1}, \"colorscale\": {\"sequential\": [[0, \"rgb(20,44,66)\"], [1, \"rgb(90,179,244)\"]], \"sequentialminus\": [[0, \"rgb(20,44,66)\"], [1, \"rgb(90,179,244)\"]]}, \"colorway\": [\"#F8766D\", \"#A3A500\", \"#00BF7D\", \"#00B0F6\", \"#E76BF3\"], \"font\": {\"color\": \"rgb(51,51,51)\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"rgb(237,237,237)\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"white\"}, \"hovermode\": \"closest\", \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"rgb(237,237,237)\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"bgcolor\": \"rgb(237,237,237)\", \"radialaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"zaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}}, \"shapedefaults\": {\"fillcolor\": \"black\", \"line\": {\"width\": 0}, \"opacity\": 0.3}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"baxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"bgcolor\": \"rgb(237,237,237)\", \"caxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}}}, \"title\": {\"text\": \"Fields coverage for 1_000 items\"}, \"xaxis\": {\"range\": [0, 1050.0]}}, {\"showLink\": false, \"linkText\": \"Export to plot.ly\", \"plotlyServerURL\": \"https://plot.ly\"}); \n",
       "}\n",
       "</script><script type=\"text/javascript\">window.addEventListener(\"resize\", function(){if (document.getElementById(\"91e8d9ca-ded4-4f83-9b3d-2b697b4e725e\")) {Plotly.Plots.resize(document.getElementById(\"91e8d9ca-ded4-4f83-9b3d-2b697b4e725e\"));};})</script></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "a.report_all()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We just ran a minimal number of rules. The validation can be improved with adding a json schema, let's infer one from the data we already have."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## JSON schema"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:01:59.279211Z",
     "start_time": "2019-03-22T21:01:50.965889Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'$schema': 'http://json-schema.org/draft-07/schema#',\n",
       " 'additionalProperties': False,\n",
       " 'definitions': {'float': {'pattern': '^-?[0-9]+\\\\.[0-9]{2}$'},\n",
       "                 'url': {'pattern': '^https?://(www\\\\.)?[a-z0-9.-]*\\\\.[a-z]{2,}([^<>%\\\\x20\\\\x00-\\\\x1f\\\\x7F]|%[0-9a-fA-F]{2})*$'}},\n",
       " 'properties': {'_key': {'type': 'string'},\n",
       "                '_type': {'type': 'string'},\n",
       "                'category': {'type': 'string'},\n",
       "                'description': {'type': 'string'},\n",
       "                'price': {'type': 'string'},\n",
       "                'title': {'type': 'string'}},\n",
       " 'required': ['_key', '_type', 'category', 'description', 'price', 'title'],\n",
       " 'type': 'object'}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "basic_json_schema(\"381798/1/1\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:01:59.295022Z",
     "start_time": "2019-03-22T21:01:59.285607Z"
    }
   },
   "source": [
    "By itself a basic schema is not very helpful, but you can update it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:02:14.500232Z",
     "start_time": "2019-03-22T21:02:14.452833Z"
    }
   },
   "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>_key</th>\n",
       "      <th>_type</th>\n",
       "      <th>category</th>\n",
       "      <th>description</th>\n",
       "      <th>price</th>\n",
       "      <th>title</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>https://app.scrapinghub.com/p/381798/1/1/item/0</td>\n",
       "      <td>dict</td>\n",
       "      <td>Travel</td>\n",
       "      <td>“Wherever you go, whatever you do, just . . . ...</td>\n",
       "      <td>£45.17</td>\n",
       "      <td>It's Only the Himalayas</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>https://app.scrapinghub.com/p/381798/1/1/item/1</td>\n",
       "      <td>dict</td>\n",
       "      <td>Politics</td>\n",
       "      <td>Libertarianism isn't about winning elections; ...</td>\n",
       "      <td>£51.33</td>\n",
       "      <td>Libertarianism for Beginners</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>https://app.scrapinghub.com/p/381798/1/1/item/2</td>\n",
       "      <td>dict</td>\n",
       "      <td>Science Fiction</td>\n",
       "      <td>Andrew Barger, award-winning author and engine...</td>\n",
       "      <td>£37.59</td>\n",
       "      <td>Mesaerion: The Best Science Fiction Stories 18...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>https://app.scrapinghub.com/p/381798/1/1/item/3</td>\n",
       "      <td>dict</td>\n",
       "      <td>Poetry</td>\n",
       "      <td>Part fact, part fiction, Tyehimba Jess's much ...</td>\n",
       "      <td>£23.88</td>\n",
       "      <td>Olio</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>https://app.scrapinghub.com/p/381798/1/1/item/4</td>\n",
       "      <td>dict</td>\n",
       "      <td>Music</td>\n",
       "      <td>This is the never-before-told story of the mus...</td>\n",
       "      <td>£57.25</td>\n",
       "      <td>Our Band Could Be Your Life: Scenes from the A...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                              _key _type         category  \\\n",
       "0  https://app.scrapinghub.com/p/381798/1/1/item/0  dict           Travel   \n",
       "1  https://app.scrapinghub.com/p/381798/1/1/item/1  dict         Politics   \n",
       "2  https://app.scrapinghub.com/p/381798/1/1/item/2  dict  Science Fiction   \n",
       "3  https://app.scrapinghub.com/p/381798/1/1/item/3  dict           Poetry   \n",
       "4  https://app.scrapinghub.com/p/381798/1/1/item/4  dict            Music   \n",
       "\n",
       "                                         description   price  \\\n",
       "0  “Wherever you go, whatever you do, just . . . ...  £45.17   \n",
       "1  Libertarianism isn't about winning elections; ...  £51.33   \n",
       "2  Andrew Barger, award-winning author and engine...  £37.59   \n",
       "3  Part fact, part fiction, Tyehimba Jess's much ...  £23.88   \n",
       "4  This is the never-before-told story of the mus...  £57.25   \n",
       "\n",
       "                                               title  \n",
       "0                            It's Only the Himalayas  \n",
       "1                       Libertarianism for Beginners  \n",
       "2  Mesaerion: The Best Science Fiction Stories 18...  \n",
       "3                                               Olio  \n",
       "4  Our Band Could Be Your Life: Scenes from the A...  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.source_items.df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Looks like `price` can be checked with regex. Let's also add `category` tag which helps to see the distribution in categoric data and `unique` tag to title to ensure there are no duplicates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:02:15.116277Z",
     "start_time": "2019-03-22T21:02:15.097663Z"
    }
   },
   "outputs": [],
   "source": [
    "a.schema = {\n",
    "    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n",
    "    \"definitions\": {\n",
    "        \"float\": {\n",
    "            \"pattern\": \"^-?[0-9]+\\\\.[0-9]{2}$\"\n",
    "        },\n",
    "        \"url\": {\n",
    "            \"pattern\": \"^https?://(www\\\\.)?[a-z0-9.-]*\\\\.[a-z]{2,}([^<>%\\\\x20\\\\x00-\\\\x1f\\\\x7F]|%[0-9a-fA-F]{2})*$\"\n",
    "        }\n",
    "    },\n",
    "    \"additionalProperties\": False,\n",
    "    \"type\": \"object\",\n",
    "    \"properties\": {\n",
    "        \"category\": {\"type\": \"string\", \"tag\": [\"category\"]},\n",
    "        \"price\": {\"type\": \"string\", \"pattern\": \"^£\\d{2}.\\d{2}$\"},\n",
    "        \"_type\": {\"type\": \"string\"},\n",
    "        \"description\": {\"type\": \"string\"},\n",
    "        \"title\": {\"type\": \"string\", \"tag\": [\"unique\"]},\n",
    "        \"_key\": {\"type\": \"string\"}\n",
    "    },\n",
    "    \"required\": [\n",
    "        \"_key\",\n",
    "        \"_type\",\n",
    "        \"category\",\n",
    "        \"description\",\n",
    "        \"price\",\n",
    "        \"title\"\n",
    "    ]\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:02:15.808566Z",
     "start_time": "2019-03-22T21:02:15.625333Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a34baa764b0b43e1848f439512f2d3b7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(IntProgress(value=0, description='JSON Schema Validation', max=1000, style=ProgressStyle(descri…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "JSON Schema Validation:\n",
      "\u001b[31m\u001b[0m\t1000 items were checked, 1 error(s)\u001b[0m\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "2 items affected - description is not of type 'string': <a href='https://app.scrapinghub.com/p/381798/1/1/item/259'>259</a> <a href='https://app.scrapinghub.com/p/381798/1/1/item/979'>979</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<br>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "a.validate_with_json_schema()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Or if your job is really big you can use almost 100x faster [backend](https://github.com/horejsek/python-fastjsonschema)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6aa54d11042344ca8539624acbf3fee5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(IntProgress(value=0, description='JSON Schema Validation', max=1000, style=ProgressStyle(descri…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "JSON Schema Validation:\n",
      "\u001b[31m\u001b[0m\t1000 items were checked, 1 error(s)\u001b[0m\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "2 items affected - data.description must be string: <a href='https://app.scrapinghub.com/p/381798/1/1/item/259'>259</a> <a href='https://app.scrapinghub.com/p/381798/1/1/item/979'>979</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<br>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "a.glance()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We already got something! Let's execute the whole thing again to see how `category` tag works."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-03-22T21:02:20.766381Z",
     "start_time": "2019-03-22T21:02:18.838290Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eabf41a5c1574c50b6baa99e4523b0b9",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(IntProgress(value=0, description='JSON Schema Validation', max=1000, style=ProgressStyle(descri…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Job Outcome:\n",
      "\tFinished\n",
      "\n",
      "Job Errors:\n",
      "\tNo errors\n",
      "\n",
      "Responses Per Item Ratio:\n",
      "\tNumber of responses / Number of scraped items - 1.05\n",
      "\n",
      "Fields Coverage:\n",
      "\tPASSED\n",
      "\n",
      "JSON Schema Validation:\n",
      "\u001b[31m\u001b[0m\t1000 items were checked, 1 error(s)\u001b[0m\n",
      "\n",
      "Tags:\n",
      "\tUsed - category, unique\n",
      "\tNot used - name_field, product_price_field, product_price_was_field, product_url_field\n",
      "\n",
      "Compare Price Was And Now:\n",
      "\tproduct_price_field or product_price_was_field tags were not found in schema\n",
      "\n",
      "Uniqueness:\n",
      "\u001b[31m\u001b[0m\t'title' contains 1 duplicated value(s)\u001b[0m\n",
      "\n",
      "Duplicated Items:\n",
      "\t'name_field' and 'product_url_field' tags were not found in schema\n",
      "\n",
      "Coverage For Scraped Categories:\n",
      "\t50 categories in 'category'\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Fields Coverage (1 message(s)):\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><div id=\"c5eb7bd9-8638-4900-992a-874e61ee6f8a\" style=\"height: 450px; width: 100%;\" class=\"plotly-graph-div\"></div><script type=\"text/javascript\">window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";\n",
       "if (document.getElementById(\"c5eb7bd9-8638-4900-992a-874e61ee6f8a\")) {\n",
       "    Plotly.newPlot(\"c5eb7bd9-8638-4900-992a-874e61ee6f8a\", [{\"orientation\": \"h\", \"x\": [1000, 1000, 1000, 998], \"y\": [\"title\", \"price\", \"category\", \"description\"], \"type\": \"bar\", \"uid\": \"2ace7664-cc65-41ca-98c8-82720f840232\"}], {\"annotations\": [{\"showarrow\": false, \"text\": \"99.80%\", \"x\": 0, \"xref\": \"paper\", \"y\": \"description\", \"yref\": \"y\"}, {\"showarrow\": false, \"text\": \"100.00%\", \"x\": 0, \"xref\": \"paper\", \"y\": \"category\", \"yref\": \"y\"}], \"bargap\": 0.1, \"height\": 450, \"hovermode\": \"y\", \"margin\": {\"l\": 200, \"t\": 35}, \"template\": {\"data\": {\"barpolar\": [{\"marker\": {\"line\": {\"color\": \"rgb(237,237,237)\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"bar\": [{\"marker\": {\"line\": {\"color\": \"rgb(237,237,237)\", \"width\": 0.5}}, \"type\": \"bar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"rgb(51,51,51)\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"rgb(51,51,51)\"}, \"baxis\": {\"endlinecolor\": \"rgb(51,51,51)\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"rgb(51,51,51)\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"choropleth\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"contourcarpet\"}], \"contour\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"contour\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"heatmapgl\"}], \"heatmap\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"heatmap\"}], \"histogram2dcontour\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"histogram2dcontour\"}], \"histogram2d\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"histogram2d\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"histogram\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"parcoords\"}], \"scatter3d\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattermapbox\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterpolargl\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterpolar\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatter\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"rgb(237,237,237)\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"rgb(217,217,217)\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowhead\": 0, \"arrowwidth\": 1}, \"colorscale\": {\"sequential\": [[0, \"rgb(20,44,66)\"], [1, \"rgb(90,179,244)\"]], \"sequentialminus\": [[0, \"rgb(20,44,66)\"], [1, \"rgb(90,179,244)\"]]}, \"colorway\": [\"#F8766D\", \"#A3A500\", \"#00BF7D\", \"#00B0F6\", \"#E76BF3\"], \"font\": {\"color\": \"rgb(51,51,51)\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"rgb(237,237,237)\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"white\"}, \"hovermode\": \"closest\", \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"rgb(237,237,237)\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"bgcolor\": \"rgb(237,237,237)\", \"radialaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"zaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}}, \"shapedefaults\": {\"fillcolor\": \"black\", \"line\": {\"width\": 0}, \"opacity\": 0.3}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"baxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"bgcolor\": \"rgb(237,237,237)\", \"caxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}}}, \"title\": {\"text\": \"Fields coverage for 1_000 items\"}, \"xaxis\": {\"range\": [0, 1050.0]}}, {\"showLink\": false, \"linkText\": \"Export to plot.ly\", \"plotlyServerURL\": \"https://plot.ly\"}); \n",
       "}\n",
       "</script><script type=\"text/javascript\">window.addEventListener(\"resize\", function(){if (document.getElementById(\"c5eb7bd9-8638-4900-992a-874e61ee6f8a\")) {Plotly.Plots.resize(document.getElementById(\"c5eb7bd9-8638-4900-992a-874e61ee6f8a\"));};})</script></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "JSON Schema Validation (1 message(s)):\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "2 items affected - description is not of type 'string': <a href='https://app.scrapinghub.com/p/381798/1/1/item/259'>259</a> <a href='https://app.scrapinghub.com/p/381798/1/1/item/979'>979</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<br>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Uniqueness (1 message(s)):\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "2 items affected - same 'The Star-Touched Queen' title: <a href='https://app.scrapinghub.com/p/381798/1/1/item/221'>221</a> <a href='https://app.scrapinghub.com/p/381798/1/1/item/341'>341</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<br>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Coverage For Scraped Categories (1 message(s)):\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><div id=\"6bb2d77e-aa50-4250-b67f-ba536407bb48\" style=\"height: 900px; width: 100%;\" class=\"plotly-graph-div\"></div><script type=\"text/javascript\">window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";\n",
       "if (document.getElementById(\"6bb2d77e-aa50-4250-b67f-ba536407bb48\")) {\n",
       "    Plotly.newPlot(\"6bb2d77e-aa50-4250-b67f-ba536407bb48\", [{\"orientation\": \"h\", \"x\": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 9, 10, 11, 11, 11, 12, 13, 14, 16, 17, 17, 18, 19, 19, 26, 29, 30, 32, 35, 48, 54, 65, 67, 75, 110, 152], \"y\": [\"Cultural\", \"Academic\", \"Parenting\", \"Crime\", \"Suspense\", \"Novels\", \"Short Stories\", \"Paranormal\", \"Erotica\", \"Adult Fiction\", \"Historical\", \"Politics\", \"Christian\", \"Contemporary\", \"Health\", \"Sports and Games\", \"Self Help\", \"Biography\", \"New Adult\", \"Christian Fiction\", \"Spirituality\", \"Psychology\", \"Religion\", \"Art\", \"Autobiography\", \"Humor\", \"Travel\", \"Thriller\", \"Philosophy\", \"Business\", \"Music\", \"Science\", \"Science Fiction\", \"Womens Fiction\", \"Horror\", \"History\", \"Poetry\", \"Classics\", \"Historical Fiction\", \"Childrens\", \"Food and Drink\", \"Mystery\", \"Romance\", \"Fantasy\", \"Young Adult\", \"Fiction\", \"Add a comment\", \"Sequential Art\", \"Nonfiction\", \"Default\"], \"type\": \"bar\", \"uid\": \"899afbd6-82b8-4343-bf17-14f3f361a6f5\"}], {\"bargap\": 0.1, \"height\": 900, \"hovermode\": \"y\", \"margin\": {\"l\": 200, \"t\": 35}, \"template\": {\"data\": {\"barpolar\": [{\"marker\": {\"line\": {\"color\": \"rgb(237,237,237)\", \"width\": 0.5}}, \"type\": \"barpolar\"}], \"bar\": [{\"marker\": {\"line\": {\"color\": \"rgb(237,237,237)\", \"width\": 0.5}}, \"type\": \"bar\"}], \"carpet\": [{\"aaxis\": {\"endlinecolor\": \"rgb(51,51,51)\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"rgb(51,51,51)\"}, \"baxis\": {\"endlinecolor\": \"rgb(51,51,51)\", \"gridcolor\": \"white\", \"linecolor\": \"white\", \"minorgridcolor\": \"white\", \"startlinecolor\": \"rgb(51,51,51)\"}, \"type\": \"carpet\"}], \"choropleth\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"choropleth\"}], \"contourcarpet\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"contourcarpet\"}], \"contour\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"contour\"}], \"heatmapgl\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"heatmapgl\"}], \"heatmap\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"heatmap\"}], \"histogram2dcontour\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"histogram2dcontour\"}], \"histogram2d\": [{\"autocolorscale\": true, \"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"histogram2d\"}], \"histogram\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"histogram\"}], \"mesh3d\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"mesh3d\"}], \"parcoords\": [{\"line\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"parcoords\"}], \"scatter3d\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatter3d\"}], \"scattercarpet\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattercarpet\"}], \"scattergeo\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattergeo\"}], \"scattergl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattergl\"}], \"scattermapbox\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scattermapbox\"}], \"scatterpolargl\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterpolargl\"}], \"scatterpolar\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterpolar\"}], \"scatter\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatter\"}], \"scatterternary\": [{\"marker\": {\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}}, \"type\": \"scatterternary\"}], \"surface\": [{\"colorbar\": {\"outlinewidth\": 0, \"tickcolor\": \"rgb(237,237,237)\", \"ticklen\": 6, \"ticks\": \"inside\"}, \"type\": \"surface\"}], \"table\": [{\"cells\": {\"fill\": {\"color\": \"rgb(237,237,237)\"}, \"line\": {\"color\": \"white\"}}, \"header\": {\"fill\": {\"color\": \"rgb(217,217,217)\"}, \"line\": {\"color\": \"white\"}}, \"type\": \"table\"}]}, \"layout\": {\"annotationdefaults\": {\"arrowhead\": 0, \"arrowwidth\": 1}, \"colorscale\": {\"sequential\": [[0, \"rgb(20,44,66)\"], [1, \"rgb(90,179,244)\"]], \"sequentialminus\": [[0, \"rgb(20,44,66)\"], [1, \"rgb(90,179,244)\"]]}, \"colorway\": [\"#F8766D\", \"#A3A500\", \"#00BF7D\", \"#00B0F6\", \"#E76BF3\"], \"font\": {\"color\": \"rgb(51,51,51)\"}, \"geo\": {\"bgcolor\": \"white\", \"lakecolor\": \"white\", \"landcolor\": \"rgb(237,237,237)\", \"showlakes\": true, \"showland\": true, \"subunitcolor\": \"white\"}, \"hovermode\": \"closest\", \"paper_bgcolor\": \"white\", \"plot_bgcolor\": \"rgb(237,237,237)\", \"polar\": {\"angularaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"bgcolor\": \"rgb(237,237,237)\", \"radialaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}}, \"scene\": {\"xaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"zaxis\": {\"backgroundcolor\": \"rgb(237,237,237)\", \"gridcolor\": \"white\", \"gridwidth\": 2, \"linecolor\": \"white\", \"showbackground\": true, \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}}, \"shapedefaults\": {\"fillcolor\": \"black\", \"line\": {\"width\": 0}, \"opacity\": 0.3}, \"ternary\": {\"aaxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"baxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}, \"bgcolor\": \"rgb(237,237,237)\", \"caxis\": {\"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\"}}, \"xaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}, \"yaxis\": {\"automargin\": true, \"gridcolor\": \"white\", \"linecolor\": \"white\", \"showgrid\": true, \"tickcolor\": \"rgb(51,51,51)\", \"ticks\": \"outside\", \"zerolinecolor\": \"white\"}}}, \"title\": {\"text\": \"category\"}, \"xaxis\": {\"range\": [0, 159.6]}}, {\"showLink\": false, \"linkText\": \"Export to plot.ly\", \"plotlyServerURL\": \"https://plot.ly\"}); \n",
       "}\n",
       "</script><script type=\"text/javascript\">window.addEventListener(\"resize\", function(){if (document.getElementById(\"6bb2d77e-aa50-4250-b67f-ba536407bb48\")) {Plotly.Plots.resize(document.getElementById(\"6bb2d77e-aa50-4250-b67f-ba536407bb48\"));};})</script></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "a.report_all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
