Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pygiftparserrgmf

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pygiftparserrgmf

Moodle GIFT files parser

  • 0.0.5
  • PyPI
  • Socket score

Maintainers
1

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/.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc