Skip to main content

No project description provided

Project description

Github command-line views

@readwithai - X - blog - machine-aided-reading

Fetch (and maintain) information about the number of views or clones a github repository has.

Motivation

It can be quite natural to host some material such as documentation, cookbooks and list on github. github provides an API to query the number of views a repository has with some limitations. The main limitation is that data is only detained for two weeks. This script, if run periodically, will collect data about the numbers of downloads and views of a repository and provided aggregates.

It can also output a completely timeline.

Alternatives and prior work

This makes use of the github REST API specifically the traffic endpoints. You can call these directly with the gh command-line client.

There are some repositories intended for uses as github actions to sore these actions. I find github actions unwieldy and difficult to debug. repohistory provides similar functionality through a web GUI - it has no intructions for running locally but provides a web log in. ghstats is another GUI interface but has instructions on how to run it, collects more information and provides an end-point for querying (I may have used this if I discovered it earlier). There are tools for forward this data to splunk.

This appears to be the only command-line tool

Installation

Make sure you have the github command line-interface, gh, installed and that you have logged in to the command-line.

You can then install gh-views with pipx.

pipx install gh-views

Usage

gh-views talwrii/plugin-repl --fetch

Will fetch the clone and view statistics for the repository talwrii/plugin-repl. After you have run this you can run `gh-views talwrii/plugin-repl

To show all the repositories for which stats are collected you can run:

gh-views

To display all statistics you can run

gh-views --all

To update all stats for tracked repositories you can run

gh-views --fetch

You may wish to run this periodically for example using a systemd timer or cron job to ensure that all data is collected.

You can run:

gh-views talwrii/plugin-repl --timeseries

to output a complete timeseries of statistics for each day.

Support

If you found this tool particularly useful you can give me some money (maybe $3?) on my ko-fi

This will incentivise me to respond to tickets on this repository and release similar command-line tools.

About me

I am @readwithai I create tools for reading, research and agency sometimes using Obsidian.

If this sounds interesting, of you found this tool useful you might like to:

  1. Follow me on X where I post about these sort of tools.
  2. Look at my collection of productivity tools similar to this
  3. Read about taking better notes with the note taking app, Obsidian

If you rae interested in reading and research you can follow me on my blog.

logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gh-views-1.0.6.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file gh-views-1.0.6.tar.gz.

File metadata

  • Download URL: gh-views-1.0.6.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gh-views-1.0.6.tar.gz
Algorithm Hash digest
SHA256 634d4b8c7c26d8e57f3a644c24a65a702b6b6db7334f051aa5774beedbfcaab6
MD5 d12e5e610e2e5baea21658c867c843c3
BLAKE2b-256 fd22fba36193a3bf74f4aee0259ba4277d3743e208f5d8ef2326f137e63007da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page