Skip to main content

Unofficial module for Ourvle

Project description

OurvleApi

Unofficial API to interface with OurVle through python

Getting Started:

Install package with pip
pip install OurvleApi
Import the package
from OurvleApi import ourvle

Features:

Without Login

  • View and read news
  • Get help information
  • login

With Login:

  • View all your courses
  • Get detailed information about your courses, including the lecturers, resources. news and links

Functions:

Without Login

ourvle.news()
  • Returnts a list of News objects (sourced from the front page)
news_list = ourvle.news()
ourvle.help()
  • Prints a string of helpful information
ourvle.login(username,password)
  • Accepts strings for username and password
  • Returns a Client object
  • Prints the name of the user
client = login(username,password)
  ==> Alexander McIntosh

With Login

Client:

Client.session
  • Returns a session object with the necessary cookies to traverse the website
Client.course_list
  • Returns a list of Course objects
my_courses = client.course_list
print(my_courses)
  ==> [COMP1161, COMP1210,...]
print(my_courses[1])
  ==> COMP1210 | S2_2022/23 Mathematics for Computing ['Fake Name', 'Faker Name']
Client.user
  • Returns a string of the name of the current user
client.user
  ==> Alexander McIntosh

Course:

Course.name
  • Returns a string of the course name
test_course = my_courses[1]
test_course.name
  ==> S2_2022/23 Mathematics for Computing
Course.code
  • Returns a string of the course code
test_course.code
  ==> COMP1210
Course.link
  • Returns a string of the link to the course page
  ==> https://ourvle.mona.uwi.edu/course/....
Course.teachers
  • Returns a list of dictionaries with the course teachers' information
test_course.teachers
  ==> [{'role': 'Lecturer', 'name': 'Fake Name', 'profile_link': 'https://ourvle.mona.uwi.edu/user....'}, {'role': 'Tutor', 'name': 'Faker Name', 'profile_link': 'https://ourvle.mona.uwi.edu/user....'}]
Course.resources()
  • returns a list of dictionaries with the course resources organized by topic (or section)
test_course.resources()
  ==> [{'section_name': 'NOTICE', 'resources': [Course Outline File, TEXTBOOK (New Elementary Approach to Japanese)  Units 1-2 File, Textbook Units 1-5 File,...]}...]
Course.links()
  • returnsa a list of dictionaries with the course links organized by topic (or section) including links to online classes.
test_course.links()
  ==> [{'section_name': 'General', 'links': []}, {'section_name': 'COURSE OUTLINE', 'links': []}, {'section_name': 'ZOOM ONLINE TEACHING CORNER', 'links': [{'name': 'ZOOM LECTURES  (ONLINE) - Mona and WJC_Tuesdays', 'link': 'https://ourvle.mona.uwi.edu/....}]

(experimental)

Course.blocks()
  • Returns a list of dictionaries with information in blocks located around the course page (if any)
test_course.blocks()
  ==> []
Course.news()
  • Returns a list of dictionaries with information about items in the course news block (if any)
test_course.news()
  ==> [{'date': '31 Jan, 21:55', 'author': Fake Name, 'topic': 'ONLINE Tutorial', 'link': 'https://ourvle.mona.uwi.edu/...}]

Resource

Resource.name
  • Returns a string with the name of the Resource
resource.name
  ==> 'Course Outline File'
Resource.details
  • Returns a string with the Resource details
resource.details
  ==> '15KB Word document'
Resource.link
  • Returns a string with the link to the resource
resource.link
  ==>'https://ourvle.mona.uwi.edu/mod/resource/view....'
Resource.download(*name)
  • Downloads the resource
  • If no name is passed, uses the resource name
  • File extension should not be included when passing the name
resource.download("outline")

News:

News.topic
  • Returns the topic of the news post as a string
test_news = news_list[0]
test_news.topic
  ==> 'Unavailability of UWI Mona ICT Services; December 28 - 31, 2022'
News.author
  • Returns the author of the news post as a string
test_news.author
  ==> 'OurVle Administrator'
News.date
  • Returns the date the news was posted as a string
test_news.date
  ==>'Tue, 27 Dec 2022, 1:32 PM'
News.link
  • Returns the link to the news post as a string
test_news.link
  ==> 'https://ourvle.mona.uwi.edu/mod/forum/....'
News.content()
  • Reuturns the content of the news post as a string
test_news.content()
  ==> 'TO WHOM IT MAY CONCERN\n\xa0\nGood day.\nAs per a Mona Messaging announcement sent on Dec.... Regards,'

DISCLAIMER:

This API is not affiliated with, endorsed by, or sponsored by the University of the West Indies (UWI) or OurVle. The information provided through this API is intended for educational and informational purposes only and is not guaranteed to be accurate or up-to-date. The University of the West Indies and OurVle are the sole owners of all rights, title, and interest in OurVle. Use of this API is subject to the terms and conditions outlined by the University of the West Indies and OurVle. By using this API, you agree to indemnify and hold harmless the University of the West Indies and OurVle for any and all claims arising from your use of this API.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

OurvleApi-0.3.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

OurvleApi-0.3.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file OurvleApi-0.3.1.tar.gz.

File metadata

  • Download URL: OurvleApi-0.3.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for OurvleApi-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2480de43a15d8af87b7f6f4a634c0cc7e2094d74f1ac97b67ed0297d31124c52
MD5 5b91453965088309c9af8d7e031c4914
BLAKE2b-256 a3eaca5216d772ecd3cfb83c08dece6642f9f58f7062dc72b93d1784c6aeeb7d

See more details on using hashes here.

File details

Details for the file OurvleApi-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: OurvleApi-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for OurvleApi-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b26e57dcda8d34a77c6d463cb1d76e2f1c37b75d1a1203211b5c56f412d1de66
MD5 198381f5366e41826a78c16edfc5dd11
BLAKE2b-256 edad47d70e8dda8a33861756e02387fac58b8c8cdb61655c7fcc69fae712dbc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page