Escape-proof precision file editing — Python bindings for moesniper
Project description
sniper-py
Python bindings for moesniper — escape-proof precision file editor for LLM agents.
Installation
pip install sniper-py
Overview
sniper-py 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
from sniper import splice
# Replace lines 5-5 with hex-encoded content
result = splice("file.rs", start=5, end=5, hex_content="68656c6c6f")
print(result.status) # "ok"
print(result.line_shift) # 0
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moesniper-0.7.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: moesniper-0.7.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 439.0 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9e60f5ad89312dbc614f2ab120e315ba9418d631ef909ba1f06bbed0d8760e4
|
|
| MD5 |
9669263b04527042ae80798e00e1d060
|
|
| BLAKE2b-256 |
f595e739649ffa6911a4617c5733a937a110a7b5d914795175cbc863a6d5523e
|
File details
Details for the file moesniper-0.7.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: moesniper-0.7.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 411.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33a64bc0d9a18401c7239d8f1f4c90c8d83e5a049a7bd2af0a2435da16ff9fc6
|
|
| MD5 |
25e7e7eb7f515faa848a8e582f3fc09b
|
|
| BLAKE2b-256 |
dcf335fa4261ac68ec61010b944a62b869095d610fa2662598e24ce73c0a796a
|