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 Distributions

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

moesniper-0.7.6-cp312-cp312-manylinux_2_34_x86_64.whl (437.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

moesniper-0.7.6-cp312-cp312-manylinux_2_34_aarch64.whl (403.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

moesniper-0.7.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (436.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

moesniper-0.7.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (407.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: moesniper-0.7.6-cp312-cp312-manylinux_2_34_x86_64.whl
  • Upload date:
  • Size: 437.6 kB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for moesniper-0.7.6-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 26d518c3fe4e67c76e1a73c848c4c0a6e126a24ff138c87454397ac5b1181477
MD5 789287fd0e38c82c6d07d726f5c6fadf
BLAKE2b-256 f330e9f083cef60b1931ca0f78978bc8c2b6995b872bd5abfece4264768ed75f

See more details on using hashes here.

File details

Details for the file moesniper-0.7.6-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

  • Download URL: moesniper-0.7.6-cp312-cp312-manylinux_2_34_aarch64.whl
  • Upload date:
  • Size: 403.3 kB
  • Tags: CPython 3.12, manylinux: glibc 2.34+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for moesniper-0.7.6-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 dd231c982fbe3cbc102926adf41b32a236e2cf88dcb2c8fa959010a694d6e672
MD5 a985485863a03e0f17acfeebe31cbbcc
BLAKE2b-256 1a3771ad3dbacd42e188a41c0926fd8ac45399d8fa192160cda319577cd0b4d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for moesniper-0.7.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 924fbee286af2dfbaadd2068adda270ad6efa5f1315dd5f09a34b5ead6b5b23d
MD5 c7e85e82cb2589e884eb30ac18ac3212
BLAKE2b-256 a25ec71f4247554e312b26adc03605425cbcb78f41d54b9bda14fac4b0575760

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for moesniper-0.7.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0f89e3aee5235a959485fe366fc180dbf4816370400f0ce4553a3ccf5553b095
MD5 fef7f346274422e49c5e4c5bd7c9867c
BLAKE2b-256 a96e7349cbbe7ef7553bf5fd69d99108323276165115a9b49399425f56dcfe6f

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