py2gift


Namepy2gift JSON
Version 0.0.6.1 PyPI version JSON
download
home_pagehttps://github.com/manuvazquez/py2gift/tree/master/
SummaryMake input files for gift-wrapper programmatically
upload_time2023-04-07 08:22:24
maintainer
docs_urlNone
authorManuel A. Vázquez
requires_python>=3.10
licenseApache Software License 2.0
keywords gift moodle python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            py2gift
================

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

`py2gift` is a library meant to write [question
banks](https://docs.moodle.org/38/en/Question_bank) in
[GIFT](https://docs.moodle.org/38/en/GIFT_format) format
([Moodle](https://moodle.org/)) *programmatically* in Python.
Ultimately, questions can be written (though this is not a requirement)
from a [Jupyter](https://jupyter.org/) notebook. The advantages are:

- you can use all your Python skills to *compute* whatever is required
  for the statement, solution and feedback of a question
- it makes easy to write different (random) versions of the same
  question
- questions can be previewed (pictures, $\LaTeX$…) in the notebook
- no need to install anything: you can click this mybinder badge,
  [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/manuvazquez/py2gift/master?filepath=examples)
  , open any of the provided examples, and start writing your questions
  right now from the browser (the file generated at the end of the
  notebook, accesible through a link, can be imported in *Moodle*).

This library relies on
[gift-wrapper](https://github.com/manuvazquez/gift-wrapper) and it has
been created using [nbdev](https://github.com/fastai/nbdev). The latter
fact means you can [explore the *actual* source
code](https://manuvazquez.github.io/py2gift/) through jupyter notebooks
and see the inner workings of each individual piece.

## Setup

Since the library is in [PyPI](https://pypi.org/project/py2gift/)

    pip install py2gift

should do.

### Manual

If you’d rather clone this repository, the command below should install
all the required packages

    pip install pandas numpy matplotlib ruamel.yaml gift-wrapper

## How to use it

Writing a question involves specifying the statement and, *optionally*,
the feedback in different notebook cells. In any case, *variables*,
specified with the prefix `!`, can be included, and those are meant to
be *filled in* from within a Python class. This comes very handy when
you want to create different versions of a single question in which some
input data (maybe in the form of a picture) *randomly* changes from
question to question. Then, you can instruct `py2gift` to call your
Python code a number of times, each one giving rise to a different
version of the same question (as long as some *variable* is set at
random, e.g., by exploiting the functionality in `np.random`). The
solution, whose format depends on the question type, must also be set
from within the code.

Underneath, images are handled by *gift-wrapper*, and hence *paths*
(e.g., `images/scheme.svg`) to either `.tex` (that can be compiled with
*pdflatex*) or `.svg` files can be included in the statement, solution
or feedback of a question. Moreover, they can be included through one of
the variables (prefix `!`), and hence random (but nonetheless
meaningful) pictures are a possibility.

Notice that the difference between two instances of the same question
can be minor or significant. Ultimately, it depends on how sophisticated
your Python code is (if the latter can solve the question/problem in a
very general form, and you are also able to present it in the
`statement`, then it is fine).

Besides the above mentioned *core* functionality, `py2gift` provides
some extra functions to ease the process of writing questions (modules
`tex`, `util`, `time`, `hash`). However, a thorough description of the
functionality would be very dry and you are probably better off by
taking a look at one of the *sample* notebooks
([minimal](https://github.com/manuvazquez/py2gift/blob/master/examples/minimal.ipynb)
or
[example_1](https://github.com/manuvazquez/py2gift/blob/master/examples/example_1.ipynb)).
Also, you can take a look at the
[documentation](https://manuvazquez.github.io/py2gift/).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/manuvazquez/py2gift/tree/master/",
    "name": "py2gift",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "gift moodle python",
    "author": "Manuel A. V\u00e1zquez",
    "author_email": "manuavazquez@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d3/d6/38dafa0fd653435252ae01b91ad41aaa04a97527a9491c41a63dce0ed2cd/py2gift-0.0.6.1.tar.gz",
    "platform": null,
    "description": "py2gift\n================\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n`py2gift` is a library meant to write [question\nbanks](https://docs.moodle.org/38/en/Question_bank) in\n[GIFT](https://docs.moodle.org/38/en/GIFT_format) format\n([Moodle](https://moodle.org/)) *programmatically* in Python.\nUltimately, questions can be written (though this is not a requirement)\nfrom a [Jupyter](https://jupyter.org/) notebook. The advantages are:\n\n- you can use all your Python skills to *compute* whatever is required\n  for the statement, solution and feedback of a question\n- it makes easy to write different (random) versions of the same\n  question\n- questions can be previewed (pictures, $\\LaTeX$\u2026) in the notebook\n- no need to install anything: you can click this mybinder badge,\n  [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/manuvazquez/py2gift/master?filepath=examples)\n  , open any of the provided examples, and start writing your questions\n  right now from the browser (the file generated at the end of the\n  notebook, accesible through a link, can be imported in *Moodle*).\n\nThis library relies on\n[gift-wrapper](https://github.com/manuvazquez/gift-wrapper) and it has\nbeen created using [nbdev](https://github.com/fastai/nbdev). The latter\nfact means you can [explore the *actual* source\ncode](https://manuvazquez.github.io/py2gift/) through jupyter notebooks\nand see the inner workings of each individual piece.\n\n## Setup\n\nSince the library is in [PyPI](https://pypi.org/project/py2gift/)\n\n    pip install py2gift\n\nshould do.\n\n### Manual\n\nIf you\u2019d rather clone this repository, the command below should install\nall the required packages\n\n    pip install pandas numpy matplotlib ruamel.yaml gift-wrapper\n\n## How to use it\n\nWriting a question involves specifying the statement and, *optionally*,\nthe feedback in different notebook cells. In any case, *variables*,\nspecified with the prefix `!`, can be included, and those are meant to\nbe *filled in* from within a Python class. This comes very handy when\nyou want to create different versions of a single question in which some\ninput data (maybe in the form of a picture) *randomly* changes from\nquestion to question. Then, you can instruct `py2gift` to call your\nPython code a number of times, each one giving rise to a different\nversion of the same question (as long as some *variable* is set at\nrandom, e.g., by exploiting the functionality in `np.random`). The\nsolution, whose format depends on the question type, must also be set\nfrom within the code.\n\nUnderneath, images are handled by *gift-wrapper*, and hence *paths*\n(e.g., `images/scheme.svg`) to either `.tex` (that can be compiled with\n*pdflatex*) or `.svg` files can be included in the statement, solution\nor feedback of a question. Moreover, they can be included through one of\nthe variables (prefix `!`), and hence random (but nonetheless\nmeaningful) pictures are a possibility.\n\nNotice that the difference between two instances of the same question\ncan be minor or significant. Ultimately, it depends on how sophisticated\nyour Python code is (if the latter can solve the question/problem in a\nvery general form, and you are also able to present it in the\n`statement`, then it is fine).\n\nBesides the above mentioned *core* functionality, `py2gift` provides\nsome extra functions to ease the process of writing questions (modules\n`tex`, `util`, `time`, `hash`). However, a thorough description of the\nfunctionality would be very dry and you are probably better off by\ntaking a look at one of the *sample* notebooks\n([minimal](https://github.com/manuvazquez/py2gift/blob/master/examples/minimal.ipynb)\nor\n[example_1](https://github.com/manuvazquez/py2gift/blob/master/examples/example_1.ipynb)).\nAlso, you can take a look at the\n[documentation](https://manuvazquez.github.io/py2gift/).\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Make input files for gift-wrapper programmatically",
    "version": "0.0.6.1",
    "split_keywords": [
        "gift",
        "moodle",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "44c80e27322c33231ba0689b38905a273523431962222a75de0399eb6914afbe",
                "md5": "8920345747bba6a6a02ed13ccba5cb18",
                "sha256": "a8de8dfb940e959f94d1bfe4119c4d09eb583355c90eef67afc1a7e94706722f"
            },
            "downloads": -1,
            "filename": "py2gift-0.0.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8920345747bba6a6a02ed13ccba5cb18",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 30178,
            "upload_time": "2023-04-07T08:22:22",
            "upload_time_iso_8601": "2023-04-07T08:22:22.668747Z",
            "url": "https://files.pythonhosted.org/packages/44/c8/0e27322c33231ba0689b38905a273523431962222a75de0399eb6914afbe/py2gift-0.0.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d3d638dafa0fd653435252ae01b91ad41aaa04a97527a9491c41a63dce0ed2cd",
                "md5": "2266e072adf02ea4488d0b6be188f530",
                "sha256": "ccd93e979e3c58e02f095403a6d645ba3e1d7b21370f951fa41d9a0e594fe37c"
            },
            "downloads": -1,
            "filename": "py2gift-0.0.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2266e072adf02ea4488d0b6be188f530",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 29234,
            "upload_time": "2023-04-07T08:22:24",
            "upload_time_iso_8601": "2023-04-07T08:22:24.380996Z",
            "url": "https://files.pythonhosted.org/packages/d3/d6/38dafa0fd653435252ae01b91ad41aaa04a97527a9491c41a63dce0ed2cd/py2gift-0.0.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-07 08:22:24",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "py2gift"
}
        
Elapsed time: 0.07140s