Python MyKU API Wrapper
Project description
PyMyKU
An unofficial MyKU API wrapper for python.
Table of Contents
Notices
This project was developed by KU students and is not affiliated with the university. Please respect the API when using this project.
Documentation
All the documentation is available on the repository wiki.
You can also use help()
to see the docstrings of any modules in pymyku.
Installation
Prerequisites
- Python 3.6+
From PyPI
python -m pip install pymyku
From source
git clone https://github.com/phusitsom/pymyku.git
cd pymyku
python -m pip install -r requirements.txt
python -m pip install -e .
Usage
You can use this library by importing the pymyku
module to your script.
Methods
Assume that USERNAME
is the username of your Nontri account and PASSWORD
is the password of your Nontri account.
Client
import pymyku
ku_client = pymyku.Client('USERNAME', 'PASSWORD')
response = ku_client.fetch_gpax()
print(response)
Requests
from pymyku import requests, TokenAttr
from pymyku.utils import extract
login_res = requests.request_login('USERNAME', 'PASSWORD')
access_token = extract(login_res, TokenAttr.ACCESS_TOKEN)
response = requests.get_gpax(access_token).json()
print(response)
Output
{
'code': 'success',
'results': [
{
'std_id': '######',
'std_code': '##########',
'gpax': #.##,
'total_credit': ##
}
]
}
Notes
The only goal of this project is to make it simpler to send API requests to MyKU. There's no need to be concerned about the user's personal data being saved or shared.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.