Friday, July 14, 2017

Python and R Wrappers for the ergast F1 Results Data API

A week or so ago, Will Vaughan tipped me off to a Python package he's started putting together to wrap the ergast motor racing results database: ergast-python.

He's also making a start on some Wrangling F1 Data Jupyter notebooks that make use of the wrapper: wranglingf1data.

Very nice:-)

It also prompted me to finally split out my own crappy ergast API wrapper R code into an R package of its own: ergastR.

It needs tidying up, and could probably do with being updated to "new R" and a more recent JSON package, but it should work enough to cope with my own Wrangling F1 Data With R code. (If it doesn't, shout!)

The R package also needs work on the following: cacheing, so that we don't keep hitting the ergast API unnecessarily; paged results handling (I fudge this a bit at the moment by explicitly setting a large results limit); and dual handling of ergast API versus ergast database requests. (If a database connection string is passed, use that rather than make a call to the ergast API.)

Any issues with the R package, please feel free to raise them on the Github site, although I can't guarantee how quickly I'll get to them...

No comments:

Post a Comment

There seem to be a few issues with posting comments. I think you need to preview your comment before you can submit it... Any problems, send me a message on twitter: @psychemedia