Skip to main content

A python wrapper to the brink api

Project description

Python Brink API Wrapper
========================

Install the Python Package
-------------------------

::

$ pip install python-brink


Using the API
--------------

1. Login to the api to receive a jwt token that can be used in future requests without the need to reauthenticate

.. code-block:: python

from brink.client import BrinkAPI
from brink.exceptions import BrinkAPIException

api = BrinkAPI()

try:
# Login to the api via username and password
access = api.login( 'username', 'password' )

except BrinkApiException, e:

# Login error
exit()

jwt_token = access['jwt_token']

# After logging in using the api.login() method, the token is already set so additional
# requests can be handled correctly
flights = api.getFlights()

2. If you already have a jwt token prepared, you can use it when creating the api instance and bypass logging in.

.. code-block:: python

from brink.client import BrinkAPI

token='eyJ0eXAiOiJKV1QiLCJhbGc...'
api = BrinkAPI(token)

# Get flights
flights = api.getFlights()

# Get details for a specific flights
flight = api.getFlight(10)

# Get data points for a specific flight
params = { 'page': 1, 'per_page': 50 }
flight_data = api.getFlightData(10,params)

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

python-brink-0.0.1.zip (6.7 kB view details)

Uploaded Source

File details

Details for the file python-brink-0.0.1.zip.

File metadata

  • Download URL: python-brink-0.0.1.zip
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-brink-0.0.1.zip
Algorithm Hash digest
SHA256 364e53961d64d311fdb63868e789d6422d7b0348470d430306ee5919601b9e44
MD5 9136fc17fb45d366d818b9fd37491600
BLAKE2b-256 a99044f8176bfa74c736a6155e642f7a9d2d37e743bf9fcf62edfa9f895f6fb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page