Skip to main content

No project description provided

Project description

Quality Gate Status

CodeQL

Test Suite

Release

iracing-client

A Python Client Library for working with iRacing Data API.

This library provides communiction & error handling with the iRacing Data API.

Quick Start

JSON formatted data returned by iRacing is deserialized as either a list or dict using json.loads

import iracing_client.auth as auth
from iracing_client.data.constants import Constants
from iracing_client.data.member import Member
from iracing_client.data.league import League

# Authenticate with iRacing
iracing_username = os.environ.ge('IRACING_USERNAME')
iracing_password = os.environ.ge('IRACING_PASSWORD')

http_session = auth.login(iracing_username, iracing_password)


# iRacing Constants
constants = Constants(http_session)
print(constants.categories)
print(constants.divisions)
print(constants.event_types)


# My iRacing Member Info
member = Member(http_session)
print(member.get_profile())


# My iRacing League Directory
league = League(http_session)
print(league_instance.get_directory())

Useful Information

iRacing Data API Documentation

iRacing Forums Data API Discussion

iRacing Auth Portal

Colaborating

Feel free to fork this repo and commit back via a Pull Request.

We have provided a VSCode devcontainer to make getting started as simple as possible. Use your own local machine or a GitHub CodeSpace.

The python dependancies and packaging is managed using Poetry.

Tests are managed and executed using pytest.

Code formatting is performed by black.

Linting is performed by pylint.

Unit Tests

Unit Tests mock interactions with the iRacing Data API and can be executed offline. Create unit tests to exercise logic and error handling.

Running pytest from the VSCode Terminal:

poetry run pytest tests/unit/

Integration Tests

Integration Tests will connect to the iRacing Service and perform a shake down of the base data classes using live data.

When testing locally, provide the following values in a .env file in the root of the project.

IRACING_USERNAME=<your email address>
IRACING_PASSWORD=<your iRacing password>
IRACING_MEMBER_ID=<your iRacing Member Id>

Running pytest from the command line (integration tests only):

poetry run pytest tests/integration

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

iracing_client-0.1.2a1.tar.gz (13.2 kB view hashes)

Uploaded Source

Built Distribution

iracing_client-0.1.2a1-py3-none-any.whl (15.1 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