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 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)

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.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (449.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

moesniper-0.7.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (420.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

File details

Details for the file moesniper-0.7.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moesniper-0.7.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b65f07052df986fc925456a5e48beefeabbb770e81e1304a3d09ed2c37450743
MD5 363ffbff3d6c8fd832e0b0e900cdc0a5
BLAKE2b-256 9c95eaa14e6a0ac154575cd8b3341181a55e8574e932ea17d29cb3c35159974f

See more details on using hashes here.

File details

Details for the file moesniper-0.7.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moesniper-0.7.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a58cefb321445e4da12a170010405f5e1e9bee7b696b848948cab9cc0c309013
MD5 906f7726a2a599fd5a4b4b322f2baf41
BLAKE2b-256 5cc1980a2f3a31f430a4b9ef62300e2f74b6ef68a49113e0d5a8c1c6a857a4a5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.14

3 files

0.7.13

2 files

This release

0.7.12 This release

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