Last active
June 6, 2019 13:46
-
-
Save kerel-fs/d8f14731cbe4ac8e6a016c1518f8c0ad to your computer and use it in GitHub Desktop.
Dannstadter Vergleichsfliegen 2019
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ID | CALL | CN | TYPE | HANDICAP | NAME | |
---|---|---|---|---|---|---|
FLRDF0E4E | D-0553 | 2A | Std. Libelle | 98 | Felix Maier | |
FLRDD93E8 | D-7826 | 4P | LS 4 | 104 | M.Laubender & M.Engisch | |
FLRDDB0CD | D-0894 | 4R | LS 4 | 104 | R.Fürderer & J.Medic | |
FLRDD9641 | D-0266 | 66 | ASK 13 | 79 | K.H.Müller & K.Müller | |
FLR3F0487 | D-9200 | 7J | LS 7 WL | 107 | Ch.Müller & J.Kiefer | |
FLRDDC010 | D-1372 | 7S | DG 300 | 105 | Juli Goll | |
FLRDD92E3 | D-0002 | CH | LS 7 WL | 107 | R.Hähndel & G.Sturm | |
FLRDD8443 | D-8568 | CL | ASK 21 | 92 | Team K.Leitner/S.Lorenz/LSeitz/Y.Strickler | |
FLRDDA8A8 | D-3693 | I | ASW-15 | 97 | Mika Zeyen | |
FLRDF1045 | D-5549 | IH | LS 4 | 104 | Frank Donnermeyer | |
FLRDDA30B | D-0914 | JF | Std. Libelle | 98 | Jana Schmidt | |
FLR0D9206 | D-9206 | JO | Ka 6CR | 82 | Wolfgang Zeyen | |
FLR3F05B0 | D-9497 | KT | Std. Cirrus | 99 | Stefan Schneider | |
FLRDDAF16 | D-8649 | R9 | LS 4 | 104 | A.Marcks & S.Gieß | |
FLRDD9266 | D-3717 | RP | LS 1 f | 100 | Sophie Müller | |
FLRDD51FF | D-0141 | S1 | Std. Libelle | 99 | Johannes Flieger | |
FLRDDB2CF | D-9413 | SM | LS 1 f Neo | 101 | Jan Bischoff | |
FLRDDD9AB | D-4891 | UB | ASW 15 | 97 | Christoph Kauf | |
FLRDDD820 | D-4621 | V1 | SB 5 E | 88 | Rene Kernbach | |
FLRDDE801 | D-6944 | W | Std. Libelle | 98 | Steffen Rogoll | |
FLRDDA30B | D-0914 | X4 | LS 4 | 104 | Fabian Pascal Schmidt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ID | CALL | CN | TYPE | HANDICAP | NAME | |
---|---|---|---|---|---|---|
FLRDD9C14 | 04 | Glasflugel 304 | 110 | Stephan Schnell | ||
FLR3A1FFF | 1G | Ventus 2 | 114 | Henrik Bieler | ||
ICA3ECBFF | D-KSFF | 63 | ASG 32Mi | 114 | Frank Fröhlich & M.Dupont & W.Decker & A.-L.Ludwig | |
FLRD004B2 | AG | JS 3-18m J | 121 | Bernd Hubka | ||
FLR3ED542 | D-KVSK | AI | Ventus bT/15m | 110 | Stefan Kuse | |
FLRDD9A37 | D-0274 | C1 | Ventus 2 | 114 | Peter Lutz | |
FLRDDA83F | D-6508 | DL | Duo Discus | 110 | Team D. Sailler & M.Grohe & A.Schottmüller & L. Hildebrandt | |
FLRDD9C1D | DR | Ventus 2 | 114 | Marc Schick | ||
FLRDDFE77 | EL | DG 200/17 | 109 | Alfred Perlich | ||
FLRDDA260 | D-KLEO | EO | LS 8 18m T | 114 | Jan Hertrich | |
FLRDD7295 | GIU | DG 1000T/20m | 110 | Team J.Schliephake & V.Schliephake & M.Ott & F.Müller | ||
FLRDDBFDE | D-6233 | GT | ASW 28 | 108 | Jochen Kuhn | |
FLRDDA36C | KB | Ventus bT/15m | 110 | Sebastian Bethge | ||
FLRDD9FBB | D-1524 | KD | Duo Discus | 110 | J.Schmidt & H.Rupp | |
FLRDD9612 | D-3976 | L8 | LS8 15 m | 108 | D.Lott & K.Goll | |
FLRDDF16B | LT | ASG 29 15m | 114 | Laurenz Theisinger | ||
FLRDD876F | D-0598 | MR | Kestrel 17m | 110 | M.Wallmer & L.Krause | |
RI | DG 1000T/20m | 110 | N.Kratz & P.Sobucki | |||
FLRDF0FD3 | D-3571 | SI | Ls 8 15m Neo | 108 | Johannes Dibbern | |
FLRDDF16B | T | JS 3-15m | 116 | Georg Theisinger | ||
FLRDDA79C | D-4169 | XL | Duo Discus | 110 | Team S.Theis & C.Theis & V.Stutzer | |
FLRDD99BC | D 8556 | XR | Glasflugel 304 | 110 | Juergen Sottung | |
FLRDD8713 | D-5574 | XXX | Duo Discus XL | 111 | Team A.Boml & H.Kreuzer & M.Deichmann | |
FLRDDEBCB | D-KSDG | YH | DG 1000T/20m | 110 | Team M.Althaus & M.Schmitt & M.Karl & J.Thomas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import sys | |
import logging | |
import requests | |
from bs4 import BeautifulSoup | |
soaringspot_pilots_url = "https://www.soaringspot.com/en_gb/{}/pilots" | |
def get_competitors(competition_name): | |
r = requests.get(soaringspot_pilots_url.format(competition_name)) | |
r.raise_for_status() | |
soup = BeautifulSoup(r.text, 'html.parser') | |
table = soup.find('table') | |
table_rows = table.find_all('tr') | |
competitors = [] | |
for tr in table_rows[1:]: | |
td = tr.find_all('td') | |
row = [i.text for i in td] | |
competitors.append({'CN': row[0], | |
'Contestant': row[1], | |
'Club': row[2], | |
'Glider': row[3], | |
'Class': row [4], | |
'Handicap': row[5]}) | |
return competitors | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser(description="Fetch the list of competitors of a given competition" | |
"hosted on soaringspot.com and generate an ogn-web-viewer-compatible" | |
"tracking filter file for the selected class.") | |
parser.add_argument('competition_name', type=str, help="Name of the competition as given in the soaringspot-URLs.") | |
parser.add_argument('selected_class', type=str, help="Competition class the list should be compiled for, e.g.: Club") | |
parser.add_argument('--sort-by', metavar="KEY", type=str, help="Sort by the given KEY, e.g.: CN") | |
args = parser.parse_args() | |
try: | |
competitors = get_competitors(args.competition_name) | |
except requests.exceptions.HTTPError: | |
logging.error("Couldn't fetch the competitors list from soaringspot.") | |
sys.exit(-1) | |
classes = set([c['Class'] for c in competitors]) | |
if not args.selected_class in classes: | |
logging.error('Selected competition class not found, only the following classes are available: {}'.format(classes)) | |
sys.exit(-1) | |
if args.sort_by: | |
competitors = sorted(competitors, key= lambda k: k[args.sort_by]) | |
print("ID,CALL,CN,TYPE,HANDICAP,NAME") | |
for c in competitors: | |
if c['Class'] != args.selected_class: | |
continue | |
print("{},{},{},{},{},{}".format("", "", c['CN'], c['Glider'], c['Handicap'], c['Contestant'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
import pandas as pd | |
# Load vergleichsfliegen filter list for Flarm-IDs | |
filter_list_url = "http://helpdesk.ssv-lu.de/vergleichsfliegen/ogn/competitors_club.php" | |
pilots = pd.read_csv(filter_list_url, keep_default_na=False, index_col=2) | |
pilots['device_id'] = pilots['ID'].apply(lambda k: k[2:].upper()) | |
# NOTE: The following step requires the previous creation of the file with: | |
# ./fetch_soaringspot_competitors_list.py --sort-by CN 34-dannstadter-vergleichsfliegen-ludwigshafen-2019 Club > competitors_club_soaringspot.lst | |
# Load soaringspot competitor list for pilot names and handicap | |
soaringspot = pd.read_csv("competitors_club_soaringspot.lst", keep_default_na=False, index_col=2) | |
soaringspot = soaringspot.drop(['ID', 'CALL'], axis=1) | |
m = pd.merge(soaringspot, pilots['device_id'], on="CN", how="left") | |
# Manually add missing or wrong IDs | |
m.at['JO', 'device_id'] = "0D9206" # source: IGC file 4.WT | |
m.at['7S', 'device_id'] = "DDC010" # source: OGN-DDB | |
m.at['X4', 'device_id'] = "DDA84A" # source: OGN-DDB | |
# Load DDB for the registration | |
r = requests.get("http://ddb.glidernet.org/download/?j=1") | |
ddb_devices = pd.DataFrame(r.json()['devices']) | |
m = pd.merge(m.reset_index(), ddb_devices[['device_id', 'registration']], on='device_id', how='left') | |
m = m.set_index('CN') | |
m.at['7J', 'registration'] = "D-9200" # source: 4.WT, OLC | |
m.at['IH', 'registration'] = "D-5549" # source: 4.WT, OLC | |
m.at['JO', 'registration'] = "D-9206" # source: 4.WT, OLC | |
m.at['S1', 'registration'] = "D-0141" # source: 3.WT, OLC | |
m.at['SM', 'registration'] = "D-9413" # source: OLC, https://www.onlinecontest.org/olc-3.0/gliding/flightinfo.html?dsId=7099455 | |
# Generate the filter list for ogn-web-viewer | |
print("ID,CALL,CN,TYPE,HANDICAP,NAME") | |
for k,v in m.iterrows(): | |
print("FLR{},{},{},{},{},{}".format(v['device_id'], v['registration'], k, v['TYPE'], v['HANDICAP'], v['NAME'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beautifulsoup4==4.7.1 | |
opensoar==0.1.3 | |
pandas==0.24.2 | |
requests==2.22.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 103, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import os\n", | |
"import re\n", | |
"import requests\n", | |
"import pandas as pd\n", | |
"from bs4 import BeautifulSoup" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 74, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"soaringspot_daily_url = 'https://www.soaringspot.com/en_gb/{}/results/{}/{}/daily'\n", | |
"soaringspot_base_url = 'https://www.soaringspot.com'\n", | |
"\n", | |
"def soaringspot_fetch_daily_results(competition, selected_class, task):\n", | |
" r = requests.get(soaringspot_daily_url.format(competition, selected_class, task))\n", | |
" \n", | |
" soup = BeautifulSoup(r.text, 'html.parser')\n", | |
" table = soup.find('table')\n", | |
" table_rows = table.find_all('tr')\n", | |
"\n", | |
" results = []\n", | |
" for tr in table_rows[1:]:\n", | |
" td = tr.find_all('td')\n", | |
" row = [i.text.strip() for i in td]\n", | |
" \n", | |
" op_tag = td[1].find('span')\n", | |
" if op_tag:\n", | |
" direction = op_tag.find('i')['class'][1][9:]\n", | |
" if direction == 'up':\n", | |
" op = int(row[1])\n", | |
" else:\n", | |
" op = -int(row[1])\n", | |
" else:\n", | |
" op = 0\n", | |
" igc_link_tag = td[2].find('a')\n", | |
" if igc_link_tag:\n", | |
" igc_file = '{}{}'.format(soaringspot_base_url, igc_link_tag['href'])\n", | |
" else:\n", | |
" igc_file = None\n", | |
"\n", | |
" results.append({'#': row[0],\n", | |
" 'OP': op,\n", | |
" 'CN': row[2],\n", | |
" 'Contestant': row[3],\n", | |
" 'Team': row[4],\n", | |
" 'Club': row[5],\n", | |
" 'Glider': row[6],\n", | |
" 'Handicap': row[7],\n", | |
" 'Start': row[8],\n", | |
" 'Finish': row[9],\n", | |
" 'Time': row[10],\n", | |
" 'Speed': row[11],\n", | |
" 'Distance': row[12],\n", | |
" 'Points': row[13],\n", | |
" 'igc_file': igc_file})\n", | |
"\n", | |
" return results" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 75, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"results = soaringspot_fetch_daily_results('34-dannstadter-vergleichsfliegen-ludwigshafen-2019',\n", | |
" 'club',\n", | |
" 'task-4-on-2019-06-02')\n", | |
"df = pd.DataFrame.from_records(results, index='#')['igc_file']" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 79, | |
"metadata": { | |
"scrolled": true | |
}, | |
"outputs": [], | |
"source": [ | |
"df = pd.DataFrame.from_records(results, index='#')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 80, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# pd.options.display.max_rows, pd.options.display.max_colwidth = (60,50)\n", | |
"pd.set_option('display.max_colwidth', 100)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 83, | |
"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>CN</th>\n", | |
" <th>igc_file</th>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>#</th>\n", | |
" <th></th>\n", | |
" <th></th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>1.</th>\n", | |
" <td>W</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238479</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2.</th>\n", | |
" <td>2A</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238475</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3.</th>\n", | |
" <td>66</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238470</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4.</th>\n", | |
" <td>X4</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238480</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5.</th>\n", | |
" <td>IH</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238467</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6.</th>\n", | |
" <td>UB</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238472</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7.</th>\n", | |
" <td>JO</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238484</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>8.</th>\n", | |
" <td>KT</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238482</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>9.</th>\n", | |
" <td>4P</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238474</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>10.</th>\n", | |
" <td>JF</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238481</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>11.</th>\n", | |
" <td>V1</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238473</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>12.</th>\n", | |
" <td>I</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238483</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>13.</th>\n", | |
" <td>RP</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238476</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>14.</th>\n", | |
" <td>7J</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238466</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>15.</th>\n", | |
" <td>R9</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238464</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>16.</th>\n", | |
" <td>4R</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238477</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>17.</th>\n", | |
" <td>7S</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238469</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>18.</th>\n", | |
" <td>CH</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238478</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>18.</th>\n", | |
" <td>CL</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238471</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>20.</th>\n", | |
" <td>S1</td>\n", | |
" <td>https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238468</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>DNF</th>\n", | |
" <td>SM</td>\n", | |
" <td>None</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" CN \\\n", | |
"# \n", | |
"1. W \n", | |
"2. 2A \n", | |
"3. 66 \n", | |
"4. X4 \n", | |
"5. IH \n", | |
"6. UB \n", | |
"7. JO \n", | |
"8. KT \n", | |
"9. 4P \n", | |
"10. JF \n", | |
"11. V1 \n", | |
"12. I \n", | |
"13. RP \n", | |
"14. 7J \n", | |
"15. R9 \n", | |
"16. 4R \n", | |
"17. 7S \n", | |
"18. CH \n", | |
"18. CL \n", | |
"20. S1 \n", | |
"DNF SM \n", | |
"\n", | |
" igc_file \n", | |
"# \n", | |
"1. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238479 \n", | |
"2. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238475 \n", | |
"3. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238470 \n", | |
"4. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238480 \n", | |
"5. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238467 \n", | |
"6. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238472 \n", | |
"7. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238484 \n", | |
"8. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238482 \n", | |
"9. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238474 \n", | |
"10. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238481 \n", | |
"11. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238473 \n", | |
"12. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238483 \n", | |
"13. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238476 \n", | |
"14. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238466 \n", | |
"15. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238464 \n", | |
"16. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238477 \n", | |
"17. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238469 \n", | |
"18. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238478 \n", | |
"18. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238471 \n", | |
"20. https://www.soaringspot.com/en_gb/download-contest-flight/2724-5531238468 \n", | |
"DNF None " | |
] | |
}, | |
"execution_count": 83, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"df[['CN', 'igc_file']]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 102, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"output_path = '/mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/'" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 93, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"962_W.igc\n" | |
] | |
} | |
], | |
"source": [ | |
"print()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 105, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Written 962_W.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/W.igc.\n", | |
"Written 962_2A.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/2A.igc.\n", | |
"Written 962_66.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/66.igc.\n", | |
"Written 962_X4.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/X4.igc.\n", | |
"Written 962_IH.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/IH.igc.\n", | |
"Written 962_UB.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/UB.igc.\n", | |
"Written 962_JO.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/JO.igc.\n", | |
"Written 962_KT.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/KT.igc.\n", | |
"Written 962_4P.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/4P.igc.\n", | |
"Written 962_JF.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/JF.igc.\n", | |
"Written 962_V1.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/V1.igc.\n", | |
"Written 962_I.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/I.igc.\n", | |
"Written 962_RP.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/RP.igc.\n", | |
"Written 962_7J.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/7J.igc.\n", | |
"Written 962_R9.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/R9.igc.\n", | |
"Written 962_4R.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/4R.igc.\n", | |
"Written 962_72.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/7S.igc.\n", | |
"Written 962_CH.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/CH.igc.\n", | |
"Written 962_CL.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/CL.igc.\n", | |
"Written 962_S1.igc to /mnt/old_home/kerel/Fliegen/scoring/aeroscore/fixtures/2019-Dannstadt/club-4wt/S1.igc.\n" | |
] | |
} | |
], | |
"source": [ | |
"\n", | |
"for place, details in df.iterrows():\n", | |
" if not details['igc_file']:\n", | |
" continue\n", | |
"\n", | |
" r = requests.get(details['igc_file'])\n", | |
" server_filename = re.findall(\"filename=(.+)\", r.headers[\"Content-Disposition\"])[0][1:-1]\n", | |
" \n", | |
" if r.status_code != 200:\n", | |
" continue\n", | |
" \n", | |
" filename = os.path.join(output_path, '{}.igc'.format(details['CN']))\n", | |
" with open(filename, 'wb') as f:\n", | |
" f.write(r.content)\n", | |
"\n", | |
" print('Written {} to {}.'.format(server_filename, filename))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "ipy3 2019 Dannstadt Env", | |
"language": "python", | |
"name": "2019_dannstadt_env" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.7.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment