doenetml-to-pretext
Python package for converting DoenetML to PreTeXt using Deno.
Requires Deno at runtime. Conversions shell out to Deno, so it must be available on your
PATH(or install thedenopip package).pip install doenetml-to-pretextalone does not install Deno.
Installation
pip install doenetml-to-pretext
The wheel bundles the compiled JavaScript converter, but you must supply Deno
yourself — either a system install on PATH or pip install deno.
Usage
from doenetml_to_pretext import convert_doenetml_to_pretext
doenetml = '<p>Hello <m>\\frac{1}{2}</m></p>'
pretext_xml = convert_doenetml_to_pretext(doenetml)
print(pretext_xml)
Requirements
- Python 3.8+
- Deno
API
convert_doenetml_to_pretext(doenetml: str, timeout: int = 30000) -> str
Converts a DoenetML XML string to PreTeXt XML.
Parameters:
doenetml(str): DoenetML XML source codetimeout(int): Timeout in milliseconds for conversion (default: 30000)
Returns:
- str: PreTeXt XML output
Raises:
ConversionError: If conversion failsBrowserError: If browser initialization failsTimeoutError: If conversion times out
Examples
Simple conversion
from doenetml_to_pretext import convert_doenetml_to_pretext
xml = '<p>Test</p>'
result = convert_doenetml_to_pretext(xml)
With error handling
from doenetml_to_pretext import convert_doenetml_to_pretext, ConversionError
try:
result = convert_doenetml_to_pretext('<p>Test</p>')
except ConversionError as e:
print(f"Conversion failed: {e}")
Development
Install dev dependencies:
pip install -e ".[dev]"
Build a wheel (.whl) (might need pip install build first):
python -m build --wheel
The built wheel will be placed in dist/.
Run tests:
pytest
Publishing
Releases are published to PyPI
automatically by the
publish-doenetml-to-pretext-python.yml
GitHub Actions workflow, using Trusted Publishing
(OIDC) — no API token is stored.
- Version: derived from
packages/doenetml/package.json, so it stays in lockstep with@doenet/doenetml. There is no separate version to bump here. - Trigger: GitHub
releaseevents only (the same trigger as the npm production release), never pushes tomain. Cutting a release whose tag matches thedoenetmlversion publishes the matching wheel. - Dry run: the workflow can be run manually (
workflow_dispatch) targeting TestPyPI to validate packaging before a real release.
The wheel bundles the built JS assets from ../doenetml-to-pretext, so that
package must be built first; the workflow (and the npm run build wireit graph)
handles this automatically.
License
AGPL-3.0-or-later
Metadata
Release files for doenetml-to-pretext 0.7.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| doenetml_to_pretext-0.7.27-py3-none-any.whl | Python 3 | none | any | Details for doenetml_to_pretext-0.7.27-py3-none-any.whl |
Release files / doenetml_to_pretext-0.7.27-py3-none-any.whl
| Download URL | doenetml_to_pretext-0.7.27-py3-none-any.whl |
|---|---|
| Size | 4.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39291115519a386dd9d08e6cdb599dca165fc5f6119242fe9154220653ce9fc3
|
|
BLAKE2b-256 checksum How to use checksums |
c8bc0d55eb5c19d62c45593d9bb3546f7668c6015a4b951627343025c6ba50b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.
Transparency logSecurity for doenetml-to-pretext 0.7.27
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.
Full provenance
All 1 file in this release has been uploaded with provenance metadata.
Attestation for doenetml_to_pretext-0.7.27-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.
Transparency logA 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.