<jupyter_start><jupyter_text>Data for Pageview Mobile Web<jupyter_code>params = {'project' : 'en.wikipedia.org',
            'access' : 'mobile-web',
            'agent' : 'user',
            'granularity' : 'monthly',
            'start' : '2015070100',
            'end' : '2017093000'
            }

api_call = requests.get(endpoint.format(**params))
response_pw_mob_web = api_call.json()

with open('pageviews_mobile-web_201507-201709.json', 'w') as outfile:
    json.dump(response_pw_mob_web, outfile)

(pd.DataFrame.from_dict(data=response_pw_mob_web['items'], orient='columns').
to_csv('pageviews_mobile-web_201507-201709.csv', header=True))<jupyter_output><empty_output><jupyter_text>Data for Pageview Mobile App<jupyter_code>params = {'project' : 'en.wikipedia.org',
            'access' : 'mobile-app',
            'agent' : 'user',
            'granularity' : 'monthly',
            'start' : '2015070100',
            'end' : '2017093000'
            }

api_call = requests.get(endpoint.format(**params))
response_pw_mob_app = api_call.json()

with open('pageviews_mobile-app_201507-201709.json', 'w') as outfile:
    json.dump(response_pw_mob_app, outfile)

import pandas as pd

(pd.DataFrame.from_dict(data=response_pw_mob_app['items'], orient='columns').
to_csv('pageviews_mobile-app_201507-201709.csv', header=True))<jupyter_output><empty_output><jupyter_text>Data for Pageview Desktop<jupyter_code>params = {'project' : 'en.wikipedia.org',
            'access' : 'desktop',
            'agent' : 'user',
            'granularity' : 'monthly',
            'start' : '2015070100',
            'end' : '2017093000'
            }

api_call = requests.get(endpoint.format(**params))
response_pw_desktop = api_call.json()

with open('pageviews_desktop_201507-201709.json', 'w') as outfile:
    json.dump(response_pw_desktop, outfile)

import pandas as pd

(pd.DataFrame.from_dict(data=response_pw_desktop['items'], orient='columns').
to_csv('pageviews_desktop_201507-201709.csv', header=True))<jupyter_output><empty_output><jupyter_text>Data for Pagecount Mobile<jupyter_code>endpoint = 'https://wikimedia.org/api/rest_v1/metrics/legacy/pagecounts/aggregate/{project}/{access}/{granularity}/{start}/{end}'
params = {'project' : 'en.wikipedia.org',
            'access' : 'mobile-site',
            'granularity' : 'monthly',
            'start' : '2008010100',
            'end' : '2016080100'
            }
api_call = requests.get(endpoint.format(**params))
response_pc_mobile = api_call.json()

with open('pagecounts_mobile_200801-201607.json', 'w') as outfile:
    json.dump(response_pc_mobile, outfile)

import pandas as pd

(pd.DataFrame.from_dict(data=response_pc_mobile['items'], orient='columns').
to_csv('pagecounts_mobile_200801-201607.csv', header=True))<jupyter_output><empty_output><jupyter_text>Data for Pagecount Desktop<jupyter_code>params = {'project' : 'en.wikipedia.org',
            'access' : 'desktop-site',
            'granularity' : 'monthly',
            'start' : '2008010100',
            'end' : '2016080100'
            }
api_call = requests.get(endpoint.format(**params))
response_pc_desktop = api_call.json()

with open('pagecounts_desktop_200801-201607.json', 'w') as outfile:
    json.dump(response_pc_desktop, outfile)

import pandas as pd

(pd.DataFrame.from_dict(data=response_pc_desktop['items'], orient='columns').
to_csv('pagecounts_desktop_200801-201607.csv', header=True))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1507959479015919, 'fraction_numerical': 0.06396526772793054, 'mean_word_length': 4.112426035502959, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '432867', 'license': 'MIT', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1185, 'n_words': 167, 'path': 'hcds-a1-data-curation.ipynb', 'repo_name': 'jahnavijasti/Page-Views-on-English-Wikipedia', 'size': '3455'}