{"id":13539346,"url":"https://github.com/nchah/github-traffic-stats","last_synced_at":"2025-04-02T06:30:47.221Z","repository":{"id":50717738,"uuid":"67171570","full_name":"nchah/github-traffic-stats","owner":"nchah","description":"Get statistics on web traffic to your GitHub repositories.","archived":false,"fork":false,"pushed_at":"2023-11-06T16:03:17.000Z","size":77,"stargazers_count":122,"open_issues_count":13,"forks_count":31,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-06T04:13:45.520Z","etag":null,"topics":["github-traffic","traffic-stats"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/github-traffic-stats/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nchah.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2016-09-01T22:44:23.000Z","updated_at":"2025-02-22T10:44:10.000Z","dependencies_parsed_at":"2024-08-01T09:22:53.008Z","dependency_job_id":null,"html_url":"https://github.com/nchah/github-traffic-stats","commit_stats":{"total_commits":89,"total_committers":10,"mean_commits":8.9,"dds":0.4157303370786517,"last_synced_commit":"dd9d4c46a40e19c5adc0375ade235e95065ef20c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchah%2Fgithub-traffic-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchah%2Fgithub-traffic-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchah%2Fgithub-traffic-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nchah%2Fgithub-traffic-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nchah","download_url":"https://codeload.github.com/nchah/github-traffic-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246767641,"owners_count":20830528,"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":["github-traffic","traffic-stats"],"created_at":"2024-08-01T09:01:23.843Z","updated_at":"2025-04-02T06:30:46.937Z","avatar_url":"https://github.com/nchah.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"github-traffic-stats\n====================\n\n.. image:: https://travis-ci.org/nchah/github-traffic-stats.svg?branch=master\n    :target: https://travis-ci.org/nchah/github-traffic-stats\n\nGet statistics on web traffic to your GitHub repositories.\n\nPython CLI\n----------\n\nPython CLI tool to get web traffic stats on the command line using the\nGitHub API.\n\nA few use cases to show why this may be useful.\n\n-  Checking the volume of traffic to all of your repos. Monitor sudden\n   spikes in interest or any general patterns.\n-  Storing the traffic stats for future reference.\n-  Checking how often your code is cloned.\n\nInstallation\n------------\n\n::\n\n    pip install github_traffic_stats\n\nDependencies\n------------\n\n-  Requests (https://github.com/psf/requests)\n-  psycopg2 (https://github.com/psycopg/psycopg2)\n\nInstall the requirements by running: \n\n::\n\n    pip install -r requirements.txt\n\nThere are a number of GitHub `libraries`_ for Python and other\nlanguages, although they may not support the Repository Traffic API\n(announced on August 15, 2016).\n\nUsage\n-----\n\n::\n\n    usage: gts [-h] username [repo] [save_csv] [-o]\n       or: \n    usage: gts [-h] username:password [repo] [save_csv] [-o]\n\n    positional arguments:\n      username    Github username\n      password    Github password for 'username', or access token\n      repo        User's repo\n      save_csv    Set to \"no_csv\" if no CSV should be saved OR \"set_db\" to send to postgres\n\n    optional arguments:\n      -h, --help  show this help message and exit\n      -o, --organization specify Github organization if different from username\n      -print, --print-screen print CSV results to screen (default='True')\n      -hp, --host set database host and port [127.0.0.1:5432] (default='127.0.0.1:5432')\n      -usr, --db-user set database user and password [root:\"\"] (default='root:\"\"')\n      -name, --db-name  set database where data will be stored' (default='test')\n       \nInformation on `Github Access Tokens`_.\n\nRun\n---\n\nRun on the command line with either ``python`` or ``python3``.\n\n::\n\n    $ gts 'nchah' 'github-traffic-stats' 'save_csv'\n    Password:* (passwords are hidden)\n    \u003e github-traffic-stats - Visitors\n    Date        Views   Unique visitors\n    Totals      125     36\n    2017-07-16  1       1\n    2017-07-17  10      2\n    2017-07-19  11      4\n    2017-07-20  12      5\n    2017-07-21  3       3\n    2017-07-22  1       1\n    2017-07-23  1       1\n    2017-07-24  17      6\n    2017-07-25  32      5\n    2017-07-26  1       1\n    2017-07-27  1       1\n    2017-07-28  6       4\n    2017-07-29  26      5\n    2017-07-30  3       1\n\n    \u003e github-traffic-stats - Git clones\n    Date        Clones  Unique cloners\n    Totals      5       5\n    2017-07-17  1       1\n    2017-07-24  2       2\n    2017-07-26  1       1\n    2017-07-29  1       1\n\n    \u003e github-traffic-stats - Referring sites\n    Date        Views   Unique visitors\n    Totals      44      27\n    Google      33      24\n    github.c... 11      3\n\n\n    $ # Or to get stats on all of your repositories\n    $ gts 'nchah' 'ALL' 'save_csv'\n    Password:* (passwords are hidden)\n    \n    $ # Or if you are running on an organization repo (for example NREL's SAM repo) as a user with access\n    $ gts 'nickdiorio' 'SAM' 'save_csv' -o 'NREL'\n    Password:* (passwords are hidden)\n    ...\n\nTraffic data stored in CSV files with columns:\n\n::\n\n    repository_name, date, views, unique_visitors\n\n| Separate CSVs are created for each run of the script.\n| To merge and only preserve the unique data points, run:\n\n::\n\n    $ bash bash/merge-csv.sh [folder_with_CSVs]\n\nDocumentation\n-------------\n\nA list of the references used for this project.\n\n-  `GitHub API`_\n-  `Preview the Repository Traffic API (August 15, 2016)`_\n\n.. _kennethreitz/requests: https://github.com/kennethreitz/requests\n.. _libraries: https://developer.github.com/libraries/\n.. _GitHub API: https://developer.github.com/v3/\n.. _Preview the Repository Traffic API (August 15, 2016): https://developer.github.com/changes/2016-08-15-traffic-api-preview/\n.. _Github Access Tokens: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnchah%2Fgithub-traffic-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnchah%2Fgithub-traffic-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnchah%2Fgithub-traffic-stats/lists"}