Python MyKU API Wrapper
Project description
PyMyKU
An unofficial MyKU API wrapper and utilities 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 documentation is available here.
You can also use help()
to see the docstrings of any modules in pymyku.
Examples
You can find some examples in the examples.
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.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.
References
- MyKU
- requests
- discord.py for documentaion style and template.
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.
Source Distribution
Built Distribution
File details
Details for the file pymyku-0.3.0.tar.gz
.
File metadata
- Download URL: pymyku-0.3.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8789aad8ea2839d6580551809749c9efe4212df1c9c6869e129f9b3cd52dc5 |
|
MD5 | 9e33ec62aa0615c7793ee01ea6f66f28 |
|
BLAKE2b-256 | 35b496831cff6d559197e05a3b15df06dbb6b91c119f3da169a540073c418289 |
File details
Details for the file pymyku-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: pymyku-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48638ebd113e15cd36b8d49f99c90dc949cbb4eb4a7db68fbee43f88a0bf5b39 |
|
MD5 | 38c7f7ec1c67552c8bd012aa2a0b7d02 |
|
BLAKE2b-256 | 1bc109db7f521d6586e8015916e3d3df092f2fd005e04ddc1e5e4032ff78ce7f |