Skip to main content

A small package that counts TOP-15 racers from data files

Project description

Racers Counter

Racers Counter is a Python package that processes racing logs, including driver names, teams, start times, and stop times. It reads data from log files placed in a folder 'additional', calculates the lap time for each racer, and generates a report with the fastest lap times. It also handles errors in the input data and provides a detailed list of invalid records.

Features

  • Reads abbreviations, start, and stop logs to process race records
  • Calculates lap times for each driver
  • Sorts drivers based on their lap times
  • Generates a report with top racers and records with errors

Installation

You can install the package via pip:

pip install racers-countering

Usage

  1. Prepare the following log files in a directory (by default additional folder):
  • abbreviations.txt: Contains abbreviations of drivers and teams.
  • start.log: Contains the start time of each driver.
  • end.log: Contains the stop time of each driver.
  1. Import the Record class and call its methods to build and print the report:
from racers_countering.record import Record

good_records, bad_records = Record.build_report(
    folder_path="path_to_your_logs",
    abbr_file_name="abbreviations.txt",
    startlog_file_name="start.log",
    stoplog_file_name="end.log",
    reverse=False
)

print(Record.print_report(good_records, bad_records, under_number=5))

Methods:

Record.read_abbreviations()

Read all abbreviations from 'additional\abbreviations.txt'

Record.build_report()

Builds the race report by reading the abbreviations, start times, and stop times. Returns two lists:

  • good_records: List of records that were processed correctly.
  • bad_records: List of records with errors.

Record.print_report()

Generates a formatted report based on the provided records.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

racers_countering-0.0.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

racers_countering-0.0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file racers_countering-0.0.2.tar.gz.

File metadata

  • Download URL: racers_countering-0.0.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for racers_countering-0.0.2.tar.gz
Algorithm Hash digest
SHA256 45776b3f6606349ef54b4398577b5e6af178a679534a748bb13ef79449c4a1bd
MD5 5a399fcf94b55fc469c9fb1adf56f604
BLAKE2b-256 8b46168cf81a71f5867c1a2ef01940699a8a879c988ed98a4402f87f42c8cc3c

See more details on using hashes here.

File details

Details for the file racers_countering-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for racers_countering-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fad156285520da299fd3d615704a09dd99926f668e38aa8208bcc1fc0b0b0369
MD5 c38c9b97d7f2b1bfa6128a80f952ffde
BLAKE2b-256 e003be9a2695ddf5c1b2d95e1c07502af3a4b22d76a448d8c6ad0efcb04d14b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page