txttoqti


Nametxttoqti JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummaryUniversal converter that transforms text-based question banks into QTI packages compatible with Canvas LMS
upload_time2025-09-05 18:52:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords assessment canvas education lms qti quiz
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # txttoqti

txttoqti is a universal converter that transforms text-based question banks into QTI (Question & Test Interoperability) packages compatible with Canvas LMS and other learning management systems. This package is designed to simplify the process of creating QTI packages from plain text files, making it easier for educators and developers to manage and distribute assessments.

## Features

- **Universal Format Support**: Convert plain text question banks to QTI packages
- **Canvas LMS Compatibility**: Full compatibility with Canvas LMS and other QTI-compliant systems
- **Smart Conversion**: Change detection and incremental updates with `SmartConverter`
- **Educational Workflow**: Zero-configuration auto-detection for educational environments
- **Comprehensive Validation**: Built-in question format validation and error reporting
- **Multiple Interfaces**: Command-line tools, Python API, and educational CLI
- **No Dependencies**: Uses only Python standard library (Python 3.10+)

## Quick Start

### Installation

Install from PyPI:
```bash
pip install txttoqti
```

Or install from source:
```bash
git clone https://github.com/julihocc/txttoqti.git
cd txttoqti
pip install .
```

### Basic Usage

**New Intuitive Python API (Recommended):**
```python
import txttoqti

# Create converter object
converter = txttoqti.TxtToQti()

# Load questions from file
converter.read_txt("questions.txt")

# Save to QTI package  
converter.save_to_qti("quiz.zip")

# Or chain methods together
converter.read_txt("questions.txt").save_to_qti("quiz.zip")
```

**Quick One-Line Conversion:**
```python
import txttoqti
txttoqti.quick_convert("questions.txt", "quiz.zip")
```

**Command Line:**
```bash
# Basic CLI
txttoqti -i questions.txt -o quiz.zip

# Educational CLI with auto-detection
txttoqti-edu
```

### Question Format

Questions should follow this format:

```
Q1: What is the result of type(42) in Python?
A) <class 'float'>
B) <class 'int'>
C) <class 'str'>
D) <class 'number'>
ANSWER: B
```

## Documentation

| Document | Description |
|----------|-------------|
| [Installation Guide](docs/installation.md) | Detailed installation instructions and setup |
| [API Reference](docs/api.md) | Complete API documentation with all classes and methods |
| [CLI Documentation](docs/cli.md) | Command-line interface usage and options |
| [Question Format](docs/question-format.md) | Supported question formats and validation rules |
| [Examples](docs/examples.md) | Comprehensive usage examples and integration patterns |

## Supported Question Types

- **Multiple Choice**: Standard A/B/C/D format with single correct answer
- **True/False**: Binary choice questions
- **Short Answer**: Text input questions
- **Essay**: Long-form text responses

## Command-Line Tools

### Basic CLI (`txttoqti`)
Simple, direct conversion tool:
```bash
txttoqti -i input.txt -o output.zip
```

### Educational CLI (`txttoqti-edu`)
Enhanced tool with auto-detection and interactive features:
```bash
txttoqti-edu --interactive  # Interactive troubleshooting
txttoqti-edu --status      # Show current status
txttoqti-edu --force       # Force regeneration
```

## Advanced Features

### Working with Multiple Files
```python
import txttoqti
from pathlib import Path

converter = txttoqti.TxtToQti()

# Process multiple files
for txt_file in Path("questions").glob("*.txt"):
    output_name = txt_file.stem + ".zip"
    converter.read_txt(txt_file).save_to_qti(output_name).clear()
```

### Validation and Preview
```python
import txttoqti

converter = txttoqti.TxtToQti()
converter.read_txt("questions.txt")

# Check what was loaded
print(f"Loaded {len(converter)} questions")
print(converter.preview())

# Validate before saving
if converter.validate():
    converter.save_to_qti("validated_quiz.zip")
```

### Working with Strings
```python
import txttoqti

# Load questions from a string (useful for dynamic content)
questions_text = """
Q1: What is Python?
A) A snake
B) A programming language
C) A tool
D) A framework
ANSWER: B
"""

converter = txttoqti.TxtToQti()
converter.read_string(questions_text)
converter.save_to_qti("string_quiz.zip")
```

### Legacy Interfaces (Still Supported)

#### Smart Conversion
```python
from txttoqti import SmartConverter

converter = SmartConverter()
# Only converts if source file has changed
qti_file = converter.convert_file("questions.txt")
```

#### Educational Workflows
```python
from txttoqti.educational import QtiConverter

converter = QtiConverter()  # Auto-detects course structure
success = converter.convert()
```

#### Original API
```python
from txttoqti import TxtToQtiConverter

converter = TxtToQtiConverter()
qti_file = converter.convert_file("questions.txt")
```

## Requirements

- Python 3.10 or higher
- No external dependencies (uses only standard library)

## Contributing

Contributions are welcome! Please feel free to:

- Submit bug reports and feature requests via [GitHub Issues](https://github.com/julihocc/txttoqti/issues)
- Submit pull requests for improvements
- Improve documentation
- Add support for additional question formats

### Development Setup

```bash
git clone https://github.com/julihocc/txttoqti.git
cd txttoqti
pip install -e ".[dev]"
```

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Support

- **Documentation**: Comprehensive guides in the `docs/` directory
- **Examples**: See `examples/` directory for sample question files
- **Issues**: Report bugs on [GitHub Issues](https://github.com/julihocc/txttoqti/issues)
- **Interactive Help**: Use `txttoqti-edu --interactive` for troubleshooting

## Related Projects

- [QTI Specification](https://www.imsglobal.org/question/) - Official QTI standards
- [Canvas LMS](https://www.instructure.com/canvas) - Learning management system
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "txttoqti",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "assessment, canvas, education, lms, qti, quiz",
    "author": null,
    "author_email": "\"Juliho C.C.\" <julihocc@yahoo.com>",
    "download_url": "https://files.pythonhosted.org/packages/51/34/e0210d5530e034a0c5d4900a1cf5bcebc063719f3a9a41d291199baf1d95/txttoqti-0.5.0.tar.gz",
    "platform": null,
    "description": "# txttoqti\n\ntxttoqti is a universal converter that transforms text-based question banks into QTI (Question & Test Interoperability) packages compatible with Canvas LMS and other learning management systems. This package is designed to simplify the process of creating QTI packages from plain text files, making it easier for educators and developers to manage and distribute assessments.\n\n## Features\n\n- **Universal Format Support**: Convert plain text question banks to QTI packages\n- **Canvas LMS Compatibility**: Full compatibility with Canvas LMS and other QTI-compliant systems\n- **Smart Conversion**: Change detection and incremental updates with `SmartConverter`\n- **Educational Workflow**: Zero-configuration auto-detection for educational environments\n- **Comprehensive Validation**: Built-in question format validation and error reporting\n- **Multiple Interfaces**: Command-line tools, Python API, and educational CLI\n- **No Dependencies**: Uses only Python standard library (Python 3.10+)\n\n## Quick Start\n\n### Installation\n\nInstall from PyPI:\n```bash\npip install txttoqti\n```\n\nOr install from source:\n```bash\ngit clone https://github.com/julihocc/txttoqti.git\ncd txttoqti\npip install .\n```\n\n### Basic Usage\n\n**New Intuitive Python API (Recommended):**\n```python\nimport txttoqti\n\n# Create converter object\nconverter = txttoqti.TxtToQti()\n\n# Load questions from file\nconverter.read_txt(\"questions.txt\")\n\n# Save to QTI package  \nconverter.save_to_qti(\"quiz.zip\")\n\n# Or chain methods together\nconverter.read_txt(\"questions.txt\").save_to_qti(\"quiz.zip\")\n```\n\n**Quick One-Line Conversion:**\n```python\nimport txttoqti\ntxttoqti.quick_convert(\"questions.txt\", \"quiz.zip\")\n```\n\n**Command Line:**\n```bash\n# Basic CLI\ntxttoqti -i questions.txt -o quiz.zip\n\n# Educational CLI with auto-detection\ntxttoqti-edu\n```\n\n### Question Format\n\nQuestions should follow this format:\n\n```\nQ1: What is the result of type(42) in Python?\nA) <class 'float'>\nB) <class 'int'>\nC) <class 'str'>\nD) <class 'number'>\nANSWER: B\n```\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Installation Guide](docs/installation.md) | Detailed installation instructions and setup |\n| [API Reference](docs/api.md) | Complete API documentation with all classes and methods |\n| [CLI Documentation](docs/cli.md) | Command-line interface usage and options |\n| [Question Format](docs/question-format.md) | Supported question formats and validation rules |\n| [Examples](docs/examples.md) | Comprehensive usage examples and integration patterns |\n\n## Supported Question Types\n\n- **Multiple Choice**: Standard A/B/C/D format with single correct answer\n- **True/False**: Binary choice questions\n- **Short Answer**: Text input questions\n- **Essay**: Long-form text responses\n\n## Command-Line Tools\n\n### Basic CLI (`txttoqti`)\nSimple, direct conversion tool:\n```bash\ntxttoqti -i input.txt -o output.zip\n```\n\n### Educational CLI (`txttoqti-edu`)\nEnhanced tool with auto-detection and interactive features:\n```bash\ntxttoqti-edu --interactive  # Interactive troubleshooting\ntxttoqti-edu --status      # Show current status\ntxttoqti-edu --force       # Force regeneration\n```\n\n## Advanced Features\n\n### Working with Multiple Files\n```python\nimport txttoqti\nfrom pathlib import Path\n\nconverter = txttoqti.TxtToQti()\n\n# Process multiple files\nfor txt_file in Path(\"questions\").glob(\"*.txt\"):\n    output_name = txt_file.stem + \".zip\"\n    converter.read_txt(txt_file).save_to_qti(output_name).clear()\n```\n\n### Validation and Preview\n```python\nimport txttoqti\n\nconverter = txttoqti.TxtToQti()\nconverter.read_txt(\"questions.txt\")\n\n# Check what was loaded\nprint(f\"Loaded {len(converter)} questions\")\nprint(converter.preview())\n\n# Validate before saving\nif converter.validate():\n    converter.save_to_qti(\"validated_quiz.zip\")\n```\n\n### Working with Strings\n```python\nimport txttoqti\n\n# Load questions from a string (useful for dynamic content)\nquestions_text = \"\"\"\nQ1: What is Python?\nA) A snake\nB) A programming language\nC) A tool\nD) A framework\nANSWER: B\n\"\"\"\n\nconverter = txttoqti.TxtToQti()\nconverter.read_string(questions_text)\nconverter.save_to_qti(\"string_quiz.zip\")\n```\n\n### Legacy Interfaces (Still Supported)\n\n#### Smart Conversion\n```python\nfrom txttoqti import SmartConverter\n\nconverter = SmartConverter()\n# Only converts if source file has changed\nqti_file = converter.convert_file(\"questions.txt\")\n```\n\n#### Educational Workflows\n```python\nfrom txttoqti.educational import QtiConverter\n\nconverter = QtiConverter()  # Auto-detects course structure\nsuccess = converter.convert()\n```\n\n#### Original API\n```python\nfrom txttoqti import TxtToQtiConverter\n\nconverter = TxtToQtiConverter()\nqti_file = converter.convert_file(\"questions.txt\")\n```\n\n## Requirements\n\n- Python 3.10 or higher\n- No external dependencies (uses only standard library)\n\n## Contributing\n\nContributions are welcome! Please feel free to:\n\n- Submit bug reports and feature requests via [GitHub Issues](https://github.com/julihocc/txttoqti/issues)\n- Submit pull requests for improvements\n- Improve documentation\n- Add support for additional question formats\n\n### Development Setup\n\n```bash\ngit clone https://github.com/julihocc/txttoqti.git\ncd txttoqti\npip install -e \".[dev]\"\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- **Documentation**: Comprehensive guides in the `docs/` directory\n- **Examples**: See `examples/` directory for sample question files\n- **Issues**: Report bugs on [GitHub Issues](https://github.com/julihocc/txttoqti/issues)\n- **Interactive Help**: Use `txttoqti-edu --interactive` for troubleshooting\n\n## Related Projects\n\n- [QTI Specification](https://www.imsglobal.org/question/) - Official QTI standards\n- [Canvas LMS](https://www.instructure.com/canvas) - Learning management system",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Universal converter that transforms text-based question banks into QTI packages compatible with Canvas LMS",
    "version": "0.5.0",
    "project_urls": {
        "Changelog": "https://github.com/julihocc/txttoqti/releases",
        "Documentation": "https://github.com/julihocc/txttoqti#readme",
        "Homepage": "https://github.com/julihocc/txttoqti",
        "Issues": "https://github.com/julihocc/txttoqti/issues",
        "Repository": "https://github.com/julihocc/txttoqti"
    },
    "split_keywords": [
        "assessment",
        " canvas",
        " education",
        " lms",
        " qti",
        " quiz"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "94e9aaab702b41f2d43522f683bc2cceed8ce343c6323ea050ad73daccd54b63",
                "md5": "ecd07d90620c816314d1f11f072ea5ed",
                "sha256": "8bab7a167727576073f6c695f9a9b0b605d1e720a6010affbbdb016fc52b6f96"
            },
            "downloads": -1,
            "filename": "txttoqti-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ecd07d90620c816314d1f11f072ea5ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 32196,
            "upload_time": "2025-09-05T18:52:20",
            "upload_time_iso_8601": "2025-09-05T18:52:20.569921Z",
            "url": "https://files.pythonhosted.org/packages/94/e9/aaab702b41f2d43522f683bc2cceed8ce343c6323ea050ad73daccd54b63/txttoqti-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5134e0210d5530e034a0c5d4900a1cf5bcebc063719f3a9a41d291199baf1d95",
                "md5": "5c306cf3db55dcdb388f08f695d27f79",
                "sha256": "ba1038361320f5018e06420b4651f1c39eafd88340f97e7abaca5334f0c3fd13"
            },
            "downloads": -1,
            "filename": "txttoqti-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5c306cf3db55dcdb388f08f695d27f79",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 104284,
            "upload_time": "2025-09-05T18:52:21",
            "upload_time_iso_8601": "2025-09-05T18:52:21.658882Z",
            "url": "https://files.pythonhosted.org/packages/51/34/e0210d5530e034a0c5d4900a1cf5bcebc063719f3a9a41d291199baf1d95/txttoqti-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-05 18:52:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "julihocc",
    "github_project": "txttoqti",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "txttoqti"
}
        
Elapsed time: 0.50015s