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
- 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.
- 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=15))
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
Built Distribution
File details
Details for the file racers_countering-0.0.5.tar.gz
.
File metadata
- Download URL: racers_countering-0.0.5.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 589cf86358712ae22050f83c7ab32d2b73f4d2eb3bd4defbcd38d49ed5aa8253 |
|
MD5 | 0f2d52d038f36523f08b3a6380c26228 |
|
BLAKE2b-256 | 1c4b11a2f46127c0ebf64c1cbcce04100677e4a1bae05dce22b0128475a2690e |
File details
Details for the file racers_countering-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: racers_countering-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf34cf88846fa257769e42058bb747c45b22da48296f4f499664d88d594207fd |
|
MD5 | 82f37232f37675841ee896b3e728ae4d |
|
BLAKE2b-256 | 57a2ad693217010831ea4216d2de89d860fb03b2217299384c329c83acc8370e |