Skip to main content

A package for get Formula One Data

Project description

MikeRacingF1 Package

The MikeRacingF1 package is a Python package that provides a simple and easy-to-use interface to the F1Stats API. The F1Stats API provides data about Formula 1 races, circuits, constructors, drivers, and more.

Installation

pip install mikeracingf1

Usage

To use the MikeRacingF1 package, you first need to import the MikeRacingF1 class:

from MikeRacingF1 import MikeRacingF1

You can then create a new instance of the MikeRacingF1 class, which provides methods for accessing the F1Stats API:

f1stats = MikeRacingF1()

The MikeRacingF1 class provides the following methods:

get_circuits(year): Returns information about F1 circuits for the given year.

get_constructor_results(year): Returns results for F1 constructors for the given year.

get_constructor_list(): Returns a list of F1 constructors.

get_constructorstandings(): Returns standings for F1 constructors.

get_driversinfo(year): Returns information about F1 drivers for the given year.

get_driverstandings(year): Returns standings for F1 drivers for the given year.

get_races(year): Returns information about F1 races for the given year.

get_results(year, round): Returns results for an F1 race for the given year and round.

Each method sends a GET request to the corresponding endpoint of the F1Stats API, and returns the JSON response as a Python object.

Here's an example of how to use the MikeRacingF1 class to retrieve information about F1 races and circuits:

from MikeRacingF1 import MikeRacingF1

f1stats = MikeRacingF1()

# Retrieve information about F1 circuits for the year 2023
circuits = f1stats.get_circuits(2023)
print("Circuits:")
print(circuits)
print()

# Retrieve information about F1 races for the year 2023
races = f1stats.get_races(2023)
print("Races:")
print(races)
print()
    

This code creates a new instance of the MikeRacingF1 class, and calls its get_circuits and get_races methods with the year 2023. It then prints the JSON responses from the F1Stats API.

License This package is licensed under the MIT License. See the LICENSE file for details.

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

mikeracingf1-0.0.5.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

mikeracingf1-0.0.5-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

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