Skip to content

Instantly share code, notes, and snippets.

@ankostis
Created November 17, 2020 04:06
Show Gist options
  • Save ankostis/e8fb19d1d364426f9d677e9c6c6b9702 to your computer and use it in GitHub Desktop.
Save ankostis/e8fb19d1d364426f9d677e9c6c6b9702 to your computer and use it in GitHub Desktop.
Nyrros API error
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"## To autoreload codein python files here.\n",
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"## Auto-format cells to ease diffs.\n",
"%load_ext lab_black"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import io\n",
"import itertools as itt\n",
"import logging\n",
"import os\n",
"import re\n",
"import sys\n",
"from collections import abc, namedtuple\n",
"from pathlib import Path\n",
"from pathlib import PurePosixPath as P\n",
"from typing import Any, Callable, Dict, Mapping, List\n",
"from typing import Sequence as Seq\n",
"from typing import Tuple, Union\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"import qgrid\n",
"from columnize import columnize\n",
"from matplotlib import pyplot as plt\n",
"from pandas import HDFStore\n",
"from pandas import IndexSlice as idx\n",
"from pandas.core.generic import NDFrame\n",
"from pandas.testing import *\n",
"\n",
"idx = pd.IndexSlice\n",
"log = logging.getLogger(\"ipynb.nyrros-covid19\")\n",
"logging.getLogger(\"blib2to3\").propagate = False # Disable `lab_black` logs.\n",
"logging.basicConfig(\n",
" level=logging.DEBUG,\n",
" format=\"%(asctime)s|%(levelname)5.5s|%(name)s:[%(funcName)s]:\\n +--> %(message)s\",\n",
" datefmt=\"%Y-%m-%d,%H:%M:%S\",\n",
")\n",
"pd.set_option(\"display.max_columns\", 64, \"display.max_rows\", 130)\n",
"\n",
"NamedTuple = tuple"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"import pickle\n",
"import os.path\n",
"from googleapiclient.discovery import build\n",
"from google_auth_oauthlib.flow import InstalledAppFlow\n",
"from google.auth.transport.requests import Request\n",
"\n",
"\n",
"def google_sheets(\n",
" credentials_fpath=\"credentials.json\",\n",
" scopes=(\"https://www.googleapis.com/auth/spreadsheets.readonly\",),\n",
"):\n",
" \"\"\"\n",
" Authenticates and returns a google-service endpoint.\n",
" \"\"\"\n",
" creds = None\n",
" # The file token.pickle stores the user's access and refresh tokens, and is\n",
" # created automatically when the authorization flow completes for the first\n",
" # time.\n",
" if os.path.exists(\"token.pickle\"):\n",
" with open(\"token.pickle\", \"rb\") as token:\n",
" creds = pickle.load(token)\n",
" # If there are no (valid) credentials available, let the user log in.\n",
" if not creds or not creds.valid:\n",
" if creds and creds.expired and creds.refresh_token:\n",
" creds.refresh(Request())\n",
" else:\n",
" flow = InstalledAppFlow.from_client_secrets_file(credentials_fpath, scopes)\n",
" creds = flow.run_local_server(port=0)\n",
" # Save the credentials for the next run\n",
" with open(\"token.pickle\", \"wb\") as token:\n",
" pickle.dump(creds, token)\n",
"\n",
" service = build(\"sheets\", \"v4\", credentials=creds)\n",
"\n",
" return service"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2020-11-17,06:01:34|DEBUG|google.auth.transport.requests:[__call__]:\n",
" +--> Making request: POST https://oauth2.googleapis.com/token\n",
"2020-11-17,06:01:34|DEBUG|urllib3.connectionpool:[_new_conn]:\n",
" +--> Starting new HTTPS connection (1): oauth2.googleapis.com:443\n",
"2020-11-17,06:01:35|DEBUG|urllib3.connectionpool:[_make_request]:\n",
" +--> https://oauth2.googleapis.com:443 \"POST /token HTTP/1.1\" 200 None\n",
"2020-11-17,06:01:35|WARNI|googleapiclient.discovery_cache:[autodetect]:\n",
" +--> file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\n",
"Traceback (most recent call last):\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py\", line 33, in <module>\n",
" from oauth2client.contrib.locked_file import LockedFile\n",
"ModuleNotFoundError: No module named 'oauth2client'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py\", line 37, in <module>\n",
" from oauth2client.locked_file import LockedFile\n",
"ModuleNotFoundError: No module named 'oauth2client'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/__init__.py\", line 44, in autodetect\n",
" from . import file_cache\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py\", line 40, in <module>\n",
" raise ImportError(\n",
"ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\n",
"2020-11-17,06:01:35|DEBUG|googleapiclient.discovery:[_retrieve_discovery_doc]:\n",
" +--> URL being requested: GET https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest\n",
"2020-11-17,06:01:36|DEBUG|googleapiclient.discovery:[method]:\n",
" +--> URL being requested: GET https://sheets.googleapis.com/v4/spreadsheets/1qwlNmmN7FS1iGCgvwD9mj53HxjOCX7CfDA7BRn_zU6I/values/%CE%9D%CE%BF%CE%BC%CE%BF%CE%AF%21A1%3AES74?alt=json\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Κρούσματα ημέρας ανά νομό, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 4/7, 5/7, 6/7, 7/7, 8/7, 9/7, 10/7, 11/7, 12/7, 13/7, 14/7, 15/7, 16/7, 17/7, 18/7, 19/7, 20/7, 21/7, 22/7, 23/7, 24/7, 25/7, 26/7, 27/7, 28/7, 29/7, 30/7, 31/7, 1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 8/8, 9/8, 10/8, 11/8, 12/8, 13/8, 14/8, 15/8, 16/8, 17/8, 18/8, 19/8, 20/8, 21/8, 22/8, 23/8, 24/8, 25/8, 26/8, 27/8, 28/8, 29/8, 30/8, 31/8, 1/9, 2/9, 3/9, 4/9, 5/9, 6/9, 7/9, 8/9, 9/9, 10/9, 11/9, 12/9, 13/9, 14/9, 15/9, 16/9, 17/9, 18/9, 19/9, 20/9, 21/9, 22/9, 23/9, 24/9, 25/9, 26/9, 27/9, 28/9, 29/9, 30/9, 1/10, 2/10, 3/10, 4/10, 5/10, 6/10, 7/10, 8/10, 9/10, 10/10, 11/10, 12/10, 13/10, 14/10, 15/10, 16/10, 17/10, 18/10, 19/10, 20/10, 21/10, 22/10, 23/10, 24/10, 25/10, 26/10, 27/10, 28/10, 29/10, 30/10, 31/10\n",
", , , , , , , , , , , , , , , , , , , , , , , , , , , , , 25, 9, 43, 33, 33, 50, 60, 41, 31, 24, 58, 27, 35, 28, 26, 24, 11, 36, 32, 33, 26, 31, 27, 35, 52, 57, 65, 78, 110, 75, 77, 121, 124, 153, 151, 152, 153, 123, 196, 262, 204, 254, 230, 217, 150, 269, 217, 251, 209, 264, 284, 170, 168, 293, 259, 270, 177, 157, 183, 207, 233, 241, 202, 187, 143, 156, 166, 248, 372, 287, 302, 207, 180, 310, 310, 359, 339, 240, 170, 453, 346, 358, 342, 286, 314, 218, 269, 418, 354, 411, 443, 267, 228, 303, 399, 407, 436, 391, 306, 280, 294, 408, 436, 453, 508, 473, 438, 438, 667, 865, 882, 841, 935, 790, 717, 1259, 1547, 1211, 1654, 2054\n",
"Πύλες και αυτοβούλως, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 11, 7, 36, 24, 24, 27, 42, 26, 7, 7, 34, 9, 18, 16, 16, 18, 5, 5, 14, 15, 10, 11, 8, 9, 11, 13, 34, 17, 12, 9, 10, 12, 24, 18, 12, 25, 33, 36, 26, 29, 23, 22, 41, 18, 25, 49, 22, 19, 17, 31, 19, 36, 23, 32, 31, 32, 21, 44, 10, 21, 26, 31, 10, 31, 25, 14, 16, 23, 27, 15, 23, 30, 23, 14, 26, 37, 40, 34, 15, 27, 28, 46, 30, 37, 20, 43, 12, 63, 29, 33, 28, 28, 29, 34, 40, 27, 19, 40, 32, 26, 43, 52, 36, 30, 18, 20, 32, 50, 52, 55, 56, 43, 48, 33, 54, 66, 53, 38, 38, 26\n",
"Αττικής, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , 1, 3, 3, 7, 7, 9, 6, 2, 8, 8, 10, 3, 3, 2, 2, 17, 6, 11, 8, 9, 7, 17, 14, 18, 11, 24, 19, 19, 28, 26, 22, 40, 46, 26, 35, 38, 82, 66, 64, 98, 47, 73, 46, 98, 89, 90, 76, 91, 141, 51, 45, 103, 107, 112, 54, 50, 107, 97, 87, 118, 86, 68, 51, 101, 65, 98, 133, 158, 133, 120, 102, 197, 174, 212, 164, 99, 89, 174, 210, 194, 213, 163, 165, 118, 197, 240, 195, 272, 207, 123, 97, 167, 213, 194, 219, 161, 165, 141, 145, 170, 201, 207, 227, 207, 164, 175, 250, 331, 290, 290, 228, 227, 260, 295, 419, 335, 422, 464\n",
"Π.Ε. Θεσσαλονίκης, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , 6, 8, 3, 5, 3, 7, 5, 3, 2, 2, 2, 3, 4, 8, 4, 5, 4, 1, 2, 9, 11, 7, 18, 37, 15, 7, 47, 22, 38, 38, 43, 38, 18, 42, 85, 37, 67, 65, 37, 30, 70, 44, 67, 49, 51, 11, 18, 24, 54, 25, 27, 32, 16, 9, 29, 17, 12, 16, 20, 9, 3, 9, 17, 18, 19, 33, 9, 8, 22, 26, 18, 12, 5, 11, 5, 19, 10, 11, 11, 17, 8, 4, 12, 12, 7, 5, 11, 9, 2, 8, 16, 33, 25, 11, 19, 6, 36, 38, 56, 63, 78, 53, 49, 125, 181, 188, 197, 217, 181, 84, 291, 384, 275, 540, 839\n",
"Π.Ε. Αιτωλοακαρνανίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , 2, , , , 1, 1, , 2, , , 2, , 3, , , , , , , , , 2, , , 1, 1, 1, 5, 3, 2, 1, 2, 3, , 1, 1, 2, , , , , 1, , , , , , 2, 1, 1, 1, 1, 1, 1, , 2, 2, 2, 1, 1, 6, 7, 4, 11, , 1, , 4, 2, 5, , 1, , 3, 4, 12, 2, 2, , 1, 4, 4, 4, 6, 6, 2\n",
"Π.Ε. Αργολίδας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , , 2, , 4, , 8, 4, 2, 2, , , , 1, , 2, , , 1, 1, , 1, , , , 1, , 1, , 2, 1, , , 1, 1, 1, 1, 1, 2, 1, , 1, , , , 1, 5, 4, 2, , , , 1, , , 1, 1, , , 2, 1, 1, , , , , , 1, 1, , 1, 2, 3, 1, 4, 3, 3, 1, 1, 3, 3, , 1, 1, 2, 1\n",
"Π.Ε. Αρκαδίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , 1, 1, , , , , , , 2, , , , 1, 3, , , , 1, , , , , , , , , , , , , , 1, , , , , , , , , , 1, , , , , , , 5, , , , , , , , , 1, , , , 2, , , , , 1, , , , , , , , , , , , , 3, , 6, , 5, 3, 5, 3, 2, 8\n",
"Π.Ε. Άρτας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, , , , , 2, , , , , , , , 1, , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , 1, 2, , 1, 1, , , , , 3, 1, , 5, 2, 1, , 4, 3\n",
"Π.Ε. Αχαΐας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , 1, , , 3, 2, 4, 1, 2, , 1, , , 1, , 2, 2, , , , , , 1, 4, , , 3, 2, , , , 4, 5, , 2, 2, , 5, 1, , 1, 2, , 2, 2, 1, 5, , , , , 2, 1, , 1, 4, 1, 1, 2, 4, , , 5, 4, 1, 3, 6, 1, 2, 5, 9, 9, 5, 11, 6, 6, 12, 11, 9, 8, 5, 9, 5, 1, 5, 4, 7, 7, 6, 4, 6, 10, 9, 12, 4, 6, 16, 18, 10, 13, 14, 9\n",
"Π.Ε. Βοιωτίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , 2, 1, , , 1, 3, 1, , , , , , , 1, 1, 1, 1, , , 1, , , 1, , , , , , , , 1, 1, 1, , 1, , , , , 1, 1, 1, , 7, , 1, , 1, 1, 2, , , 1, 1, , , , , , , 4, 3, 5, , 1, 2, 4, 9, , , , 1, 2, 3, 6, 2, , 3, 3, 8, 5, 4, , 10, 1, 4, 30, 10, 7, 2, 5, , 6, 4, 6, 3, 9, 4\n",
"Π.Ε. Γρεβενών, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , 1, , , , , , , , , 2, , , , , , 1, , 1, , , 1, 1, , , 1, 1, 1, 1, 1, , , 2, , , 1, 1, , , , 2, 1, 1, 2, 1, 1, , 2, , 3, , , , , , , 3, 1, , , 1, 2, , 2, , , , , , , , , , 2, , 1, 2, , 2\n",
"Π.Ε. Δράμας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, 2, , , 1, , , , , 1, , , , , , , , , , , , , , , , , , , 1, 1, , 1, , 1, , , 1, , , 3, 2, , , 1, 2, 1, , 2, , , 5, 1, , 2, , , , 4, , 1, , 1, , , , , 4, , , , , 3, , , , , , , , , , , , 2, , 1, , , 4, 1, , , , 2, 2, , , 1, 2, , 1, , , 2, , 2, , 2, 6, 14, 13, , 18, 34, 24, 33, 54\n",
"Π.Ε. Δωδεκανήσου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , 1, , , , , , , , 1, 3, 2, , , 2, , , 2, 1, 2, 2, 2, 1, 5, 6, 1, , , , , , , 1, 1, 2, 3, 2\n",
"Π.Ε. Καρπάθου-Κάσου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , , , , , , , , , , , , , 1\n",
"Π.Ε. Κω, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , 1, , , , , , , , , , , , , , , 1, , , , , , , , 1, 1, 1, , 1, , 1, , , , , 1, 1\n",
"Π.Ε. Ρόδου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, 1, , , 2, , , 3, , , , , 1, 2, , 1, 1, , , 1, 1, , , , , 1, , 1, 1, , , , 1, 4, , 9, 1, , 1, 1, 2, , 2, 1, 2, 1, 9, 5, 3, 6, 4\n",
"Π.Ε. Έβρου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 9, 1, 18, 4, 17, 5, , 1, 2, 1, 5, 9, 10, 11, , 1, 1, , 1, 1, 7, 1, , 6, 1, , , , , , 1, 2, , , , , , 1, , 1, 3, 1, 1, 1, 1, 1, 2, 2, , , 1, , , , 1, 1, , , , , 1, 2, 1, 1, , 1, 1, , , 1, 1, , 1, 4, 5, 2, , , 1, 4, 3, 7, 11, 19, 3, 20, 26, 23, 34, 24\n",
"Π.Ε. Εύβοιας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , 1, , , , , , 2, 1, , , , , , , 2, 1, 1, , 1, , 1, , , , , , , , 1, 1, , 1, , 1, , 1, 1, , , , 1, , 1, 1, 5, 1, , 1, 2, , 2, , 1, , , , , , 2, , , 2, 3, 3, 3, 1, 2, 5, , 5, 9, 12, 10, 9, , , 1, 1, 1, , 2, 3, 2, 4, 4, 13, 2, 5, 6, 6, 2, 7, 1, 3, 5, 3\n",
"Π.Ε. Ευρυτανίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , 1, , , , 1, , , , , 1, , , , , , , 1, , , , , , , , , , , , , , , , , , , , , 4, , , , , , , , 1\n",
"Π.Ε. Ζακύνθου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , , , , 2, , , , , , , , , , , , , 1, , 1, , , , 1, 1, , , 1, , , , 3, 5, , 2, 1, 2, 1, 2, 8, , , , , 3, 3, 1, 3, , , , , , , , , 1, , , , , , , , 3, , 1, , , , , 1, , , , 1, , , , , , , , , , , , , , , 1\n",
"Π.Ε. Ηλείας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, , , , 1, , 1, 2, 5, , 1, 3, 3, 2, 1, , , 1, 1, , , , , 1, , , , , , , 1, 1, , , , , , , , 1, 1, , , , , , 1, 1, , , , , , , 1, , , , , , , 1, 1, 3, 8, 2, 1, , 1, , 5, 1, , 3, , 9, 3, 2, 3, , 1, , 8, , 1, 1, 1\n",
"Π.Ε. Ημαθίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , 5, 1, 1, , , , , , , , , , , 1, , , 2, 1, , , , 1, , 2, 2, , 1, 4, , , , 3, 2, 3, 1, 1, 5, 6, 6, 7, 3, 5, 3, 1, 4, 9, 7, 6, 3, , 8, 7, 15, 6, 7, 5, , 5, 6, 9, 8, 7, 4, 1, 4, 3, 2, 5, 4, , , , 5, 1, , , 1, , , 3, 3, , , , , 2, , 6, 1, 2, , , , 6, 1, 4, 3, 2, , 3, 1, 3, 5, 2, 13, 4, 5, 13, 12, 13, 24, 21\n",
"Π.Ε. Ηρακλείου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, , , 1, 1, , , 1, , , , , , , , 2, 1, , , , 2, , 2, 3, 2, 2, 2, 2, 4, 10, 3, , , 4, 2, 3, 2, 4, 10, 3, 5, 4, 4, 11, 2, 5, 9, 9, 7, 4, 7, 4, 3, , 7, 3, 1, 13, 1, 4, 7, 3, 2, 3, , , 6, 4, , 2, , , , 1, 5, 2, 2, 1, , 1, 1, 1, 4, , 1, 5, , 1, 1, 6, 5, , 6, 1, 8, 6, 10, 8, 5, 11, 4, 7, 6, 13, 10, 14\n",
"Π.Ε. Θάσου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3\n",
"Π.Ε. Θεσπρωτίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , 1, , 1, 1, , , , , 2, , , , , , 2, , 2, , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , 4, 1, , 2, 1, 3, , , 1, 2, , 2, 4, 3, 4, 4\n",
"Π.Ε. Ιθάκης\n",
"Π.Ε. Ικαρίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1\n",
"Π.Ε. Ιωαννίνων, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , 2, , 2, , , 1, , , 1, 3, 1, , 1, , 3, 1, 1, 1, 1, 1, 1, 1, , 3, 3, 6, 3, 4, 3, 3, 3, , 1, 3, 2, 9, , 1, 2, , 3, 1, 3, 7, 12, 1, 1, 2, 2, 7, 6, 6, 4, 12, 8, 4, 2, 10, 6, 9, 8, 12, 26, 20, 23, 27, 15, 15, 13, 19, 18, 31, 13, 23, 8, 15, 32, 23, 19, 30, 36, 52, 21, 51, 18, 24, 19\n",
"Π.Ε. Καβάλας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, 2, , , , , , , , , , , , , , , 1, , 1, 2, 4, 7, 3, 2, 23, 13, 4, 1, 8, 2, , 6, 2, 1, 2, , , 1, 1, 2, , , 1, , 1, 1, 2, 2, 3, 1, 1, 3, 3, 1, 3, 1, 2, 1, , , 1, , , , , 1, , 2, , , , 1, 2, 1, , , 1, , , , , , , , , 1, 2, , 1, , , , , 1, 1, , , 1, 2, , 5, 3, 1, 7, 10, 8, 5, 8, 12, 5, 6, 12, 13, 19, 33, 27\n",
"Π.Ε. Καλύμνου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, 1, , 1, , , , , 4, , , , , , , , , , , , , , , , , , 1, , , 1, , , , , 1\n",
"Π.Ε. Καρδίτσας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , 1, , 1, 2, 1, 4, 7, 2, 5, 10, 5, 2, , 2, 3, 4, 4, 1, , , 4, 1, 6, 1, , , , 4, , 2, 3, , , 2, 1, 1, 1, 2, , 1, , 3, , 1, 5, 3, 1, 4, 10, , 10, 2, 6, 2, 9, , , 1, 1, 1, 1, 1, , 3, 1, 1, , 1, , , 1, 4, 4, 1, 7, 9, 5, 11, 11, 21\n",
"Π.Ε. Καστοριάς, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, 1, , 2, 2, , , , 1, 4, , 1, , , , , , , , , , , , , , , , , , 1, , , 1, , , 1, 1, 3, , 3, 1, , 2, 2, , , 1, , 1, 4, 2, 2, , , , , , 1, , , , , , , 3, , , , 14, 2, , , , , 2, 3, 3, 1, , , 2, 2, 3, 4, 3, 2, 1, 3, 6, , , , , 2, , , 5, 3, 1, , 9, 17, 17, 5, 20, 17, 10, 5, 5, 9, 15, 16, 27, 5, 8, 2, 15, 14, 11, 9\n",
"Π.Ε. Κέρκυρας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, , 3, 1, 5, 7, 1, 3, 3, 2, 7, 2, 1, 1, , , 9, 2, 1, 1, 2, 2, 1, 1, , 1, 1, 2, 1, , 1, , , , , , , 1, , , 1, 1, , 1, , 1, 1, , 3, , , 1, , , 3, , , 2, , , , , , 2, 5, 2, 2, 2, , 1, 1, 2, 3, 4, 1, 6, 4, , 5, 1, 2, 5, 2, 2, 2, 5, 4, 2, 5, 12, 4, , 8, 6\n",
"Π.Ε. Κεφαλληνίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , 2, , , , 2, 1, 1, 1, , , , , , 3, , , , , , , , , , , , 1, , 1, , , , , , , 4, , 2, , , 2, , 1, , , , , 1, , , , , , , , , , , , , , 1, , , , , , , , , , , , , 1\n",
"Π.Ε. Κιλκίς, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , 1, , 1, , , 1, 1, 2, 3, 1, 1, 1, , 1, 5, , 1, , , 1, , , 1, , 1, , , 9, 1, , 2, , , , 13, 2, , , , , , 1, , 2, , , , 2, , , , , , , , , , , 1, , , 2, 2, 10, 2, 1, , , 4, 5, 2, , 3, 3, 1, 2, 5, 4, 5, 15, 9, , 11, 13, 14, 9, 18\n",
"Π.Ε. Κοζάνης, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , 6, , 1, , 1, , , , , , , , , , 1, , , , 1, 2, , 1, , 1, 2, 1, 1, 1, , , 1, 1, 1, , 2, 2, 1, 2, 2, 3, 4, 5, 2, 15, 2, 9, 7, 9, 6, 2, 9, 3, 1, 5, 4, 4, 6, 3, , 1, 7, 7, 4, 5, 2, 4, 3, 5, 9, 8, , 1, 11, , 1, 7, 4, 3, 5, 4, 5, 6, 4, 7, 5, 21, 3, 29, 18, 23, 11, 14, 19, 35, 29, 22, 24, 24, 33, 21, 20, 27, 10, 20, 30, 15, 11, 12, 8, 30, 19, 20\n",
"Π.Ε. Κορινθίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , 1, , , 1, 1, 3, , , 3, 1, , 2, 2, , 1, 1, , , , , 3, , , 1, 2, , , , 1, 1, 1, 1, , 1, 5, 4, 1, 3, 2, , , , 1, , , , , , , 3, 1, 3, , 2, 2, 1, , 1, 2, , , , 1, , 3, 3, 2, 5, 4, 4, 8, 8, 11, 2, 5, 9, 8, 5, 2, 1, 1, 6, 6, 7, 2, 1, 1, 2, 7, 6, 5, 5, 5, , 3\n",
"Π.Ε. Κυκλάδων, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , 1, 9, , 1, 3, , 2, 3, 4, 3, 3, 5, 1, 10, 5, , 3, 11, 20, 5, 8, 9, 4, 10, 2, 2, 7, 1, 2, 1, 4, 7, 1\n",
"Π.Ε. Άνδρου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1\n",
"Π.Ε. Μήλου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, , , , , , , , , , , , , 1\n",
"Π.Ε. Θήρας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , 1, 1, 1, 3, 1, , 1, , 1, , , 1, , , , , , 1, , 1, 2, 1, 1, , , , 1, , 4, , 1, 2, , 2, , , , , 1, , 1, 1, 2, 2, 1, 1, , 3, 1\n",
"Π.Ε. Κέας-Κύθνου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, , , , , , , 1, 6, , 1, , 1, , , , 1, , 1, , , , , , 1, , , 1, 1, , , , , , , , 1\n",
"Π.Ε. Μυκόνου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, 1, , , 1, , , , , , , , , , , , , , , , , , , 1, , , , 1, , , , 1, , , , , , 1, 1, , 1, 1, , , , , 2, 1, , , , 1\n",
"Π.Ε. Νάξου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, 1, , 1, , , , , , , , , , 1, , , , 1, , , , 1, , 1, , 1, 2, 1, , , 1, , 3, 1, 3, , , 6, 3, 5, 2, 3, , 6, 1, 2\n",
"Π.Ε. Σύρου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , 1, 2, , , 1\n",
"Π.Ε. Τήνου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , 1, , , 1, , , , , , , , , , 1, , , , , , , , , , , , , , 1, , , , , , , , 1\n",
"Π.Ε. Πάρου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , 1, , , , , , , 1, , , , 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1\n",
"Π.Ε. Λακωνίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, , , , , , , , , , , , , , , , , , , , , , , 1, , , , 1, , , , , , , , , 1, , , , , , 2, , , 32, , , , 2, , , 1, , , , 1, , 3, 1, 4, 1, , , , , 1, , , , 2, , 1, , , , , , , 1, 1\n",
"Π.Ε. Λάρισας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, , , , , , , , , , , , 1, 1, 1, , , 2, , , , , , , , , , , 1, , , 8, 8, 14, 6, 10, 8, , 7, 5, 12, 6, 2, 1, 7, 2, 3, , 2, 3, 8, , 1, 4, 5, 2, 1, 1, , 1, 2, , 1, , 4, , 8, 4, 2, 1, 4, 3, 4, 1, 1, 2, 17, 3, , 7, 3, 7, 4, , 4, , 3, 7, 6, 6, 2, 9, 6, 3, 3, 2, 7, 7, 7, 3, 2, 2, 7, 4, 14, 8, 19, 6, 16, 23, 40, 25, 37, 32, 41, 47, 61, 51, 89, 70\n",
"Π.Ε. Λασιθίου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , 1, , , , , , , , 1, 6, 1, , , , 1, , , , , , , , , , , 1, 1, , , , , , , , , , , 2, , , , , , , , , , , , , , , 1, , , , , , , , , , , , 1, , , , , 1, , , , 2, 3, 1, 2\n",
"Π.Ε. Λέσβου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, , , , , , , , , , , , , , 4, , , 1, , , 1, , , , 1, 2, , , , , 2, 3, , 1, 1, , 3, 8, 6, 2, 12, 3, 12, 3, 22, 8, 3, 7, 3, 3, 4, 1, 1, 4, 2, 5, 23, 15, 6, 3, 4, 2, 3, 15, 7, 6, 13, 22, , 184, , 17, 1, , , , 1, 2, 2, 5, , 1, 2, 2, 11, 5, 2, 5, 2, 2, 3, , 7, , 2, 6, 3, 1, 1, 6, 17, 1, 5, 1, 1, 6, 5, 7, 2, 14\n",
"Π.Ε. Λευκάδας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , 2, , 2, , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , 1, , , , , , , , , 1, , , , , , , , , , , , , , , , 1, , , 1, , 3, , , , , 1, , 2, 1\n",
"Π.Ε. Λήμνου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , 1\n",
"Π.Ε. Μαγνησίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, 2, 1, , , 1, 1, 1, , , 1, 2, , 1, 1, 6, , 1, , 6, 2, 3, 3, 1, 5, , 11, 3, , 3, 3, , 2, 3, , 1, 7, 3, 1, 2, 1, , 1, 2, , , , 2, , 1, , , , , 1, , , , 1, , , 1, , 2, 2, , , , 1, , , , 2, , 1, , 1, , 4, , 2, 3, 1, 4, 2, 1, 1, 1, 2, 1, 2, 8, 3, 1, 1, 2, 3, 7, 9, 8, 7, 5, 8, 10, 8, 11, 15\n",
"Π.Ε. Μεσσηνίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , 3, 1, 1, , 1, 1, , , 1, , , 2, , 5, , 2, 1, , , , 3, 2, , , , 1, , , , , 2, , , 1, , 1, , 1, , , , , 1, , , 1, , 1, , 1, , 1, , , 1, , , , , , , , , , 3, 1, 1, 4, 3, 4, 9, 8, 12, 2, 12, 7, 10, 30, 38, 8\n",
"Π.Ε. Ξάνθης, , , , , , , , , , , , , , , , , , , , , , , , , , , , , 5, 1, 4, 1, 1, 6, 1, 2, , 6, 2, 1, , 2, , , , 2, 1, 1, , 2, , , , , 2, , , 2, , , , , , , 1, , 1, 7, 1, , 1, 1, , , 5, , 2, 4, , , 1, , 1, 3, 1, 1, , , , 4, , , , , 1, , , , 3, 1, , , , 2, , , , , 2, 1, , , , , , , , , 1, , , , 5, 2, 1, , 2, , 1, 2, , 1, , 1, , , , 3, 4, 6, 3, 11, 3, 15, 8, 30, 20, 31\n",
"Π.Ε. Πέλλας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , 1, 1, , 1, 1, 1, 3, 4, 3, 1, 3, 2, 7, 1, 4, 5, 2, 1, 2, 1, 8, 11, 3, 1, 4, 6, 4, 6, 10, 7, 1, 2, 5, 6, 6, 10, 8, 9, , 6, 25, 70, 18, 46, 5, 5, 9, 11, 7, , 4, 3, 1, 2, 7, 4, , 5, 5, , 4, 13, 5, 117, 6, 8, 3, 10, 6, 10, 5, 4, 3, 3, 1, 2, 8, 4, 6, 6, 4, 10, 9, 5, 4, 14, 12, , 20, 34, 15, 29, 17\n",
"Π.Ε. Πιερίας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , 2, 1, , , 1, , 1, 2, 2, , 2, 5, 1, 3, 8, 8, , 1, , 2, 5, 1, 3, 3, 2, 5, 3, 1, 4, 6, , 2, 6, , 12, 1, 9, , 7, 5, 15, 14, 7, 2, 2, 6, 10, 10, 4, 6, 4, , 4, 1, 1, 2, 5, 3, , 5, 5, 6, 2, 2, , 4, 2, 5, 1, 1, 1, 2, , 2, 1, 4, , 1, , 4, 2, 7, 4, 4, 10, 14, , 7, 18, 12, 17, 25\n",
"Π.Ε. Πρέβεζας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 3, , 1, , 1, , , , 1, , , , , 1, , 1, 1, , 1, , , , , , 2, 2, , 1, , , , , , , , , , , 1, , 1, 1, , 2, , , , 2, , , , 1, 1, , 2, 2, , 1, 1, , 1, , 1, 1, , , 2, , , 1, 2, 4, 3, 2, 1, , , 6, 2, 1, , 1, 4, 8, 2\n",
"Π.Ε. Ρεθύμνης, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , 1, 1, 2, , 2, 1, 1, 1, , , 1, 3, 2, 2, 1, 1, , , 1, 3, 1, , 1, , , 1, 1, 3, 4, , , 3, 1, 1, , 2, , 1, 1, 1, , , , , , , , , , , , , , , 2, 1, 1, , , , , , 1, 1, 1, , 1, 2, 4, 2, , , 1, , , 2, 1, 2\n",
"Π.Ε. Ροδόπης, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , 1, , , , , , , , , , , , , , , , 1, , , , , , , , , 2, , 5, , , , 1, , 1, 2, , , , , , , , 1, 3, 1, , 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, 2, 2, 2, , 2, , 2, 1, , 1, , , 4, 2, 2, 1, 4, 1, 1, 4, 10, 10, 20, 24, 1, 73, 57, 41, 60, 65\n",
"Π.Ε. Σάμου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , 2, , , , , , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, , , , 2, , 1, 7, , 22, , 7, 17, 5, 5, 2, 5, , 18, 2, 1, 2, 3, 5, 4, 2, 1, , 5, 1, 3, 1, , 1, 1, , , , 1, 1, , , , 1, , 5, , , , 1\n",
"Π.Ε. Σερρών, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , , 1, , 3, 1, , 5, 1, 1, 1, 1, 1, , 1, 2, , 2, 1, 1, , , , 4, 2, , , 4, 3, 1, 4, 5, 2, 1, , , , , , , , , , , , , , 1, 1, 1, 7, 1, 1, , , , 3, , , , , , , , 1, 1, , 1, , 1, , 4, 8, 1, 8, 28, 10, 19, 65, 35, 54, 49, 31, 55, 158, 51, 32, 82\n",
"Π.Ε. Σποράδων, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , 1, , , , , , , , , , , , , , , 1, , 1, 2, , 2, , , 1, 1, 1, , , 1, , , 1, , , , , 3, 1\n",
"Π.Ε. Τρικάλων, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, 2, , 1, 1, , , 1, , 2, , , , , 1, 2, 2, 3, 1, , 1, 3, 1, , , , , 1, 2, 2, 3, 4, 11, 2, 2, 2, 1, 3, 2, 4, 7, 11, 4, 1, 18, 9, 13, 3, 18, 11, 8, 2, 7, 8, 3, 15, 4, 11, 1, 8, 8, 4, 1, 2, 1, , 1, 5, 2, 5, 5, , 5, 6, 4, 9, 7, 13, 4, 10, 19, 16, 5, 28, 8\n",
"Π.Ε. Φθιώτιδας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 2, , , , , 1, , , 2, , , , 1, 1, 2, , 1, 2, 3, 1, , , , , , , , , , , , , 1, 2, , , , 3, 4, , 3, 3, 2, , 1, 2, , 1, , , 1, 2, , 6, , , , 2, 2, 1, 2, 1, 1, 2, , 2, 2, , 2, 1, , , , 1, 11, , 6, 1, , 3, 2, 5, , 4, 1, 3, 5, 1, 5, , 2\n",
"Π.Ε. Φλώρινας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , 2, 2, , , 4, 4, , , , , , 1, , 3, 1, 3, , 1, , , , 1, , , 1, 1, , , , , , 1, , , 1, , , , , , 1, , 1, , , , , , 1, 1, , , 1, , 2, 1, , 2, 1, , 1, , 1, , 1, , , , , , 1, 1, 1, , 4, 1, 1, , 4, 2, 2, 2, 4, 3, 6, 5\n",
"Π.Ε. Φωκίδας, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 1, , , , , , 1, , , , , , , , 1, , , , , , , , , , , , , , , 1, , , , , , , , , , , , , , , , 1, , , , , , , , , 1, , , 1, , , 1, , , , , , , , , 1\n",
"Π.Ε. Χαλκιδικής, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , 1, , 1, , 1, 1, 1, 1, , , , , 1, , , 1, 1, , , 2, 3, 4, , 8, 2, 3, , 4, , 3, 5, 8, 4, 6, 3, 1, 2, 3, 1, 5, 4, 1, , , , 9, , 2, 1, , , 2, 5, 1, , 2, , , , , , , , , , , , 1, 3, 1, , , 3, 1, , , , , , 2, , 1, 3, 4, , 1, 1, 1, , 1, 6, , 2, 2, 1, 1, 1, 7, 2, 2, 1, 3, 4, 3, 6, 7, 2, 22, 9, 8, 24, 30\n",
"Π.Ε. Χανίων, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 2, , 1, 1, 1, 2, , , , , 1, , 3, 14, 2, 4, 2, , 2, 5, 4, 3, 3, 5, 9, 4, 5, 2, 4, 4, 3, , 2, 2, , , , , , 2, , , 2, , , 1, , 2, , , , , , , 2, , , , , , , 3, , , 1, 1, 1, 1, , 1, , 3, , , 1, 1, , , , , 4, , 2, 1, 5, 5, 4, 7, 7, 8\n",
"Π.Ε. Χίου, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, , , , , , , , , 1, 1, 1, 2, 3, , 4, 6, , , 2, 1, , , 2, 2, 2, 1, , , 3, 1, , 1, , , 1, , , 2, 1, , , , , 1, , , , , , , 1, , , , , , , 1, , , 1, , , 2, 1, , , 3, , 1, 3, 1, 3, 1, 2, 1, 3, 1, , 8, 4, 3, 2, 61, 3, 2, 3, 4\n",
"Υπό διερεύνηση, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 12, , , , , , , , , , 14, 5, 1, 6, 8, 3, 1, , 6, 2, 3, 12, , 7, , 1, , , 30, 6, 7, 1, 3, 6, 14, 16, 20, 17, 19, 19, 3, 13, 23, 11, 16, 4, 15, 12, 21, 14, , 16, 14, 18, 19, 17, 21, 9, 4, 6, 17, 17, 20, 20, 15, 20, 25, 19, 39, 41, 43, 46, 39, 22, 39, 43, 52, 52, , 61\n",
"Άγιο όρος, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 1\n"
]
}
],
"source": [
"def get_values(doc_id, range_name, service):\n",
" # Call the Sheets API\n",
" sheet = service.spreadsheets()\n",
" result = sheet.values().get(spreadsheetId=doc_id, range=range_name).execute()\n",
" values = result.get(\"values\", [])\n",
"\n",
" if not values:\n",
" raise ValueError(\"No data found.\")\n",
" return values\n",
"\n",
"\n",
"orig_doc_id = \"1vT9cTqa0SA8cWY6zgXGpVWgpTGqPJQT_\" # original\n",
"doc_id = \"1qwlNmmN7FS1iGCgvwD9mj53HxjOCX7CfDA7BRn_zU6I\"\n",
"g_srvc = google_sheets(credentials_fpath=\"GoogleApi-credentials-nyrros_covid19.json\")\n",
"values = get_values(doc_id, \"Νομοί!A1:ES74\", g_srvc)\n",
"\n",
"for row in values:\n",
" # Print columns A and E, which correspond to indices 0 and 4.\n",
" print(\", \".join(row))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2020-11-17,06:01:37|WARNI|googleapiclient.discovery_cache:[autodetect]:\n",
" +--> file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\n",
"Traceback (most recent call last):\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py\", line 33, in <module>\n",
" from oauth2client.contrib.locked_file import LockedFile\n",
"ModuleNotFoundError: No module named 'oauth2client'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py\", line 37, in <module>\n",
" from oauth2client.locked_file import LockedFile\n",
"ModuleNotFoundError: No module named 'oauth2client'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/__init__.py\", line 44, in autodetect\n",
" from . import file_cache\n",
" File \"/home/ankostis/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py\", line 40, in <module>\n",
" raise ImportError(\n",
"ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth\n",
"2020-11-17,06:01:37|DEBUG|googleapiclient.discovery:[_retrieve_discovery_doc]:\n",
" +--> URL being requested: GET https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest\n",
"2020-11-17,06:01:38|DEBUG|googleapiclient.discovery:[method]:\n",
" +--> URL being requested: GET https://sheets.googleapis.com/v4/spreadsheets/1vT9cTqa0SA8cWY6zgXGpVWgpTGqPJQT_/values/%CE%9D%CE%BF%CE%BC%CE%BF%CE%AF%21A1%3AES74?alt=json\n"
]
},
{
"ename": "HttpError",
"evalue": "<HttpError 400 when requesting https://sheets.googleapis.com/v4/spreadsheets/1vT9cTqa0SA8cWY6zgXGpVWgpTGqPJQT_/values/%CE%9D%CE%BF%CE%BC%CE%BF%CE%AF%21A1%3AES74?alt=json returned \"This operation is not supported for this document\">",
"output_type": "error",
"traceback": [
"\u001b[0;31m----------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mHttpError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-5b384a7a94b7>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;31m# doc_id = \"1qwlNmmN7FS1iGCgvwD9mj53HxjOCX7CfDA7BRn_zU6I\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mg_srvc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgoogle_sheets\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcredentials_fpath\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"GoogleApi-credentials-nyrros_covid19.json\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mvalues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_values\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdoc_id\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'Νομοί!A1:ES74'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mg_srvc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mrow\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mvalues\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m<ipython-input-4-94dcfa855c99>\u001b[0m in \u001b[0;36mget_values\u001b[0;34m(doc_id, range_name, service)\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;31m# Call the Sheets API\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0msheet\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mservice\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mspreadsheets\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msheet\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mspreadsheetId\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdoc_id\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrange_name\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mvalues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"values\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/_helpers.py\u001b[0m in \u001b[0;36mpositional_wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 132\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mpositional_parameters_enforcement\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mPOSITIONAL_WARNING\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 133\u001b[0m \u001b[0mlogger\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 134\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mwrapped\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 135\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 136\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mpositional_wrapper\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Work/wltp.git/.venv/lib/python3.8/site-packages/googleapiclient/http.py\u001b[0m in \u001b[0;36mexecute\u001b[0;34m(self, http, num_retries)\u001b[0m\n\u001b[1;32m 913\u001b[0m \u001b[0mcallback\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 914\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mresp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstatus\u001b[0m \u001b[0;34m>=\u001b[0m \u001b[0;36m300\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 915\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mHttpError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresp\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcontent\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muri\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0muri\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 916\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpostproc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresp\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcontent\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 917\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mHttpError\u001b[0m: <HttpError 400 when requesting https://sheets.googleapis.com/v4/spreadsheets/1vT9cTqa0SA8cWY6zgXGpVWgpTGqPJQT_/values/%CE%9D%CE%BF%CE%BC%CE%BF%CE%AF%21A1%3AES74?alt=json returned \"This operation is not supported for this document\">"
]
}
],
"source": [
"doc_id = \"1vT9cTqa0SA8cWY6zgXGpVWgpTGqPJQT_\" # original\n",
"# doc_id = \"1qwlNmmN7FS1iGCgvwD9mj53HxjOCX7CfDA7BRn_zU6I\"\n",
"g_srvc = google_sheets(credentials_fpath=\"GoogleApi-credentials-nyrros_covid19.json\")\n",
"values = get_values(doc_id, 'Νομοί!A1:ES74', g_srvc)\n",
"\n",
"for row in values:\n",
" # Print columns A and E, which correspond to indices 0 and 4.\n",
" print(\", \".join(row))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"orig_id = \"1vT9cTqa0SA8cWY6zgXGpVWgpTGqPJQT_\"\n",
"my_id = \"1qwlNmmN7FS1iGCgvwD9mj53HxjOCX7CfDA7BRn_zU6I\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# t = g_srvc.spreadsheets()\n",
"t.sheets()"
]
}
],
"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.8.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment