pyMoodle
A python client for Moodle web services still in development.
Usage
MoodleClient (and its asynchronous counterpart AsyncMoodleClient)
provides a typed method for every webservice function of Moodle.
Results are returned as TypedDicts,
so type checkers and IDEs know which keys are available:
from moodle.session import MoodleClient
with MoodleClient("https://moodle.example.com", "TOKEN") as client:
info = client.core_webservice_get_site_info()
print(info["sitename"])
userid = info["userid"]
# Moodle declares most return values as nullable, so they need to be checked.
assert userid is not None
for course in client.core_enrol_get_users_courses(userid=userid):
print(course["fullname"])
The types of parameters and return values can be imported from moodle.ws.types,
e.g. CoreWebserviceGetSiteInfoReturns.
Functions which are not covered by the bindings
(e.g. from third-party plugins)
can be called using client.webservice("function_name", {"param": "value"}).
The bindings are generated from the source code of the latest Moodle LTS release.
See codegen/ for how they are generated
and how to generate bindings for other Moodle versions or additional plugins.
Development
The development tools are listed in the dev dependency group:
pip install -e . --group dev
ruff check && ruff format --check
mypy && pyright
python -m unittest discover tests
Metadata
Release files for pymoodle 0.4.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 | |
|---|---|---|---|
| pymoodle-0.4.1.tar.gz | 237.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymoodle-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 466.6 kB
Release files / pymoodle-0.4.1.tar.gz
| Download URL | pymoodle-0.4.1.tar.gz |
|---|---|
| Size | 237.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
566eadac33e4341c69bb902e4b8f8cdbc7b90262bb257eeca8a2d3d108b084c0
|
|
BLAKE2b-256 checksum How to use checksums |
547ed100a0a1824ef6156167075a8603a097663d0eb2b43adc81271fceed47e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.
Transparency logRelease files / pymoodle-0.4.1-py3-none-any.whl
| Download URL | pymoodle-0.4.1-py3-none-any.whl |
|---|---|
| Size | 228.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2122fd36c1eec23d06390448b28f3f27067cbfacbcb1a0cd48cdbe73a2ce622
|
|
BLAKE2b-256 checksum How to use checksums |
55844b59c91d31db5c9171cb4d11431ece40c92aad4af6edce0fd04f6d5b7b07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.
Transparency log