IntentText - the semantic document format that is natively JSON
Project description
IntentText Python
Python implementation of the IntentText parser and renderer.
Independent implementation (not a Node.js wrapper), designed for Python workflows and AI stacks.
Install
pip install intenttext
Quick Start
from intenttext import parse, render_html, merge_data, validate, query
# Parse a document
source = """
title: Sprint Planning
section: Tasks
task: Write tests | owner: Ahmed | due: Friday
task: Deploy to staging | owner: Sarah | due: Monday
gate: Final approval | approver: Lead | timeout: 24h
""".strip()
doc = parse(source)
# Query for tasks
tasks = query(doc, type="task")
for task in tasks:
print(f"{task.content} -> {task.properties.get('owner', 'unassigned')}")
# Validate workflow semantics
result = validate(doc)
if not result.valid:
for issue in result.issues:
print(f"[{issue.type.upper()}] {issue.message}")
# Render to HTML
html = render_html(doc)
API
parse(source: str) -> IntentDocumentparse_safe(source: str, ...) -> ParseResultrender_html(doc: IntentDocument, include_css: bool = True) -> strrender_print(doc: IntentDocument) -> strrender_markdown(doc: IntentDocument) -> strmerge_data(template: IntentDocument, data: dict) -> IntentDocumentparse_and_merge(template_source: str, data: dict) -> IntentDocumentvalidate(doc: IntentDocument) -> ValidationResultquery(doc: IntentDocument, ...) -> list[IntentBlock]to_source(doc: IntentDocument) -> str
Development
pip install -e .[dev]
pytest
Release (PyPI)
# 1) Ensure tests pass
python3 -m pytest -q
# 2) Build source + wheel
python3 -m pip install -U hatch twine
hatch build
# 3) Validate package metadata and long description
twine check dist/*
# 4) Upload (interactive)
twine upload dist/*
Tag-based release flow:
git tag v1.0.0
git push origin v1.0.0
GitHub Action publish workflow uses PYPI_API_TOKEN for automated release on v* tags.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file intenttext-1.1.0.tar.gz.
File metadata
- Download URL: intenttext-1.1.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33442434060353a57a43b0dcff7708fa21a2ad21172c347a19dc29e80fb0dc3c
|
|
| MD5 |
6c431d1114adb51498bdaa1c39d602b5
|
|
| BLAKE2b-256 |
722b563251c69cea3045ac0e1972a39b533595b71163aad73a26e2d5773dd9a2
|
File details
Details for the file intenttext-1.1.0-py3-none-any.whl.
File metadata
- Download URL: intenttext-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b9fa6804ea09a923abda599a22f571b26fea154085d6c4ae33c0f62cde3a61f
|
|
| MD5 |
970f4c5a41ea8c1937ad280a13e39442
|
|
| BLAKE2b-256 |
7b4c0f1f1421a4ac77875d4e5e428d88b9a581d6505836b8d871dc5657c6ef6d
|