Skip to main content

Read the web as clean AIDocuments through Lyrenth (with LangChain and LlamaIndex adapters).

Project description

lyrenth (Python)

Read the web as clean AIDocuments through Lyrenth, with first-class LangChain and LlamaIndex adapters.

Each URL resolves to a stable AIDocument: cleaned Markdown plus title, description, and structure, with navigation and boilerplate stripped. Reads go through Lyrenth's cross-caller cache, and for verified domains you get the publisher's canonical version.

Install

pip install lyrenth                 # core client, zero dependencies
pip install 'lyrenth[langchain]'    # + LangChain loader
pip install 'lyrenth[llamaindex]'   # + LlamaIndex reader

Get a free API key at https://lyrenth.com/signup (2,000 reads/month, no card) and set it as LYRENTH_API_KEY.

Client

from lyrenth import Lyrenth

client = Lyrenth()  # reads LYRENTH_API_KEY from the environment
doc = client.read("https://example.com/article")

print(doc.title)
print(doc.markdown)        # cleaned, agent-ready body
print(doc.word_count)
print(doc.raw)             # full v2 envelope if you need structure/economics

# just the text:
text = client.read_markdown("https://example.com/article")

# force a fresh fetch instead of the cached version:
fresh = client.read("https://example.com/article", fresh=True)

LangChain

from lyrenth.langchain import LyrenthLoader

docs = LyrenthLoader(
    ["https://example.com/a", "https://example.com/b"]
).load()
# -> list[langchain_core.documents.Document]
#    page_content = cleaned Markdown
#    metadata     = {source, title, description, word_count}

Use it anywhere a LangChain loader fits (RAG ingestion, splitters, vector stores). lazy_load() streams documents one URL at a time.

LlamaIndex

from lyrenth.llamaindex import LyrenthReader

docs = LyrenthReader().load_data(["https://example.com/a"])
# -> list[llama_index.core.Document]  (text = cleaned Markdown)

Why read through Lyrenth

  • Cleaner, cheaper. One stable shape per URL, far fewer tokens than raw HTML.
  • Cached across callers. Repeat URLs collapse to a minimal number of origin fetches, so it is fast and origin-friendly.
  • Canonical when verified. When a site's owner has verified with Lyrenth, you get the version they authored, kept fresh by their change signal.

Config

Argument / env Default Notes
api_key / LYRENTH_API_KEY none Free key at https://lyrenth.com/signup
base_url https://api.lyrenth.com Override for staging / self-host

The AIDocument format is an open contract; see https://lyrenth.com/llms-full.txt. MIT licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lyrenth-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lyrenth-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file lyrenth-0.1.0.tar.gz.

File metadata

  • Download URL: lyrenth-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for lyrenth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d404c5b1fdcd1edb8e3e488d6f767c7280810e23c36959011602b14cdb3f2026
MD5 5a3860950efcf4b0ac691c220610a593
BLAKE2b-256 9c8f70bec07314940b5cf70576ebdcbbaf9a56a65c7962414ad86dda97120db3

See more details on using hashes here.

File details

Details for the file lyrenth-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lyrenth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for lyrenth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4ab4fa041b0a7f8b74c6384734f1cf527bdfc8da3ade2b56f8353e83e1c95d8
MD5 984b7d79694eadfc1fc6fdfb5fa84037
BLAKE2b-256 f433207cc8587efe0fbc06f4643ec03d05a3fb35f7a7c60502dda852216ea0e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page