Package: race-report
Report of Monaco 2018 RacingInstallationClone this repository to your local machine:Use the managerpipto install package:pipinstallrace-reportSummaryApplication that read data from3 files, order racers by time and print report that shows 2 tables: the top 15 racers and other racers.
🔴Data should include 3 files: "start.log", "end.log", abbreviations.txt.🔴The files"start.log"and"end.log"should have lines in the format"SVF2018-05-24_12:02:58.917", where:SVF- racer abbreviation;2018-05-24- date;12:02:58.917- time;Indataandtimeunderscore character(_) is used as a delimiter.The third fileabbreviations.txtcontains abbreviation explanations, and should have lines in the format"DRR_Daniel Ricciardo_RED BULL RACING TAG HEUER", where:DRR- racer abbreviation;Daniel Ricciardo- full name of racer;RED BULL RACING TAG HEUER- racer team;All datamust be separated byunderscore character(_).If the data is invalid, you will receive an error or a red warning  message in the console.Usagefromrace_report_by_ngimportabbr_decoder,drivers_best_lap,build_report,print_reportdrivers_abbreviations=abbr_decoder("data/abbreviations.txt")drivers_best_time=drivers_best_lap("data/start.log","data/end.log")report=build_report(drivers_abbreviations,drivers_best_time)print_report(report)# Output:# WARNING: Invalid time for EOF. The result is not added to the overall rating.# +-------+-------------------+---------------------------+-------------+# | Place |    Driver name    |            Team           |   Best lap  |# +-------+-------------------+---------------------------+-------------+# |   1.  |  Sebastian Vettel |          FERRARI          | 0:01:04.415 |# |   2.  |  Valtteri Bottas  |          MERCEDES         | 0:01:12.434 |# |   3.  | Stoffel Vandoorne |      MCLAREN RENAULT      | 0:01:12.463 |# |   4.  |   Kimi Räikkönen  |          FERRARI          | 0:01:12.639 |# |   5.  |  Fernando Alonso  |      MCLAREN RENAULT      | 0:01:12.657 |# |   6.  |  Charles Leclerc  |       SAUBER FERRARI      | 0:01:12.829 |# |   7.  |    Sergio Perez   |    FORCE INDIA MERCEDES   | 0:01:12.848 |# |   8.  |  Romain Grosjean  |        HAAS FERRARI       | 0:01:12.930 |# |   9.  |    Pierre Gasly   | SCUDERIA TORO ROSSO HONDA | 0:01:12.941 |# |  10.  |    Carlos Sainz   |          RENAULT          | 0:01:12.950 |# |  11.  |  Nico Hulkenberg  |          RENAULT          | 0:01:13.065 |# |  12.  |  Brendon Hartley  | SCUDERIA TORO ROSSO HONDA | 0:01:13.179 |# |  13.  |  Marcus Ericsson  |       SAUBER FERRARI      | 0:01:13.265 |# |  14.  |    Lance Stroll   |     WILLIAMS MERCEDES     | 0:01:13.323 |# |  15.  |  Kevin Magnussen  |        HAAS FERRARI       | 0:01:13.393 |# +-------+-------------------+---------------------------+-------------+Func print_report сan also show the tables inreverseorder:fromrace_report_by_ngimportabbr_decoder,drivers_best_lap,build_report,print_reportdrivers_abbreviations=abbr_decoder("data/abbreviations.txt")drivers_best_time=drivers_best_lap("data/start.log","data/end.log")report=build_report(drivers_abbreviations,drivers_best_time)print_report(report,desc=True)# Output:# +-------+-------------------+---------------------------+-------------+# | Place |    Driver name    |            Team           |   Best lap  |# +-------+-------------------+---------------------------+-------------+# |   15  |  Kevin Magnussen  |        HAAS FERRARI       | 0:01:13.393 |# |   14  |    Lance Stroll   |     WILLIAMS MERCEDES     | 0:01:13.323 |# |   13  |  Marcus Ericsson  |       SAUBER FERRARI      | 0:01:13.265 |# |   12  |  Brendon Hartley  | SCUDERIA TORO ROSSO HONDA | 0:01:13.179 |# |   11  |  Nico Hulkenberg  |          RENAULT          | 0:01:13.065 |# |   10  |    Carlos Sainz   |          RENAULT          | 0:01:12.950 |# |   9   |    Pierre Gasly   | SCUDERIA TORO ROSSO HONDA | 0:01:12.941 |# |   8   |  Romain Grosjean  |        HAAS FERRARI       | 0:01:12.930 |# |   7   |    Sergio Perez   |    FORCE INDIA MERCEDES   | 0:01:12.848 |# |   6   |  Charles Leclerc  |       SAUBER FERRARI      | 0:01:12.829 |# |   5   |  Fernando Alonso  |      MCLAREN RENAULT      | 0:01:12.657 |# |   4   |   Kimi Räikkönen  |          FERRARI          | 0:01:12.639 |# |   3   | Stoffel Vandoorne |      MCLAREN RENAULT      | 0:01:12.463 |# |   2   |  Valtteri Bottas  |          MERCEDES         | 0:01:12.434 |# |   1   |  Sebastian Vettel |          FERRARI          | 0:01:04.415 |# +-------+-------------------+---------------------------+-------------+Also implemented command-line interface(CLI):# Print reportpythonreport_cli.py--filles“path_to_folder”# Print info about racerpythonreport_cli.py--filles“path_to_folder”--driver”driver_full_name”There is also a "--desc" parameter that can show the tables in reverse order:# Print reportpythonreport_cli.py--filles“path_to_folder”--descFor more information about CLI, use:pythonreport_cli.py--helpUsedPytestCoverageArgparsePackaging Python ProjectsLicenseMIT