Home

Awesome

Introduction

This repository hosts a SQLite database containing Formula 1 lap and race information for the seasons from 2014 to 2019 (i.e. the Formula 1 hybrid era with V6 engines). It was built mainly on the basis of the Ergast API (see Attribution section) to be able to determine parameters for a race simulation (soon available on https://github.com/TUMFTM/race-simulation). We are open for comments, suggestions and bug reports!

Contact person: Alexander Heilmeier.

Attribution

Large parts of the database are based on the Ergast Motor Racing Developer API which can be found on http://ergast.com/mrd/. The number of accidents and failures per driver and season is taken from the statistics sites of https://www.racefans.net/, e.g. https://www.racefans.net/2018-f1-season/2018-f1-statistics/2018-f1-retirements-penalties/.

Extensions and Modifications in comparison to the Ergast API

The following data was added in comparison to the Ergast database:

The following data was made directly accessible in comparison to the Ergast database:

License

The database can be used according to the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) license (see https://creativecommons.org/licenses/by-nc-sa/3.0/). This includes non-commercial use, e.g. for research purposes.

Accessing the database

The SQLite database can be viewed easily using online tools such as https://inloop.github.io/sqlite-viewer/. In Python 3, it can be accessed using the sqlite3 package (https://docs.python.org/3.7/library/sqlite3.html). A big advantage of the SQLite database is that all information is contained within a single file. Therefore, no SQL server must be set up for usage.

Content

The database contains the following tables:

The data is available for the seasons 2014 - 2019.

Hint: Progress in the fcyphases and laps tables are calculated based on time, not on distance. Therefore, 0.8 means that the phase started/ended at 80% of the final lap time, not at 80% of the track length (since this data is not available).

Hint 2: The tire age for drivers starting in the top 10 is set to 2 laps by default (if they do not start on wet or intermediate compound). This is made to take into account that these drivers have to start on the same tireset on which they set their fastest lap time in Q2. The two laps are an approximation of the degradation relevant tire age (the real tire age is three laps, at least, since there is usually one warm-up lap, one or two hot laps and one cool-down lap on these tires).

Hint 3: All compounds are given in absolute compound names (A1 - A7) so that they can be compared over all seasons. The following table contains which compound names of a season correspond to which absolute compound names.

SeasonA1A2A3A4A5A6A7
2014hardmediumsoftsupersoft---
2015hardmediumsoftsupersoft---
2016hardmediumsoftsupersoftultrasoft--
2017hardmediumsoftsupersoftultrasoft--
2018superhardhardmediumsoftsupersoftultrasofthypersoft
2019-C1C2C3-C4C5

drivers table

FieldTypeKey
idintegerprimary
carnointeger
initialstext
nametext

fcyphases table

FieldTypeKeyComment
idintegerprimary
race_idintegerforeign
startracetimereal
endracetimereal
startraceprogrealrace progress of leader at phase start
endraceprogrealrace progress of leader at phase end
startlapinteger
endlapinteger
typetextVSC or SC

laps table

FieldTypeKey
race_idintegerprimary, foreign
lapnointegerprimary
positionintegerprimary
driver_idintegerforeign
laptimereal
racetimereal
gapreal
intervalreal
compoundtext
tireageinteger
pitintimetext
pitstopdurationreal
nextcompoundtext
startlapprog_vscreal
endlapprog_vscreal
age_vscreal
startlapprog_screal
endlapprog_screal
age_screal

qualifyings table

FieldTypeKey
race_idintegerprimary, foreign
positionintegerprimary
driver_idintegerforeign
q1laptimereal
q2laptimereal
q3laptimereal
speedtrapreal

races table

FieldTypeKey
idintegerprimary
datetext
seasoninteger
locationtext
availablecompoundstext
commenttext
nolapsinteger
nolapsplannedinteger
tracklengthreal

retirements table

FieldTypeKey
seasonintegerprimary
driver_idintegerprimary, foreign
accidentsinteger
failuresinteger

starterfields table

FieldTypeKey
race_idintegerprimary, foreign
driver_idintegerprimary, foreign
teamtext
teamcolortext
enginemanufacturertext
gridpositioninteger
statustext
resultpositioninteger
completedlapsinteger
speedtrapreal

Related open-source repositories