Skip to main content

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.

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)

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

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

Built Distribution

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

moesniper-0.7.2-cp312-cp312-manylinux_2_34_x86_64.whl (414.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file moesniper-0.7.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for moesniper-0.7.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3e5e1c7b496dfc71e32435ba96f4f3e601ff660b860005fefa35c413271f9423
MD5 99279a39dddcfe6171f0413e76acb436
BLAKE2b-256 0f30d0c69f127461cc218d7384b998f2162b1381dbab91566ac2eb77bc4b6736

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page