Chrysaor is an unofficial Python API for accessing academic data from the Pegasus service provided by the IONIS school group. This API allows students and parents to programmatically access their grades and academic information using reverse engineering techniques, including requests (using the requests
module) and web scraping with BeautifulSoup
.
To use Chrysaor, ensure you have Python 3.6 or later installed. Clone the repository and install dependencies:
git clone https://github.com/jean-voila/Chrysaor.git
cd Chrysaor
pip install -r requirements.txt
-
Setup Credentials: Ensure your
credentials
file in thedata
directory contains your Pegasus login details. Here is an example of the credential file :john.smith zivEI34sv
-
Run Example Script:
python main.py
This script initializes an instance of
PegasusData
, logs into Pegasus using credentials, and retrieves student information. It scans the existence and validity of thecookie
file in thedata
folder. If it's empty or invalid,PegasusData
will automatically create/update and store it. Then the raw data will be fetched. -
Integrate into Your Project: Import
StudentLogging
and use its functions to authenticate and retrieve data. Seemain.py
for an example implementation.
import StudentLogging
class PegasusData():
def __init__(self):
self.success = False
self.cookie = ""
self.name = ""
def __GetData__(self, credentialFile="data/credentials", cookieFile="data/cookie", verboseOutput=True):
loggingData = StudentLogging.log(credentialFile, cookieFile, verboseOutput)
self.success = bool(loggingData["success"])
self.cookie = loggingData["cookie"]
self.name = loggingData["name"]
# Example usage:
studentData = PegasusData()
studentData.__GetData__()
print(f"Logged in as: {studentData.name}")
This project is licensed under the Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) license. See the LICENSE.txt file for more details.
Chrysaor is an independent project and is not officially affiliated with or endorsed by the IONIS school group or the Pegasus service.