Saturday, January 05, 2019

Ristex 0.1.0 Released

At about 11:46 pm, I got version 0.1.0 of Ristex released to Maven central. This marks the first Scala library I would be releasing! Yay!! 🎉

It should now be available for inclusion with the following sbt configuration:

// ${version} = 0.1.0
libraryDependencies += "io.geekabyte.ristex" %% "ristex" % "${version}"

And by the way, the release process was not as painful as I envisaged. Read further, for my thought on this.

What is Ristex

Ristex is a parser combinator library for parsing the RIR Statistics Exchange files. In theory it should work with the files published by all regional internet registry, in practice, it has only been used with files published by RIPE NCC.

Ristex uses Atto, which is a compact, pure-functional, incremental text parsing library for Scala. Infact, Ristex essentially extends Atto to cater for parsing the RIR Statistics Exchange files, and it makes no attempt to abstract it away, hence all of Atto's API are directly available for use with Ristex.

The idea for Ristex came up when I started working on a fun project to create a JSON format for the CSV like format of the RIR Statistics Exchange files. While working on this, it became apparent that it would be good to have a nicer way to parse the exchange files instead of relying on regex. And since I have always wanted to explore the idea of Parser Combinators in general and the Atto library in particular, it took little persuasion to temporarily shelf the project to create a JSON format, and create a parser combinator library to parse them instead.

Releasing to Maven Central Via SBT

Releasing the library to maven with sbt was relatively painless. I was expecting it to be much of a frustrating experience but I was pleasantly surprised. I guess having previously documented How To Publish Software Artifacts To Central Repository, also helped.

I found this post: An in depth guide to deploying to Maven Central with sbt by Leonard Ehrenfried to be particularly helpful.

The only snag I encountered was related to getting the PGP key published to a public key server. For reasons I still do not know, running the command:

`pgp-cmd send-key ${keyname} hkp://` 

as specified in the post above was not working. This caused the release process to fail a couple of times since maven could not verify the integrity of what was being published.

I had to result to manually uploading the PGP key using the web interface provided by Apart from this, everything went smoothly.

Anyways, the source of Ristex is available on Github, so do feel free to poke around!