The GitHub Packages API doesn't provide much metadata; this project aims to both fill that gap and provide a timeseries for further analysis. If you're here to make a badge, use something like shields.io/json with the endpoint. Here's what badges could look like for some of the available parameters:
If the database is a lawn we're sprinkling then the endpoint is what's been watered over the last 2π rad. To add any users or orgs post-haste, you can either:
- open an issue, or
- 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 -- ids, repos, and packages will be retrieved automatically.
Replace <OWNER>/<REPO>/<PACKAGE>
with their respective values:
https://raw.githubusercontent.com/ipitio/backage/master/index/<OWNER>/<REPO>/<PACKAGE>.json
Just fill in the blanks to get the properties you want. Or get creative and forge your own path! Here are some simple examples.
You can query a package for its properties:
$.<PROPERTY>
For instance, to get the size:
$.size
Properties
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 versions scraped |
tagged |
string | Formatted count of tagged versions |
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 |
raw_tagged |
number | Count of tagged versions |
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) |
You can query a package version by replacing <PROPERTY>
above with the following:
version[<FILTER>].<PROPERTY>
For example, to get the latest tag(s), we can find the newest version with tags (and exclude a possible latest
from the list):
version[?(@.latest==true
)].tags[?(@ != "latest")]
Or to get the number of downloads in the last month for a version by name from a certain date:
version[?(@.name=="<VERSION>"
&& @.date=="<YYYY-MM-DD>"
)].downloads_month
Properties
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 |
Imagine an ever-growing lawn increasingly covered less than π/2 rad at a time. It can be found under the latest release.
The general stats for all packages.
Schema
Column | Type | Description |
---|---|---|
owner_id |
INTEGER | The ID of the owner |
owner_type |
TEXT | The type of owner (e.g. users ) |
package_type |
TEXT | The type of package (e.g. container ) |
owner |
TEXT | The owner of the package |
repo |
TEXT | The repository of the package |
package |
TEXT | The package name |
size |
INTEGER | The size of the latest version |
downloads |
INTEGER | The total number of downloads |
downloads_month |
INTEGER | The total number of downloads in the last month |
downloads_week |
INTEGER | The total number of downloads in the last week |
downloads_day |
INTEGER | The total number of downloads in the last day |
date |
TEXT | The most recent date the package was refreshed |
The stats for all versions of each package.
Schema
Column | Type | Description |
---|---|---|
id |
INTEGER | The ID of the version |
name |
TEXT | The version name |
size |
INTEGER | The size of the version |
downloads |
INTEGER | The total number of downloads |
downloads_month |
INTEGER | The total number of downloads in the last month |
downloads_week |
INTEGER | The total number of downloads in the last week |
downloads_day |
INTEGER | The total number of downloads in the last day |
date |
TEXT | The most recent date the version was refreshed |
tags |
TEXT | The tags of the version (csv) |
- Get sizes for all package types