pynvim
Python client for Neovim
What it is and what it does
Pynvim bridges Python and Neovim by providing a client library that connects to Neovim instances via msgpack-rpc. It enables two main use patterns: writing remote plugins that handle Neovim function calls asynchronously without blocking the editor, and scripting Neovim from Python code (either embedded or via a socket connection). The library exposes Neovim's API through Python objects representing buffers, windows, and the editor state, and adds extensions like access to vimL functions via `nvim.funcs`, Lua integration, and thread-safe async requests.
The package depends on msgpack for serialization, greenlet for async support, and typing-extensions for type hints. It supports both connecting to running Neovim instances and embedding Neovim as a subprocess within a Python application. A known limitation is that Vimscript dictionaries are returned as copies rather than references, requiring the entire dictionary to be reassigned after modification.
Use it for:
- Write asynchronous Python remote plugins for Neovim that respond to editor events without blocking.
- Automate Neovim from Python scripts or applications by connecting to a running editor instance.
- Embed Neovim as a headless subprocess within a Python application for programmatic text editing.
- Access and manipulate Neovim buffers, windows, and settings from Python code via the msgpack-rpc API.
- Call vimL and Lua functions from Python plugins using the extended API.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pynvim is a Python client library that enables Python plugins for Neovim and allows scripting Neovim processes through its msgpack-rpc API.
Yes. Pynvim is actively maintained, has no known vulnerabilities, and low install friction. Install it if you need to write Python plugins for Neovim, automate the editor from Python, or embed Neovim in a Python application. The permissive Apache 2.0 license poses no restrictions. The main gotcha is understanding the socket/child-process connection model and the dictionary copy behavior documented in the known issues.
Install
pynvim on PyPI
pip
pip install pynvimuv
uv add pynvimpoetry
poetry add pynvimInstalling pynvim
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with recent commits and no known vulnerabilities. Requires Python 3.7 or later, though the description notes 3.10+ support.
License in practice
Licensed under Apache License 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
import pynvim
nvim = pynvim.attach('socket', path='/tmp/nvim.sock')
buffer = nvim.current.buffer
buffer[0] = 'replace first line'
Requires a running Neovim instance accessible via socket or child process; start Neovim with `nvim --listen /tmp/nvim.sock` before connecting.
Verify before relying
- Whether the package's async/thread-safety features are production-ready for concurrent plugin workloads.
- Performance characteristics when handling large buffers or frequent API calls across the msgpack-rpc boundary.
Package facts
| License | Apache (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — msgpack, greenlet, typing-extensions |
| Maintenance | actively maintained — 341 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 424,135/month — #6,766 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pynvim-0.6.0-py3-none-any.whl
Tags
More Terminals packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
richRich renders styled text, tables, progress…
permissive · top 100 on PyPI
coloramaColorama makes ANSI escape sequences for…
permissive · top 100 on PyPI
wcwidthMeasures the displayed width of Unicode strings…
permissive · top 1,000 on PyPI
ptyprocessRun a subprocess in a pseudo terminal (pty) and…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
tclinttclint is a CLI linter, formatter, and language…
permissive · top 15,000 on PyPI
virtualenv-cloneClones an existing Python virtualenv to a new…
permissive · top 5,000 on PyPI
yacmanYacman provides a Python interface for reading,…
permissive · top 15,000 on PyPI
ruff-lspProvides a Language Server Protocol bridge to…
permissive · top 15,000 on PyPI
pyvimA Vi/Vim-like text editor implemented entirely…
permissive · top 15,000 on PyPI
release-tagAutomatically creates and optionally pushes…
permissive · top 15,000 on PyPI
PaverPaver is a Python-based task automation and…
permissive · top 15,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
pipxpipx installs and runs Python command-line…
permissive · top 5,000 on PyPI