Python HTTP client to the Ergast Motor Racing Data API
MIT License
Python HTTP client to the Ergast Motor Racing Data API
This is a work in progress. The goal is to create a convenient python client for the Ergast Developer API.
It should:
Generic Custom Request
from ergast import Request, client
req = Request(resource='results', id='1', criteria=dict(drivers='ricciardo'))
result = client.send(req)
# Result is the data from following request listing the races won by Daniel Ricciardo
# GET http://ergast.com/api/f1/drivers/ricciardo/results/1.json
Convenience Methods by resource type
import ergast
ergast.seasons.by_driver('ricciardo')
# Convenience for doing:
# req = Request(resource='seasons', criteria=dict(drivers='ricciardo'))
# result_data = client.send(req)
# result_data['MRData']['SeasonTable']['Seasons']