skillfed

python-editor

Programmatically open an editor, capture the result.

python-editor v1.0.4 2.8M downloads/30d#2,898 on PyPI89
Permissive license Apache DORMANT released

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 on this page — 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

python-editor on PyPI

pip

pip install python-editor

uv

uv add python-editor

poetry

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 not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 2,751 days since the last release
Last repo commit
First released
Downloads 2,761,129/month — #2,898 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_editor-1.0.4-py2-none-any.whl; python_editor-1.0.4-py3-none-any.whl

Keywords: editor, library, vim, emacs

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Software Development :: Libraries

Tags

open editor from pythonprogrammatic editor interfacecapture editor outputsystem editor integrationinteractive text editingsubprocess editor launcheredit file contents programmatically
editor-integrationsubprocess-wrappercli-tools

More Libraries packages