Skip to main content

json2qti

PyPI version Lint Test

Instantly convert simple JSON files into QTI import packages for your LMS.

json2qti is a lightweight, zero-dependency tool designed to bridge the gap between AI-generated content and Learning Management Systems (Canvas, Blackboard, Moodle, Brightspace, etc.).

🚀 Why json2qti?

  • LLM Optimized: The input JSON format is designed to be extremely token-efficient, making it perfect for generating quizzes with ChatGPT, Claude, or other LLMs.
  • Zero Dependencies: Runs entirely on the Python standard library. No complex environment setup required.
  • Universal Compatibility: Generates standard QTI v1.2 packages compatible with major LMS platforms.

📄 JSON Format

The input format is minimal by design.

  1. Quiz Title: The top-level key.
  2. Questions: Keys inside the object.
  3. Answers: A list of strings. The first answer is always the correct one. (Don't worry, json2qti shuffles them in the output file).
{
  "Basic Math Quiz": {
    "What is 1+1?": ["2", "3", "4", "5"],
    "What is 1+2?": ["3", "4", "5", "6"]
  }
}
Advanced: Code Formatting

You can include code snippets using markdown-style syntax:

  • Inline Code: Wrap text in single backticks (`).
  • Block Code: Wrap text in triple backticks (```).
{
  "Python Quiz": {
    "What does `print('hello')` output?": [
      "`hello` to stdout",
      "`hello` to stderr",
      "Nothing"
    ],
    "What does this function do?\n```\ndef add(a, b):\n    return a + b\n```": [
      "Returns the sum of two numbers",
      "Returns the product of two numbers",
      "Prints the numbers"
    ]
  }
}

💻 Usage

Quick Run (Recommended)

You can run it directly using pipx without installing anything globally:

pipx run json2qti quiz.json
Manual Execution

Since the tool is a single file, you can also just download json2qti.py and run it:

python3 json2qti.py quiz.json
# Creates quiz.zip ready for LMS import

🛠️ Development

This project includes a test suite to ensure reliability. Tests are located in the tests/ directory.

make test

📦 Dependencies

Just Python 3.

Metadata

Release files for json2qti 1.3.0

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

Source distribution (sdist)

Source distribution for json2qti 1.3.0
File Size Uploaded Provenance
json2qti-1.3.0.tar.gz 7.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 13.4 kB

Release files / json2qti-1.3.0.tar.gz

Download URL json2qti-1.3.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4fc0f9928fbc87847ddaab0c948597eb6d90a43bb47ac50cb5f09bf18d12f111
BLAKE2b-256 checksum
How to use checksums
05094ecc51e03d942db61222a2e79a955a357f98eea413ea637c2ea5b2c4e1c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / json2qti-1.3.0-py3-none-any.whl

Download URL json2qti-1.3.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05b27cf8111d84bcf9c52c1a042453e96409aaaa12d9750750cebe534bd4697b
BLAKE2b-256 checksum
How to use checksums
e927759238e5035e69f9224137c4b308a5927b3abe095e74a4fcf4e4c807e90f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for json2qti 1.3.0

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