{"id":18795525,"url":"https://github.com/fmenabe/pypi-stats","last_synced_at":"2025-12-30T06:30:16.026Z","repository":{"id":147368573,"uuid":"114548857","full_name":"fmenabe/pypi-stats","owner":"fmenabe","description":"Simple tool for displaying downloads of PyPI packages.","archived":false,"fork":false,"pushed_at":"2018-02-03T15:47:48.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T16:54:56.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmenabe.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-17T15:49:56.000Z","updated_at":"2018-02-11T19:12:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"e57ef093-d287-45c1-9f5e-a597ca6fcffd","html_url":"https://github.com/fmenabe/pypi-stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmenabe%2Fpypi-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmenabe%2Fpypi-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmenabe%2Fpypi-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmenabe%2Fpypi-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmenabe","download_url":"https://codeload.github.com/fmenabe/pypi-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239720069,"owners_count":19686047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T21:34:24.149Z","updated_at":"2025-12-30T06:30:15.980Z","avatar_url":"https://github.com/fmenabe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**********\npypi-stats\n**********\n\n..\n    .. image:: https://img.shields.io/pypi/l/pypi-stats.svg\n               :target: https://opensource.org/licenses/MIT\n               :alt: License\n    .. image:: https://img.shields.io/badge/github-repo-yellow.jpg\n               :target: https://github.com/fmenabe/pypi-stats\n               :alt: Code repo\n\nSimple tool that shows PyPI downloads of packages by retrieving data from `Google\nBigQuery \u003chttps://cloud.google.com/bigquery/\u003e`_ and the ``[the-psf:pypi.downloads]``\npublic dataset.\n\n\nCreating a service account for using BigQuery\n=============================================\n\nThis is probably the hardest part!\n\nYou need to:\n\n    1) Go to the `Google API console \u003chttps://console.developers.google.com/apis/\u003e`_\n    2) Go to credentials and create new credentials. If you don't already have a project,\n       you will be asked to create one (the name of the project is not really important)\n    3) Create a **Service Account key** with the *BigQuery Job User* role (again the name\n       is not really important). It will ask you to download the JSON file you need to\n       authenticate to BigQuery.\n\n**Note: Take care that free usage of BigQuery is limited and it is easy to exceed quota!**\n\n\nInstallation\n============\n\n.. code::\n\n    pip install pypi-stats\n\n\nExamples\n========\n\n**Downloads since the start of the month:**:\n\n.. code::\n\n    pypi-stats -t TOKENPATH.json yamlordereddictloader clg\n    ┌───────────────────────┬─────────┬─────┬──────┬───────┐\n    │ Name                  │ Version │ Day │ Week │ Month │\n    ├───────────────────────┼─────────┼─────┼──────┼───────┤\n    │ clg                   │ 2.0.0   │ 2   │ 37   │ 37    │\n    │ clg                   │ *       │ 2   │ 37   │ 37    │\n    ├───────────────────────┼─────────┼─────┼──────┼───────┤\n    │ yamlordereddictloader │ 0.4.0   │ 42  │ 399  │ 399   │\n    │ yamlordereddictloader │ 0.3.0   │ -   │ 24   │ 24    │\n    │ yamlordereddictloader │ 0.2.2   │ 1   │ 12   │ 12    │\n    │ yamlordereddictloader │ 0.1.1   │ -   │ 31   │ 31    │\n    │ yamlordereddictloader │ 0.1.0   │ -   │ 14   │ 14    │\n    │ yamlordereddictloader │ *       │ 43  │ 480  │ 480   │\n    └───────────────────────┴─────────┴─────┴──────┴───────┘\n\n**Downloads since the start of the year:**\n\n.. code::\n\n    pypi-stats -t TOKENPATH.json --year clg\n    ┌───────────────────────┬─────────┬─────┬──────┬───────┬──────┐\n    │ Name                  │ Version │ Day │ Week │ Month │ Year │\n    ├───────────────────────┼─────────┼─────┼──────┼───────┼──────┤\n    │ clg                   │ 2.3.1   │ -   │ 3    │ -     │ 14   │\n    │ clg                   │ 2.3.0   │ -   │ -    │ -     │ 8    │\n    │ clg                   │ 2.0.0   │ 2   │ 77   │ 37    │ 537  │\n    │ clg                   │ *       │ 2   │ 80   │ 37    │ 559  │\n    └───────────────────────┴─────────┴─────┴──────┴───────┴──────┘\n\n**Save statistics in a JSON file:**\n\n.. code::\n\n    pypi-stats -t TOKENPATH.json --format json --output-file stats.json yamlordereddictloader clg\n\n**Re-use the JSON file to show statistics:**\n\n.. code::\n\n    pypi-stats --file stats.json\n    ┌───────────────────────┬─────────┬─────┬──────┬───────┐\n    │ Name                  │ Version │ Day │ Week │ Month │\n    ├───────────────────────┼─────────┼─────┼──────┼───────┤\n    │ clg                   │ 2.0.0   │ 2   │ 37   │ 37    │\n    │ clg                   │ *       │ 2   │ 37   │ 37    │\n    └───────────────────────┴─────────┴─────┴──────┴───────┘\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmenabe%2Fpypi-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmenabe%2Fpypi-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmenabe%2Fpypi-stats/lists"}