--- id: python-editor version: "1.0.4" license: Apache license_treatment: permissive maintenance: dormant --- # python-editor — Programmatically open an editor, capture the result. License: permissive · Maintenance: dormant · Downloads: 2.8M/mo ## What it is and what it does python-editor wraps your system's $EDITOR environment variable to let you spawn an interactive editor subprocess from Python code. It handles the plumbing of passing content to the editor, capturing the result, and returning it as bytes, or opening a file for in-place editing. The library searches for a known editor (vim, emacs, nano) if $EDITOR is not set, and supports TTY mode for programs whose output is piped elsewhere. Typical use cases include building CLI tools that need user input (commit messages, configuration edits, bug reports), interactive Python scripts, and any workflow where you want to delegate text editing to the user's preferred editor rather than building your own UI. It has no runtime dependencies and installs with low friction. Use it for: - Building CLI tools that prompt users to edit commit messages, bug reports, or configuration in their preferred editor. - Interactive Python scripts that need to let users edit multi-line text or files without embedding an editor. - Git hooks or version-control workflows that programmatically invoke $EDITOR for commit messages or diffs. - Admin or deployment scripts that need to open a file for user review and modification before proceeding. - Testing frameworks or utilities that capture edited content for validation or logging. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Programmatically open your system's $EDITOR from Python, capture edited content, and return it as bytes or modify files in place. Yes, if you need to invoke the user's system editor from Python. It is stable, dependency-free, and solves a specific problem well. Dormant maintenance is not a concern for a feature-complete library with no known vulnerabilities, but verify compatibility with your Python version before relying on it for new projects targeting Python 3.7+. ## Install pip install python-editor uv add python-editor poetry add python-editor ## Installing python-editor Before you install: Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2019-02-01 and last commit 2023-10-11—but the package is marked Production/Stable and has no known vulnerabilities, suggesting it is feature-complete rather than abandoned. License in practice: Licensed under Apache (permissive), so you can use, modify, and distribute it freely in commercial and private projects without restriction. Quickstart: import editor commit_msg = editor.edit(contents=b"# Enter commit message here") # Or edit a file in place: editor.edit(file="README.txt") Requires a system editor (vim, emacs, nano, or $EDITOR environment variable) to be installed and accessible on the system. Verify before relying: - Whether the package works reliably with modern Python versions beyond 3.6 (classifiers list 3.4–3.6 but no newer versions). - Whether dormant maintenance status poses any risk for future Python or OS compatibility issues. ## Package facts - License: Apache (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 2.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags open editor from python, programmatic editor interface, capture editor output, system editor integration, interactive text editing, subprocess editor launcher, edit file contents programmatically, editor-integration, subprocess-wrapper, cli-tools [View on SkillFed](https://skillfed.io/packages/python-editor) · [View on PyPI](https://pypi.org/project/python-editor/)