Retrieving Data from ANS with Python
Released under the MIT License
Oliver Lindemann, Erasmus University Rotterdam, NL
--
python -m pip install getans
Python 3.10 and the following libraries:
- pandas (>=2.2)
- appdirs (>=1.4)
- requests (>=2.32)
call: python -m getANS
usage: getANS [-h] [--usage] [--token] [--new [DATABASE_NAME]] [--exercises] [--results] [--submissions] [--courses] [--grades] [--assignments]
[--file [EXCEL_FILE]]
[DATABASE]
Retrieving Data from ANS.
positional arguments:
DATABASE database file
options:
-h, --help show this help message and exit
--usage show typical workflow
--token setting access token
Retrieve / Download:
--new [DATABASE_NAME], -n [DATABASE_NAME]
initiate new database
--results retrieve results
--exercises retrieve exercises & questions
--submissions retrieve submissions
Show / Export:
--courses, -c list all courses
--grades, -g list all grades
--assignments, -a overview all assignments
--file [EXCEL_FILE], -f [EXCEL_FILE]
export what is shown to excel
(c) Oliver Lindemann
Ensure that you have set an access token (call '--token'). A new token can be generated via the ANS website: https://ans.app/users/tokens
-
Initiate new database:
--new mydatabase
and follow instructions -
Download grades (results):
mydatabase --results
-
Download all questions (exercises):
mydatabase --exercises
(that might take a while!) -
Show assignment overview:
mydatabase -a
-
Show grades:
mydatabase -r
To save assignments, courses or grades add
--file myexcelfile.xlsx
to a show command
API documentation is work in progress
see demo script getans_demo.py