--- id: editor version: "1.8.0" license: MIT license_treatment: permissive maintenance: active --- # editor โ€” ๐Ÿ–‹ Open the default text editor ๐Ÿ–‹ License: permissive ยท Maintenance: active ยท Downloads: 4.9M/mo ## 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 above โ€” 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 pip install editor uv add editor 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_current - Install friction: low - Maintenance: active - Downloads: 4.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags open text editor from python, spawn editor subprocess, edit file interactively, temporary file editor, vim emacs notepad wrapper, text-editor, subprocess-wrapper, interactive-io [View on SkillFed](https://skillfed.io/packages/editor) ยท [View on PyPI](https://pypi.org/project/editor/)