Summarizing content on bintray

Summarizing contents of bintray repositories.

Bintray is the perfect complement to a versioned source control host like github: versioned binaries available through a variety of protocols (Maven, Gradle, Ivy… ) Bintray also has a public REST API that returns a straightforward JSON description of packages.

To automate collecting and formatting information about bintray packages in markdown so I could include it on web sites, I put together a Scala package, with a quick guide here.

Overview of reporting on bintray packages

You instantiate a BintrayRepo object from owner and repository names:

val owner = "neelsmith"
val repo = "maven"
val btRepo = BintrayRepo(owner, repo)

You can collect BintrayPackages from the repository by name, or from a vector of names. The result is one or more scala Options, so we can flatten a list to get BintrayPackages.

val pkgNames = Vector("greek", "latphone", "gsphone")
val langPkgs = btRepo.bintrayPackages(pkgNames).flatten

You can use normal Scala to sort the list, say alphabetically, by name:

val alpha = langPkgs.sortWith(_.name < _.name)

Repository objects have a function for writing the header of a markdown-formatted table; package objects have a function for describing the package in a markdown row. Again, with a little normal Scala, you can put a whole markdown table together in one line:

val mdTable = btRepo.markdownTableHeader + langPkgs.map(_.markdownRow).mkString("\n")

Output

The output is a github-flavored markdown table. On this web site, it is displayed like this:

PackageCurrent versionPublishedSummaryGithub repositoryBinary download
greek1.4.0March 29, 2018A cross-platform library for working with strings representing ancient Greek in a variety of alphabetic systems.https://github.com/neelsmith/greek
gsphone1.1.0March 29, 2018A cross-platform library for phonological manipulation of GreekString objects.https://github.com/neelsmith/gsphonology.git
latphone1.5.1January 10, 2019A library working with Latin texts in specified orthographies.https://github.com/neelsmith/latphone

To use it

The source code is available on github https://github.com/neelsmith/btreporter, along with a brief tutorial here.

Binaries, of course, are available on bintray! At https://bintray.com/neelsmith/maven/btreporter you can find coordinates for maven, etc, to use in your build system, or download it direclty.