8000 GitHub - pgoslatara/backage: (Badge) Frontage for GitHub Packages
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pgoslatara/backage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

backage

Supplement the API

With a JSON Endpoint backed by a SQLite Dataset


Is the Packages API missing something you need? Did you ever wish you could show info about packages as badges? Now you can get what you need! If you're here to make a badge, use something like shields.io/json and these parameters.

Example

Here's what the badges could look like for pihole-speedtest:

downloads/all downloads/month downloads/week downloads/day size versions releases latest newest

Endpoint

Refreshed several times a day, the endpoint is always in sync with the continually updated database. 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, don't worry about slashes or anything.

URL

Replace <OWNER>, <REPO>, and <PACKAGE> with their respective values:

https://raw.githubusercontent.com/pgoslatara/backage/master/index/<OWNER>/<REPO>/<PACKAGE>.json

JSONPath

Just fill in the blanks to get the properties you want. Or get creative and forge your own path!

Package

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)
Version

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 version with it and exclude it from the list:

version[?(@.tags.indexOf("latest") != -1
)].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 latest
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

Database

The properties are generated from the following tables, which provide a historical record.

Packages

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

Versions

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)

TODO

  • Get sizes for all package types

About

(Badge) Frontage for GitHub Packages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%
0