skillfed

editor

đź–‹ Open the default text editor đź–‹

editor v1.8.0 4.9M downloads/30d#2,203 on PyPI10
Permissive license MIT Active released

What it is and what it does

editor is a thin wrapper around your system's text editor that lets you spawn an interactive editing session from Python code. It detects and launches your preferred editor (via VISUAL or EDITOR environment variables, or platform defaults like Notepad on Windows or vim elsewhere), blocks while you edit, then returns the file contents back to your program. You can edit an existing file, create a new one, or work with a temporary buffer that gets cleaned up automatically.

The package is useful in CLI tools, interactive scripts, or any application that needs user input through a familiar text editor rather than stdin. It has minimal dependencies (runs and xmod) and supports current Python versions (3.10–3.14), making it straightforward to integrate into existing projects.

Use it for:

  • Collect multi-line user input in a CLI tool by opening the user's preferred editor.
  • Let users edit configuration or data files interactively from within a Python script.
  • Implement a 'compose' feature in a terminal application that spawns vim or another editor.
  • Capture detailed feedback or comments by opening an editor with pre-filled template text.
  • Build interactive workflows where editing a file is more natural than command-line prompts.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Opens your system's default text editor (or a specified one) to edit a file or temporary buffer, blocks until editing is complete, and returns the edited content.

Yes. The package solves a specific, real problem (spawning an editor and capturing its output) with minimal dependencies, active maintenance, permissive licensing, and no known vulnerabilities. Install it if you need interactive text editing in a Python application; skip it if your use case is purely programmatic file manipulation.

Install

editor on PyPI

pip

pip install editor

uv

uv add editor

poetry

poetry add editor

Installing editor

Before you install

Low install friction with only two runtime dependencies (runs and xmod). Actively maintained with a recent release (97 days ago) and current Python version support (3.10–3.14).

License in practice

MIT license permits unrestricted use, modification, and distribution with only attribution required.

Quickstart

import editor

# Edit a temporary file and get the result
comments = editor.editor(text='Initial text\n\n')

# Or edit a named file
comments = editor.editor(filename='file.txt', editor='vim')

Requires Python 3.10 or later. The editor subprocess will block until the user closes the editor window.

Verify before relying

  • Whether the package handles editor launch failures gracefully or what exceptions are raised.
  • Whether temporary files are reliably cleaned up in all error scenarios.
  • Cross-platform behavior on systems where VISUAL and EDITOR are not set and the OS is neither Windows nor Unix-like.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — runs, xmod
Maintenance actively maintained — 97 days since the last release
Last repo commit
First released
Downloads 4,904,859/month — #2,203 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: editor-1.8.0-py3-none-any.whl

Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

open text editor from pythonspawn editor subprocessedit file interactivelytemporary file editorvim emacs notepad wrapper
text-editorsubprocess-wrapperinteractive-io

More Utilities packages