|
4 years ago | |
---|---|---|
rival_regions_wrapper | 4 years ago | |
.gitignore | 5 years ago | |
LICENSE | 4 years ago | |
Pipfile | 5 years ago | |
Pipfile.lock | 5 years ago | |
README.md | 4 years ago | |
setup.py | 4 years ago |
This library will functions as an API wrapper for interaction with Rival Regions.
The API wrapper uses middleware to decide where how to send the request. Middlewares can also be used to write direct requests to Rival Regions.
Current middleware
Use username, password, and login method to log in localy.
Connect in through remote API using URL and authentication key.
Create local authentication middleman and log in with environ variables.
import os
from rival_regions_wrapper import LocalAuthentication
middleware = LocalAuthentication(
os.environ["USERNAME"],
os.environ["PASSWORD"],
os.environ["LOGIN_METHOD"]
)
region = middleware.get('listed/upgrades/{}'.format(region_id))