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.13-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (451.0 kB view details)

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

moesniper-0.7.13-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (421.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

File details

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

File metadata

File hashes

Hashes for moesniper-0.7.13-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3002917b3c81ce540d60089e4807875d1660014cb694842d475b5cb682580f1c
MD5 69c90e34736fd5399183df9a68cb40dd
BLAKE2b-256 e2ac966984eab779d635af0402d794946d551fd5c61544e9efb2f94026d99fba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for moesniper-0.7.13-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4ffd76c656950900d9f8a7cdb66049212f3d87908ddde23f6a09253200e03c9f
MD5 c4d2eaaf7916cf06511e05480358e2b4
BLAKE2b-256 e49c6cda38d154348cc7fc49e71b6ddc3701979724be882619a67c1b5ceb20e9

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.14

3 files

This release

0.7.13 This release

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