Skip to main content

Python Moodle GIFT parser

Python Moodle GIFT parser is a parser for GIFT files: https://docs.moodle.org/38/en/GIFT_format

The program consist in two parts: parser.py with lex/yacc and gift.py with classes where parser results will saved. The class Gift will contain all questions and every Question will have an answer (there are several types of answers - read the Moodle GIFT documentation).

How to run (use) the parser

There is an example.py script python with an example. This script expect a file and parse it. After that it prints the object Gift with all information catched by the parser.

Use it like a package in your own project

You can install it like a package using pip from pypi.org: pip install pygiftparserrgmf.

After that, you can parse a file like this:

from pygiftparserrgmf import parser

with open('gift_file.txt', 'r') as myfile:
    s = myfile.read()
    gift_object = parser.parse(s)

From here you'll have Gift object into gift_object (see pygiftparser/gift.py file).

Hot to test the parser

Inside tests folder there are several tests. You can run all of them executing the command python -m unittest discover -v -s tests/.

Metadata

Release files for pygiftparserrgmf 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygiftparserrgmf 0.0.5
File Size Uploaded Provenance
pygiftparserrgmf-0.0.5.tar.gz 11.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pygiftparserrgmf 0.0.5
File Interpreter ABI Platform
pygiftparserrgmf-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 41.9 kB

Release files / pygiftparserrgmf-0.0.5.tar.gz

Download URL pygiftparserrgmf-0.0.5.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
81f88d86f838b4e28e671ca5543b14a994b2d34d96d0d658b962dbc393a8cd1b
BLAKE2b-256 checksum
How to use checksums
89d6021124de3f22e2aeffb5bd7562ebe97a3e04bf672db0814c2a3f68cd9ade
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release files / pygiftparserrgmf-0.0.5-py3-none-any.whl

Download URL pygiftparserrgmf-0.0.5-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0084fca6b73f0f47813e1cf168cdaef39e236bf94b34931891451ec45ae4d2ec
BLAKE2b-256 checksum
How to use checksums
c249671beff93bb460139c8156ec0faa5af652b3f1cb0ae35e9353c8a54cb6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Security for pygiftparserrgmf 0.0.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page