Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

feb-ri/moodle-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moodle-kit

A small Python package with some functionalities to deal with moodle-based LMS.

Installation

# New installation
pip3 install moodle-kit

or

# Upgrade installation
pip3 install moodle-kit --upgrade

Usage

# Import Moodle class from package
from moodle_kit import Moodle

# Instantiate an object from Moodle class
moodle = Moodle()

Available features

  • Login
login_url = 'https://example.com/login/index.php'
username = 'your_username'
password = 'your_password'

moodle.login(login_url, username, password)

# The response object is automatically saved in moodle.response property.So you can check the status code this way.
print(moodle.response.status_code)

# To verify if login is successful, you can print the page title.
print(moodle.title)

# On the other hand, you can also assign a varible to it.
response = moodle.login(login_url, username, password)
print(response.status_code)
  • Logout
moodle.logout()

# After logging out, the moodle.response property is updated. 
# So, you can verify if it's successful or not by printing the url.
print(moodle.response.url)

About

A small Python package with some functionalities to deal with moodle-based LMS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages