moodlepy
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.8+
Install moodlepy<=0.22.2 for python 3.6 support. Install moodlepy<=0.23.8 for python 3.7 support.
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)
dict_site_info = moodle('core_webservice_get_site_info')
site_info = moodle.core.webservice.get_site_info() # return typed site_info
print(dict_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 future all of Web service functions will be covered by moodlepy.
Moodle Web Service support
| 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 | A | A | ||
| 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_grades | A | |||
| 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 |
Metadata
Release files for moodlepy 0.24.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moodlepy-0.24.1.tar.gz | 82.2 kB | Without provenance | Details for moodlepy-0.24.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moodlepy-0.24.1-py3-none-any.whl | Python 3 | none | any | Details for moodlepy-0.24.1-py3-none-any.whl |
Total release size: 235.5 kB
Release files / moodlepy-0.24.1.tar.gz
| Download URL | moodlepy-0.24.1.tar.gz |
|---|---|
| Size | 82.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94d361e4da56748d29910e01979e4652a42220994112b4f07589f200cb7915e3
|
|
BLAKE2b-256 checksum How to use checksums |
6983d03072735fc822b225efefa7f7646a4ed6cd73d1c717a338871b9958ce5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.9.20 Linux/6.5.0-1025-azure
|
Release files / moodlepy-0.24.1-py3-none-any.whl
| Download URL | moodlepy-0.24.1-py3-none-any.whl |
|---|---|
| Size | 153.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2809ece7a167d7ecc2a744cde188f0af66e1db58863e7a2ed77d1a0b08ff82e2
|
|
BLAKE2b-256 checksum How to use checksums |
186bc526e3230e20171d7791f0fb2137aa4b49c82d9878959f089be1162a7c72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.9.20 Linux/6.5.0-1025-azure
|
Security for moodlepy 0.24.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.