scintilla-py
Permissively-licensed Python bindings for the Scintilla code editor component and its lexer library, Lexilla.
The packages
Two packages, built in one repo and released to PyPI separately:
| Package | PyPI | What it is |
|---|---|---|
| pyside6-scintilla | The Scintilla editor widget for PySide6 -- a GPL-free alternative to PyQt6-QScintilla. | |
| lexilla | Lexilla's lexers (syntax highlighting and folding for ~125 languages), handed to a pyside6-scintilla editor. |
pip install pyside6-scintilla lexilla
from PySide6.QtWidgets import QApplication
from lexilla import Language, create_lexer
from lexilla.pyside6_scintilla import set_lexer
from pyside6_scintilla import ScintillaEdit
app = QApplication([])
editor = ScintillaEdit()
lexer = create_lexer(Language.CPP)
assert lexer is not None
set_lexer(editor, lexer)
editor.setText("int main() { return 0; }")
editor.show()
app.exec()
Each package's page has the details; the examples gallery has complete apps, and Reference the Python API.
Why this exists
The usual way to use Scintilla from Python with Qt is QScintilla -- a PyQt6 binding, GPLv3 or commercially licensed. Scintilla and Lexilla themselves are permissively licensed (HPND). These packages expose them directly to PySide6 users under MIT -- see the mission for the full background, and How the packages are built for why they're two packages with two different binding stacks.
Status
See GitHub Issues for what's done and what's next, the project board for the roadmap, and the Changelog for each package's releases.