kazigk / LvlUpPy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LvlUpPy

Python bindings for LvlUp.pro API

Documentation

Getting started

Obtaining LvlUpPy

git clone https://github.com/kazigk/LvlUpPy.git
cd LvlUpPy
pip3 install -r requirements.txt
./setup.py install --user

Having fun

from lvluppy import UpClient
from lvluppy.exceptions import UnauthorizedException

up = UpClient('your_precious_token')

try:
  info = up.getUserInfo()
  print('Successfully logged in as', info.email)
except UnauthorizedException as e:
  print('Cannot fetch user info, please check your token.')
  print('Exception details:', e.details)

You can also use sandbox environment provided by LvlUp to test your scripts, create UpClient instance specifying baseUrl parameter:

SANDBOX_URL = 'https://sandbox-api.lvlup.pro/v4'

up = UpClient('your_precious_token', baseUrl=SANDBOX_URL)

About

License:MIT License


Languages

Language:Python 100.0%