Skip to main content

llama-index-tools-brewpage

LlamaIndex tool spec that publishes HTML, Markdown, JSON, key-value stores and files to BrewPage and returns a shareable URL. Free, no account, no API key.

PyPI License CI

Install

pip install llama-index-tools-brewpage==0.2.0

Usage

from llama_index.tools.brewpage import BrewPageToolSpec

spec = BrewPageToolSpec()
page = spec.publish_page("# Weekly report\n\nAll green.", format="markdown")
print(page["url"])              # page link, share it
print(page["management_link"])  # private: edits or deletes the page

With an agent (any function-calling LLM):

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.tools.brewpage import BrewPageToolSpec

agent = FunctionAgent(tools=BrewPageToolSpec().to_tool_list(), llm=llm)
response = await agent.run("Write a one-page HTML changelog and publish it.")

Tools

Tool API Result
publish_page POST /api/html HTML or Markdown page URL
publish_json POST /api/json JSON document URL
create_kv_store POST /api/kv Key-value store URL, one initial key
upload_file POST /api/files Download or page URL for a local file

Every tool also takes ttl_days, password and namespace and returns a dict with url, id, namespace, owner_token, management_link, expires_at. API errors (rate limits, refused content) come back as {"error": "..."} so the agent can react.

url is the page link. management_link is the management link with its key (https://brewpage.app/manage/...#k=...): anyone who has it can edit or delete the publication. The tool descriptions tell the agent to give the user both, to keep owner_token for later updates and show it on request, and never to post the management link or the token publicly (public page, repo, shared channel). management_link is None when the API returned an existing publication without a new key.

The first call gets an owner token; the spec reuses it, so all publications share one owner. To keep it across runs, pass it in:

from llama_index.tools.brewpage import BrewPageClient, BrewPageToolSpec

spec = BrewPageToolSpec(client=BrewPageClient(owner_token="..."))

Environment: BREWPAGE_OWNER_TOKEN, BREWPAGE_NAMESPACE, BREWPAGE_BASE_URL (default https://brewpage.app).

Page data and your domain

The page tool and BrewPageClient.publish_page also accept state (a settings object; {} enables defaults) and domain (an owned hostname). These options apply to HTML pages. Omit state or pass None to leave Page data settings unchanged. The HTML uses the visitor SDK; the declaration stays in the publish request.

This example requests private visitor replies and a custom hostname in one publication. For the hostname, set BREWPAGE_OWNER_TOKEN to an owner token already linked to your BrewPage profile before creating the client. For Page data alone, omit domain; no account is needed.

from llama_index.tools.brewpage import BrewPageClient, BrewPageToolSpec

html = """<!doctype html><meta charset="utf-8"><title>Event replies</title>
<form><label>Your reply <textarea name="reply" required></textarea></label><button>Send</button></form>
<p>What you enter is saved on BrewPage and can be read by this page's author.</p><p role="status"></p>
<script src="https://brewpage.app/js/state.js"></script>
<script>
document.querySelector("form").addEventListener("submit", async function (event) {
  event.preventDefault();
  const note = document.querySelector('[role="status"]');
  const store = await bp.state();
  if (!store) { note.textContent = "Saving is not available right now."; return; }
  try {
    await store.col("answers").add({text: this.elements.reply.value});
    note.textContent = "Saved.";
  } catch (error) { note.textContent = error.message; }
});
</script>"""

spec = BrewPageToolSpec(client=BrewPageClient())
page = spec.publish_page(
    html,
    state={"collections": {"answers": {}}},
    domain="www.example.com",
)
print(page["url"])
print(page.get("custom_domain", {}).get("nextStep", page.get("notices", [])))

When either option is supplied, the receipt includes the service's available notices, custom_domain, delivery_mode, delivery_mode_reason and delivery_notice fields. The returned url is the actual BrewPage address. A domain request can leave the publication live while returning a notice explaining why the hostname was not attached. For a pending domain, create the returned DNS records, follow nextStep, check once after the change, then read status until it is active. This adapter does not change DNS or poll automatically. Without either option, the existing six-field receipt is unchanged.

The private management_link opens the publication's Data tab for the author. Visitor entries stay attached to the publication; do not put an owner token or management link in the HTML. To reopen a publication in a new process, retain its private receipt and supply the same owner token to the new client.

Limits

  • Hosting is temporary: publications expire after 15 days by default, ttl_days 1-30.
  • Without namespace a publication is private: unlisted and not indexed, but anyone with the link can open it. Add password to restrict reads.
  • namespace="public" lists pages in the public gallery and search engines. Never put secrets or personal data there.
  • Size caps: HTML 5 MB, JSON 1 MB, KV value 1 MB, file 5 MB (video 20 MB). Current values: brewpage.app/api/limits.

Development

uv sync --group test
uv run pytest
BREWPAGE_LIVE=1 uv run pytest -m live   # publishes one private page on production

Support

info@brewpage.app or GitHub issues.

License

MIT

Metadata

Release files for llama-index-tools-brewpage 0.2.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 llama-index-tools-brewpage 0.2.0
File Size Uploaded Provenance Actions
llama_index_tools_brewpage-0.2.0.tar.gz 11.7 kB With provenance Details for llama_index_tools_brewpage-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-tools-brewpage 0.2.0
File Interpreter ABI Platform Actions
llama_index_tools_brewpage-0.2.0-py3-none-any.whl Python 3 none any Details for llama_index_tools_brewpage-0.2.0-py3-none-any.whl

Total release size: 21.3 kB

Release files / llama_index_tools_brewpage-0.2.0.tar.gz

Download URL llama_index_tools_brewpage-0.2.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a5abd8868408046d1ba7534c8aeeeb6ef6f9d1a3e3f06b1715ea22bdb80dd9f8
BLAKE2b-256 checksum
How to use checksums
8551630b31107b74a81dbe0211b90f7053f6d8b34c50b02f0883e4dbd5f31903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / llama_index_tools_brewpage-0.2.0-py3-none-any.whl

Download URL llama_index_tools_brewpage-0.2.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d74fefcb59ea9e42758b40fdf29327b88f60bb3cb9d975499f69763fe7c4f42
BLAKE2b-256 checksum
How to use checksums
dc03e8bb9ce2365fb47bb9294bfdbc30a325fa8678ee87c9c9f7af82ca57817a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for llama-index-tools-brewpage 0.2.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llama_index_tools_brewpage-0.2.0.tar.gz

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 Nov 19, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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