Skip to main content

A package for processing Formula 1 racing logs

Project description

F1 Racing Report Package

This Python package generates and prints a report for Formula 1 racing, based on logs of start and end times of racers. The package also provides a command-line interface (CLI) to interact with the report generation and allows flexible configuration options.

Features

  • Report Generation: Generate a sorted list of F1 racers by lap times.
  • CLI Interface: Process files from a specified folder and print reports or errors.
  • Error Handling: Provides detailed error messages for problematic records (e.g., invalid times).
  • Custom Report Options: Includes optional sorting and underline settings.

Installation

You can install the package using PIP (assuming it's published to PyPI):

pip install task_6_rakitin_sergey

Usage

Below are some examples of how to use the CLI.

Basic Report Generation (with ascending order by default):

python f1_report.py

Generate Report with Sorting Order:

python f1_report.py --files <folder_path> --order asc Descending: bash Копировать код python f1_report.py --files <folder_path> --order desc Print Report with Custom Underline After a Specific Line:

bash Копировать код python f1_report.py --files <folder_path> --underline_after 3 Show Only Errors:

bash Копировать код python f1_report.py --files <folder_path> --errors_only Show Report for a Specific Driver:

bash Копировать код python f1_report.py --files <folder_path> --driver "Sebastian Vettel" Example Commands bash Копировать код

Example: Show full report in ascending order

python f1_report.py --files ./data

Example: Show report sorted in descending order

python f1_report.py --files ./data --order desc

Example: Print report with underline after 5 racers

python f1_report.py --files ./data --underline_after 5

Example: Show errors only

python f1_report.py --files ./data --errors_only

Example: Show report for a specific driver

python f1_report.py --files ./data --driver "Lewis Hamilton" Using as a Library You can also use this package as a library in your Python code to work directly with the report generation and handling records.

python Копировать код from task_6_rakitin_sergey import Record, build_report, print_report

Example of how to use in your own code

records = Record.get_record_dict() # Load records from the log files records = Record.add_start_time(records) # Add start times records = Record.add_end_time(records) # Add end times

valid_records, errors = build_report(records) # Generate report data

Print the report

print_report(valid_records, errors) Links Homepage

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

task_6_rakitin_sergey-0.0.13.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

task_6_rakitin_sergey-0.0.13-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file task_6_rakitin_sergey-0.0.13.tar.gz.

File metadata

  • Download URL: task_6_rakitin_sergey-0.0.13.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for task_6_rakitin_sergey-0.0.13.tar.gz
Algorithm Hash digest
SHA256 5faa8077a14e04a78cc05e7efa12c3c27b22c1dd2c2f0b2c6b462339c38c3c4d
MD5 b462423f40a007e0d8a068c6fc49d26a
BLAKE2b-256 ac03c8a255b858a48b921320f5507a2cb2c53d274b8f2543c9ab9a67b2f2b374

See more details on using hashes here.

File details

Details for the file task_6_rakitin_sergey-0.0.13-py3-none-any.whl.

File metadata

File hashes

Hashes for task_6_rakitin_sergey-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae1b7221865b9f7d1f65ed29df410ff63df3ec1b1551da6bdc5d8339a04fd88
MD5 a93769f49ac4084071ac61345816cfc8
BLAKE2b-256 f35ff7e91796f7aa103e2f10f47aa2f3cf9cae886055e123df7d731f1851ed2b

See more details on using hashes here.

Supported by

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