Skip to main content

Python wrapper for moodle web service.

Project description

moodlepy

PyPi Package Version Supported Python versions LICENSE Tests codecov pre-commit Mypy

Python wrapper for moodle web service.

Introduction

This library provide a pure Python interface for Moodle Web Service. It's compatible with Python versions 3.6+

Installing

You can install or upgrade moodlepy with:

pip install moodlepy --upgrade

Or you can install from source with:

git clone https://github.com/hexatester/moodlepy
cd moodlepy
python setup.py install

Usage

Example usage

from moodle import Moodle
url = 'https://my.domain/webservice/rest/server.php'
token = 'super secret token'
moodle = Moodle(url, token)
raw_site_info = moodle('core_webservice_get_site_info')
site_info = moodle.core.webservice.get_site_info()  # return typed site_info

print(raw_site_info)
print(site_info)

# or
from moodle import Mdl
from moodle.core.webservice import BaseWebservice

moodle = Mdl(url, token)
webservice = BaseWebservice(moodle)
site_info2 = webservice.get_site_info()

assert site_info == site_info2

❗️ If the function area does not have a type in the support table, the return value is in accordance with the Moodle web service documentation, wich mostly dict.

In the near future all of Web service functions will be covered by moodlepy.

Moodle Web Service support

❗️ Not all types and methods are supported, since moodlepy is not yet released. (A = Added.)

Area Functions Types Tests Status
auth_email A A
block A A
core_auth A A
core_backup A A
core_badge A A A
core_blog A A A
core_calendar A A
core_cohort A A
core_comment
core_competency
core_completion A A
core_course
core_customfield A A
core_enrol
core_fetch
core_files
core_filters
core_form
core_get
core_grade
core_grades
core_grading
core_group
core_h5p
core_message A
core_notes A A
core_output
core_question
core_rating
core_role
core_search
core_session
core_tag
core_update
core_user
core_webservice A A A A
enrol_guest A A
enrol_manual A A
enrol_self A A
gradereport_overview
gradereport_user
gradingform_guide
gradingform_rubric
local_mobile
message_airnotifier
message_popup
mod_assign
mod_book
mod_chat A
mod_choice
mod_data A
mod_feedback
mod_folder A A
mod_forum
mod_glossary
mod_imscp
mod_label
mod_lesson
mod_lti
mod_page A A
mod_quiz
mod_resource A A
mod_scorm
mod_survey
mod_url A A
mod_wiki
mod_workshop A
report_competency
report_insights
tool_analytics
tool_lp
tool_mobile A A
tool_templatelibrary
tool_usertours
tool_xmldb

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

moodlepy-0.22.2.tar.gz (77.4 kB view details)

Uploaded Source

Built Distribution

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

moodlepy-0.22.2-py3-none-any.whl (141.5 kB view details)

Uploaded Python 3

File details

Details for the file moodlepy-0.22.2.tar.gz.

File metadata

  • Download URL: moodlepy-0.22.2.tar.gz
  • Upload date:
  • Size: 77.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.9 Linux/5.4.0-1032-azure

File hashes

Hashes for moodlepy-0.22.2.tar.gz
Algorithm Hash digest
SHA256 cf322de9c7e6d1926961f9d2dce8981dc21018c127a70f5d46793d657ce4d697
MD5 cb61d105cd4e1e7a841f9d92bd3c83c4
BLAKE2b-256 e8b21c5ed7896d2c22b31b5b4da310e2e93c0f6f4f029bfb715f127f4c2ac8c9

See more details on using hashes here.

File details

Details for the file moodlepy-0.22.2-py3-none-any.whl.

File metadata

  • Download URL: moodlepy-0.22.2-py3-none-any.whl
  • Upload date:
  • Size: 141.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.9 Linux/5.4.0-1032-azure

File hashes

Hashes for moodlepy-0.22.2-py3-none-any.whl
Algorithm Hash digest
SHA256 98f9fafc047e098dc96e600b04ecc43cc894ae6e2a3b0279eddebdd26d57e685
MD5 f6614dbd3d5261ae597944c8b711e395
BLAKE2b-256 2ecc9877bb2b99cc48797823fb45ff6f97d9ae4ca6ac74ef2805f5878f57c273

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