sniper-py
Python bindings for moesniper — escape-proof precision file editor for LLM agents.
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)
Metadata
Release files for moesniper 0.7.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ x86-64 | Details for moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl |
| moesniper-0.7.14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for moesniper-0.7.14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| moesniper-0.7.14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for moesniper-0.7.14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
Total release size: 1.3 MB
Release files / moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | moesniper-0.7.14-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 451.3 kB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
023a13afa92a1681ff7db890111a74f7e47c0ccc157a3b53f5dc935ea8207bbc
|
|
BLAKE2b-256 checksum How to use checksums |
610bf5cd4e75c9ee7f9a90771cff7524eeadb2a4af175a9e62201a3627455236
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / moesniper-0.7.14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | moesniper-0.7.14-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 449.5 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a9dc9fa43bbcc78b937b50ab7c333a47fdfb052d3e231a306acc9a7aa7bd64c3
|
|
BLAKE2b-256 checksum How to use checksums |
ffe7bb2e09751ec17f63e1d37548d5ef88a73053c13599fa75f536d1bc026fec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / moesniper-0.7.14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | moesniper-0.7.14-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 424.6 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
8ca271d09f05b0ead6bc42a3d4dc3b11050c875f95529986ac81c9058e6ae231
|
|
BLAKE2b-256 checksum How to use checksums |
86bd94cd37ca35f6d71ecfd192208e2160681ce5859735be45a69946205f5650
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Security for moesniper 0.7.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.