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.program_code import Record

good_records, bad_records = Record.build_report(
    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.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: racers_countering-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 0cf500564d1ad060a545c539c6c16707587e4a862c38a4e2c893bed5b2f60c9e
MD5 7e5d3350575472d3fd8ba2ad90e32417
BLAKE2b-256 13020da2ce21ad805e7b7efa2da0f96756155a1b6ef6c345e83caac22854e219

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for racers_countering-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 46a2c80bc163d5e95c64168cd9dc58c5d35547cd5a2b8b4f913b2cb3d1bc382e
MD5 573515d5aa36fa8864c77250f9533a0f
BLAKE2b-256 15c5bc433a31f039f4c5ed972bd4e8092a0ed94f6d3f4bfee2c5c47cbe38ee5e

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