Skip to main content

sniper-py

Python bindings for moesniper — escape-proof precision file editor for LLM agents.

PyPI License: MIT Python: 3.10+

Installation

pip install moesniper

Overview

moesniper provides native Python bindings to the moesniper Rust CLI — an escape-proof precision file editor designed for LLM agents. All file edits are:

  • Hex-encoded to prevent shell corruption
  • Atomic (temp file + rename — never inconsistent)
  • Tracked via automatic backups and multi-step undo
  • Paced with metabolic resource guards to prevent runaway edits

Usage

import moesniper

# Replace line 5 with plaintext content. The binding handles encoding internally.
result = moesniper.edit("file.rs", start=5, end=5, content="hello")
print(result["status"])  # "ok"
print(result["lines_inserted"])  # 1

Features

Feature Description
Hex-encoded payloads All content is hex strings, zero shell injection risk
Atomic writes Files are never in an inconsistent state during edit
Multi-step undo Each edit creates a backup; undo restores previous state
Dry-run preview Preview diffs before applying changes
Indentation safety Validates and auto-corrects indentation on edits
Resource pacing Built-in metabolic guards prevent runaway edits

License

MIT (source)

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl (451.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ x86-64

moesniper-0.7.14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (449.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

moesniper-0.7.14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (424.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

File details

Details for the file moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 451.3 kB
  • Tags: CPython 3.10+, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 023a13afa92a1681ff7db890111a74f7e47c0ccc157a3b53f5dc935ea8207bbc
MD5 3760c84b861832c0cf9c551425eae24a
BLAKE2b-256 610bf5cd4e75c9ee7f9a90771cff7524eeadb2a4af175a9e62201a3627455236

See more details on using hashes here.

File details

Details for the file moesniper-0.7.14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moesniper-0.7.14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9dc9fa43bbcc78b937b50ab7c333a47fdfb052d3e231a306acc9a7aa7bd64c3
MD5 e79a0d7cee9d88c8463186971d6e824e
BLAKE2b-256 ffe7bb2e09751ec17f63e1d37548d5ef88a73053c13599fa75f536d1bc026fec

See more details on using hashes here.

File details

Details for the file moesniper-0.7.14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moesniper-0.7.14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8ca271d09f05b0ead6bc42a3d4dc3b11050c875f95529986ac81c9058e6ae231
MD5 497be61cdfa10c1cd6e64f92c832dbce
BLAKE2b-256 86bd94cd37ca35f6d71ecfd192208e2160681ce5859735be45a69946205f5650

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.14 This release

3 files

0.7.13

2 files

0.7.12

2 files

0.7.10

2 files

0.7.9

2 files

0.7.8

2 files

0.7.6

4 files

0.7.4

2 files

0.7.2

1 file

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