backage

Package Tracker and Badge Frontage

MIT License

Stars
15
Committers
11

backage

It's all part and parcel


The GitHub Packages API doesn't expose much of the publicly-available metadata that other registries provide. This completely automated closed-loop system is the solution.

Just star this project to have GitHub serve JSON and XML endpoints for your public packages and those of any organizations you're publicly a part of! A service ran by GitHub will add them to its circular priority queue within the next few hours and update the dataset. If you'd then like the service to forget and ignore some or all of your packages, add owner[/repo[/package]] to optout.txt here and make a pull request.

To add any other users or organizations not yet in the index, add the case-sensitive name of each one on a new line in owners.txt on your own fork here and make a pull request. Please add just the name(s) -- ids, repos, and packages will be obtained automatically!

Use something like shields.io/json or shields.io/xml with the endpoint parameters below to access the latest data and make badges like these:

Endpoint

https://ipitio.github.io/backage/OWNER/REPO/PACKAGE.FORMAT

Replace OWNER/REPO/PACKAGE.FORMAT with their respective values. The format can be either json or xml. If you're using Shields to evaluate expressions, like filters, you'll need the XML endpoint -- see this issue.

Properties

You'll find these properties for the package and its versions:

Property Type Description
owner_id number The ID of the owner
owner_type string The type of owner (e.g. users)
package_type string The type of package (e.g. container)
owner string The owner of the package
repo string The repository of the package
package string The package name
date string The most recent date the package was refreshed
size string Formatted size of the latest version
versions string Formatted count of all versions ever tracked
tagged string Formatted count of all tagged versions ever tracked
downloads string Formatted count of all downloads
downloads_month string Formatted count of all downloads in the last month
downloads_week string Formatted count of all downloads in the last week
downloads_day string Formatted count of all downloads in the last day
raw_size number Size of the latest version, in bytes
raw_versions number Count of versions tracked
raw_tagged number Count of tagged versions tracked
raw_downloads number Count of all downloads
raw_downloads_month number Count of all downloads in the last month
raw_downloads_week number Count of all downloads in the last week
raw_downloads_day number Count of all downloads in the last day
version object array The versions of the package (see below)
Property Type Description
id number The ID of the version
name string The version name
date string The most recent date the version was refreshed
newest boolean Whether the version is the newest
latest boolean Whether the version is the newest tagged
size string Formatted size of the version
downloads string Formatted count of downloads
downloads_month string Formatted count of downloads in the last month
downloads_week string Formatted count of downloads in the last week
downloads_day string Formatted number of downloads in the last day
raw_size number Size of the version, in bytes
raw_downloads number Count of downloads
raw_downloads_month number Count of downloads in the last month
raw_downloads_week number Count of downloads in the last week
raw_downloads_day number Count of downloads in the last day
tags string array The tags of the version

Paths

They can be queried with the following paths:

You can query a package for its properties, like size or version:

$.PROPERTY
$.size

Versions may be filtered in and tags out:

$.version[FILTER].PROPERTY
$.version[?(@.latest)].tags[?(@!="latest")]

You can query a package for its properties, like size or version:

/bkg/PROPERTY
/bkg/size

Versions can be filtered in and tags out:

/bkg/version[FILTER]/PROPERTY
/bkg/version[./latest[.="true"]]/tags[.!="latest"]