Welcome to AsyncNT’s documentation!
AsyncNT is an asynchronous way to fetch data from nitrotype.
Features
Asyncio support
Access to the Nitro Type API
Rate limit of 10 requests per second
Cache to speed up requests
Note
This project is under active development.
Usage
Installation
To use AsyncNT, first install it using pip:
$ pip install asyncnt
Getting Data
To retrieve data, you first need to create a asyncnt.Session
object.
Then, you can use asyncnt.Session.get_racer()
and asyncnt.Session.get_team()
to get a asyncnt.Racer
object and a asyncnt.Team
object, respectively.
Example
import asyncio
import asyncnt
async def main():
#create a session
async with asyncnt.Session() as session:
#get a Racer object
racer = await session.get_racer("travis")
#print races the racer has
print(racer.races)
#get a Team object
team = await session.get_team("NT")
#print team's daily speed
print(team.daily_speed)