Skip to main content

redline

Targeted, exact document edits for AI agents - no full-document rewrites.

Install

pip install py-redline
pip install "py-redline[pydantic-ai]"   # optional, for the pydantic-ai wrapper

Usage

from redline import Document, apply_edit, read

doc = Document("# Todo\n- buy milk\n")
apply_edit(doc, "buy milk", "buy oat milk")
print(read(doc))

Document holds the text. apply_edit finds old_str and swaps in new_str - it must match exactly once, unless allow_multiple=True. Other tools: read_lines, append, undo.

With pydantic-ai

from pydantic_ai import Agent
from redline import Document
from redline.pydantic_ai import TOOLS

doc = Document(your_text)
agent = Agent("your-model", deps_type=Document, tools=TOOLS)
agent.run_sync("fix the typo in the intro", deps=doc)
print(doc.text)

Download files

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

Source Distribution

py_redline-0.1.1.tar.gz (160.7 kB view details)

Uploaded Source

Built Distribution

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

py_redline-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file py_redline-0.1.1.tar.gz.

File metadata

  • Download URL: py_redline-0.1.1.tar.gz
  • Upload date:
  • Size: 160.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for py_redline-0.1.1.tar.gz
Algorithm Hash digest
SHA256 70eb78308d62cec5b37921e34a9ff18c228e1d3fa5cb1c376493b745f11ad866
MD5 3f605dc79da75b59a7b6ebdf16ce31d4
BLAKE2b-256 c102327a23a811564822a03491111654208deb91cbc89f28f00bbc6d9e3b9e60

See more details on using hashes here.

File details

Details for the file py_redline-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: py_redline-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for py_redline-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f36e96a6b8c32a9a614b319fa50579aafcb903a604f2db0e644de082561b237
MD5 dae03f4646190c6d92d2fd023717d8f6
BLAKE2b-256 8cc523255cf37b634a54b58c4cc6d3289ca69c94df924fe8542f468700f01a0e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

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