Module Import alias Import alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias Assign NameStore Dict Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Str Str decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad Str Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad Str Num While CompareLtE NameLoad NameLoad body Expr Yield NameLoad AugAssignAdd NameStore NameLoad decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Str NameLoad NameLoad body Expr Str Assign NameStore BoolOpOr NameLoad Call AttributeLoad NameLoad attr If CompareIsNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore BoolOpOr NameLoad BinOpSub NameLoad Call NameLoad Num If CompareIsNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr Str Str comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad NameLoad keyword Str comprehension NameStore NameLoad Assign NameStore ListComp Call AttributeLoad Str attr ListLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Call NameLoad keyword Num Assign NameStore Call NameLoad NameLoad DictComp NameLoad DictComp NameLoad NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad For NameStore NameLoad body If CompareIn Str NameLoad body Assign NameStore NameLoad orelse Continue For NameStore SubscriptLoad NameLoad Index Str body Assign SubscriptStore SubscriptLoad NameLoad Index Call NameLoad SubscriptLoad NameLoad Index Str Index SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Return NameLoad handlers ExceptHandler body Print BinOpAdd Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Raise decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Str NameLoad NameLoad body Expr Str Assign NameStore BoolOpOr NameLoad Call AttributeLoad NameLoad attr If CompareIsNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore BoolOpOr NameLoad BinOpSub NameLoad Call NameLoad Num If CompareIsNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp Call AttributeLoad Str attr ListLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Str body Assign NameStore Call NameLoad keyword Num orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad keyword Num orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad keyword Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad DictComp NameLoad DictComp NameLoad NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad For NameStore NameLoad body If CompareIn Str NameLoad body Assign NameStore NameLoad orelse Continue For NameStore SubscriptLoad NameLoad Index Str body Assign SubscriptStore SubscriptLoad NameLoad Index Call NameLoad SubscriptLoad NameLoad Index Str Index SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Return NameLoad handlers ExceptHandler body Print BinOpAdd Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Raise decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad NameLoad Num body Expr Str Assign NameStore BinOpSub Call AttributeLoad NameLoad attr Call NameLoad keyword Num Assign NameStore Call NameLoad BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call NameLoad BoolOpOr NameLoad AttributeLoad NameLoad attr attr Num Str Assign NameStore Call AttributeLoad Call NameLoad BoolOpOr NameLoad AttributeLoad NameLoad attr attr Num Str Assign NameStore Call AttributeLoad Str attr ListLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If BoolOpAnd CompareIn Str NameLoad CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Num body Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Num Index Str Expr Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Str Return SubscriptLoad NameLoad Slice Num NameLoad handlers ExceptHandler body Print BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr Raise Raise Call NameLoad Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body With Call NameLoad AttributeLoad NameLoad attr NameStore body Assign NameStore Lambda arguments args NameParam defaults Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list
N/A N/A requests N/A traceback requests.utils quote datetime date datetime timedelta concurrent.futures ThreadPoolExecutor collections defaultdict N/A endpoints N/A article project top https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article https://wikimedia.org/api/rest_v1/metrics/pageviews/aggregate https://wikimedia.org/api/rest_v1/metrics/pageviews/top parse_date N/A N/A stringDate N/A N/A N/A N/A N/A datetime strptime N/A N/A stringDate ljust 10 0 %Y%m%d%H N/A format_date N/A N/A d N/A N/A N/A N/A N/A datetime strftime d %Y%m%d%H N/A timestamps_between N/A N/A start end increment N/A N/A N/A start N/A datetime N/A start year N/A start month N/A start day N/A getattr start hour 0 N/A end N/A datetime N/A end year N/A end month N/A end day N/A getattr end hour 0 N/A N/A start end N/A N/A N/A start N/A start increment N/A PageviewsClient N/A N/A __init__ N/A N/A self parallelism N/A 10 N/A N/A 
        Create a PageviewsClient

        :Parameters:
            parallelism : The number of parallel threads to use when making
                          multiple requests to the API at the same time
         N/A N/A self parallelism parallelism N/A article_views N/A N/A self project articles access agent granularity start end N/A all-access all-agents daily None None N/A N/A 
        Get pageview counts for one or more articles
        See `<https://wikimedia.org/api/rest_v1/metrics/pageviews/?doc\
                #!/Pageviews_data/get_metrics_pageviews_per_article_project\
                _access_agent_article_granularity_start_end>`_

        :Parameters:
            project : str
                a wikimedia project such as en.wikipedia or commons.wikimedia
            articles : list(str)
            access : str
                access method (desktop, mobile-web, mobile-app, or by default, all-access)
            agent : str
                user agent type (spider, user, bot, or by default, all-agents)
            end : str|date
                can be a datetime.date object or string in YYYYMMDD format
                default: today
            start : str|date
                can be a datetime.date object or string in YYYYMMDD format
                default: 30 days before end date

        :Returns:
            a nested dictionary that looks like: {
                start_date: {
                    article_1: view_count,
                    article_2: view_count,
                    ...
                    article_n: view_count,
                },
                ...
                end_date: {
                    article_1: view_count,
                    article_2: view_count,
                    ...
                    article_n: view_count,
                }
            }
            The view_count will be None where no data is available, to distinguish from 0

        TODO: probably doesn't handle unicode perfectly, look into it
         N/A endDate N/A end N/A N/A date today N/A N/A N/A type endDate date N/A N/A endDate N/A parse_date end N/A startDate N/A start N/A endDate N/A timedelta 30 N/A N/A N/A type startDate date N/A N/A startDate N/A parse_date start N/A articles N/A N/A N/A a replace _ N/A a articles N/A articlesSafe N/A N/A quote a safe N/A a articles N/A urls N/A N/A N/A / join N/A N/A endpoints N/A article project access agent a granularity N/A format_date startDate N/A format_date endDate N/A a articlesSafe N/A outputDays N/A timestamps_between startDate endDate N/A timedelta days 1 N/A output N/A defaultdict dict N/A day N/A a None N/A a articles N/A day outputDays N/A N/A N/A results N/A N/A self get_concurrent urls N/A some_data_returned False N/A result results N/A N/A N/A items result N/A N/A some_data_returned True N/A N/A N/A item N/A result N/A items N/A N/A N/A N/A output N/A N/A parse_date N/A item N/A timestamp N/A N/A item N/A article N/A item N/A views N/A N/A some_data_returned N/A N/A N/A Exception N/A N/A The pageview API returned nothing useful at: {} format urls N/A output N/A N/A N/A N/A N/A ERROR while fetching and parsing  N/A str urls N/A N/A N/A traceback print_exc N/A N/A project_views N/A N/A self projects access agent granularity start end N/A all-access all-agents daily None None N/A N/A 
        Get pageview counts for one or more wikimedia projects
        See `<https://wikimedia.org/api/rest_v1/metrics/pageviews/?doc\
                #!/Pageviews_data/get_metrics_pageviews_aggregate_project\
                _access_agent_granularity_start_end>`_

        :Parameters:
            project : list(str)
                a list of wikimedia projects such as en.wikipedia or commons.wikimedia
            access : str
                access method (desktop, mobile-web, mobile-app, or by default, all-access)
            agent : str
                user agent type (spider, user, bot, or by default, all-agents)
            granularity : str
                the granularity of the timeseries to return (hourly, daily, or monthly)
            end : str|date
                can be a datetime.date object or string in YYYYMMDDHH format
                default: today
            start : str|date
                can be a datetime.date object or string in YYYYMMDDHH format
                default: 30 days before end date

        :Returns:
            a nested dictionary that looks like: {
                start_date: {
                    project_1: view_count,
                    project_2: view_count,
                    ...
                    project_n: view_count,
                },
                ...
                end_date: {
                    project_1: view_count,
                    project_2: view_count,
                    ...
                    project_n: view_count,
                }
            }
            The view_count will be None where no data is available, to distinguish from 0
         N/A endDate N/A end N/A N/A date today N/A N/A N/A type endDate date N/A N/A endDate N/A parse_date end N/A startDate N/A start N/A endDate N/A timedelta 30 N/A N/A N/A type startDate date N/A N/A startDate N/A parse_date start N/A urls N/A N/A N/A / join N/A N/A endpoints N/A project p access agent granularity N/A format_date startDate N/A format_date endDate N/A p projects N/A N/A granularity hourly N/A N/A increment N/A timedelta hours 1 N/A N/A N/A granularity daily N/A N/A increment N/A timedelta days 1 N/A N/A N/A granularity monthly N/A N/A increment N/A timedelta months 1 N/A outputDays N/A timestamps_between startDate endDate increment N/A output N/A defaultdict dict N/A day N/A p None N/A p projects N/A day outputDays N/A N/A N/A results N/A N/A self get_concurrent urls N/A some_data_returned False N/A result results N/A N/A N/A items result N/A N/A some_data_returned True N/A N/A N/A item N/A result N/A items N/A N/A N/A N/A output N/A N/A parse_date N/A item N/A timestamp N/A N/A item N/A project N/A item N/A views N/A N/A some_data_returned N/A N/A N/A Exception N/A N/A The pageview API returned nothing useful at: {} format urls N/A output N/A N/A N/A N/A N/A ERROR while fetching and parsing  N/A str urls N/A N/A N/A traceback print_exc N/A N/A top_articles N/A N/A self project access year month day limit N/A all-access None None None 1000 N/A N/A 
        Get pageview counts for one or more articles
        See `<https://wikimedia.org/api/rest_v1/metrics/pageviews/?doc\
                #!/Pageviews_data/get_metrics_pageviews_top_project\
                _access_year_month_day>`_

        :Parameters:
            project : str
                a wikimedia project such as en.wikipedia or commons.wikimedia
            access : str
                access method (desktop, mobile-web, mobile-app, or by default, all-access)
            year : int
                default : yesterday's year
            month : int
                default : yesterday's month
            day : int
                default : yesterday's day
            limit : int
                limit the number of articles returned to only the top <limit>
                default : 1000

        :Returns:
            a sorted list of articles that looks like: [
                {
                    rank: <int>,
                    article: <str>,
                    views: <int>
                }
                ...
            ]
         N/A yesterday N/A N/A N/A date today N/A timedelta days 1 N/A year N/A str N/A year N/A yesterday year N/A month N/A N/A N/A str N/A month N/A yesterday month rjust 2 0 N/A day N/A N/A N/A str N/A day N/A yesterday day rjust 2 0 N/A url N/A N/A / join N/A N/A endpoints N/A top project access year month day N/A N/A N/A result N/A N/A N/A N/A requests get url json N/A N/A N/A items result N/A N/A len N/A result N/A items 1 N/A N/A r N/A N/A N/A result N/A items N/A 0 N/A articles N/A N/A N/A r sort key N/A N/A N/A x N/A N/A x N/A rank N/A N/A r N/A 0 limit N/A N/A N/A N/A N/A ERROR while fetching or parsing  url N/A N/A N/A traceback print_exc N/A N/A N/A Exception N/A N/A The pageview API returned nothing useful at: {} format url N/A get_concurrent N/A N/A self urls N/A N/A N/A N/A ThreadPoolExecutor N/A self parallelism executor N/A N/A f N/A N/A N/A url N/A N/A N/A N/A N/A requests get url json N/A N/A list N/A N/A executor map f urls N/A N/A