No project description provided
Project description
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
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
Release history Release notifications | RSS feed
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 iracing_client-0.1.2a1.tar.gz
.
File metadata
- Download URL: iracing_client-0.1.2a1.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9283bbaf69d9f0bd2cb9e80e32319c55f71dcc86063208e8824ac02f432efc92 |
|
MD5 | 3c45d91054a28b8951456fbf504d7063 |
|
BLAKE2b-256 | 9ce03e8c1a5251ac921a9a3ef2545842235bb72c54fdcfbdf754a36cc8403789 |
File details
Details for the file iracing_client-0.1.2a1-py3-none-any.whl
.
File metadata
- Download URL: iracing_client-0.1.2a1-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9a05a6970c34dd6beb7e6b9f34146df601ae9f0a58441a3d401f84fc494a7ab |
|
MD5 | d606c370beb9d1194ea01263184fbf4b |
|
BLAKE2b-256 | b357a95cc1304ec9c97e73e6f82be96de2170a2959a24ad86d8d035d3f084fe2 |