Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
/ PyYoubora Public archive

Auth provider for famous Python Requests to access Youbora API

License

Notifications You must be signed in to change notification settings

wieshka/PyYoubora

Repository files navigation

PyYoubora

Authentication library and wrapper for NPAW Youbora API.

This module contains:

  • YouboraAuth - custom authorisation provider for Python Requests, check example_auth.py
  • YouboraClient - Wrapper which utilises Swagger definition to validate requests against NPAW Youbora before executing Request, check example_client.py

Getting started:

  • install latest package with pip install PyYoubora
  • check out included example_auth.py and example_client.py to get understanding how to use
  • but, basically this gives you:
import requests
from youbora import YouboraAuth

query = {}

response = requests.get('https://api.youbora.com/:system_code:/data',
                        params=query,
                        auth=YouboraAuth("secret", "system_code")

Future considerations (wish list):

  • to extend library with helpers such as:
    • More Swagger API validations;
    • Youbora Query Builder, interactive perhaps ?
    • Youbora Filter Builder, interactive perhaps ?
    • Response formatter for quick report/graph generations in various formats

Good to know

  • This code base (examples and config-sample.py) assumes that swagger is available within base directory as swagger.json
  • both example_x.py assumes that you have copied config-sample.py to config.py and have provided details there.
  • you can very easy use any other config approach - sysarg, env, AWS KMS, etc.

Disclaimer

  • This has been created to ease my daily interaction with Youbora API as customer, I am not anyhow related to NPAW;
  • Publishing this repository has been agreed with NPAW;

About

Auth provider for famous Python Requests to access Youbora API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages