AI-oriented web framework built on Flask
Project description
inact
AI-oriented web framework built on Flask. Every route returns plain text by default (curl/agent-friendly), with automatic HTML rendering at /_human/<path> for humans.
Install
pip install inact
Quick start
from inact import Inact, MdContent, TomlContent
app = Inact(__name__)
@app.inact_md("/")
def index():
return MdContent("# Hello\n\nThis is an agent-friendly page.", title="Home")
@app.inact_toml("/status")
def status():
return TomlContent({"service": {"status": "running"}}, annotation="GET /status")
app.mount("/docs", "./docs/")
app.run()
Features
inact_md— Markdown + frontmatter routes. Plain text for agents, rendered HTML at/_human/<path>.inact_toml— TOML routes with optional# annotationlines at the top./_human/<path>— Auto-registered HTML rendering for every route and mounted file./.help— Contextual help on every path, inherited from nearest ancestor if not defined.mount(prefix, folder)— Serve a local folder with/.ls(file listing) and/.grep?q=(content search).
Response types
| Handler returns | Agent sees | Human sees (/_human/) |
|---|---|---|
MdContent(body, **meta) |
plain markdown | rendered HTML |
TomlContent(data, annotation=...) |
TOML with # comment header |
structured HTML |
raw str |
string as-is | detected and rendered |
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
inact-0.1.0.tar.gz
(26.1 kB
view details)
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
inact-0.1.0-py3-none-any.whl
(10.9 kB
view details)
File details
Details for the file inact-0.1.0.tar.gz.
File metadata
- Download URL: inact-0.1.0.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60a5b90786f710491ecc88fde9e1b2b83f213ea554d4d3800553298cfa243834
|
|
| MD5 |
c7b3ed4ea743e14395588e6971d0fb93
|
|
| BLAKE2b-256 |
bf204d7d7fcfdcb75e48d7fb3e343ecba0641340c19153215fdce3befc7a386c
|
File details
Details for the file inact-0.1.0-py3-none-any.whl.
File metadata
- Download URL: inact-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0aa7618181916e272b2537747801166563bcf774a106c17e989bc892ccc65f49
|
|
| MD5 |
459124bb7756eccdec7d7abf102f9c89
|
|
| BLAKE2b-256 |
d92847ee4e6e8e07a198144ed229f85b1f7a7c9dea5d48beaa85eb476436292d
|