Created
February 25, 2016 10:49
-
-
Save BibMartin/3452f66261c633d19550 to your computer and use it in GitHub Desktop.
Test continuum repo consistency
This file contains hidden or 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
| import requests, re | |
| import numpy as np | |
| import pandas as pd | |
| out = pd.Series([]) | |
| for i in range(10): | |
| r = requests.get('https://repo.continuum.io/pkgs/free/linux-64/') | |
| assert r.ok | |
| libs = re.findall('<tr>\s*<td>.*?>(.*?)</a></td>', r.text, re.DOTALL) | |
| assert len(libs) == len(re.findall('<tr>\s*<td>(.*?)</td>', r.text, re.DOTALL)) | |
| out = out.append(pd.Series(libs, index=[i]*len(libs))) | |
| pb_list = (lambda x: np.sort(x[x<10].index.values).tolist())(out.value_counts()) | |
| print(out.value_counts().value_counts()) | |
| print '\n '.join(['-'*80]+pb_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment