Skip to content

borco/lexilla-py

Repository files navigation

lexilla-py: Python bindings for Lexilla

CI PyPI License: MIT Python versions

Permissively-licensed Python bindings for Lexilla, the lexer library for Scintilla.

View on PyPI · View on GitHub

Status

Real CreateLexer/ILexer5 bindings exist: create_lexer, get_lexer_count, get_lexer_name, and a Lexer class (name/identifier, property get/set, word_list_set, and the raw pointer for SCI_SETILEXER). Lex/Fold and the cross-binding/wheel-publishing work are not done yet. Nothing is published to PyPI yet. See GitHub Issues for what's next.

Why this exists

Lexilla creates the lexer objects (ILexer5) that a Scintilla editor widget attaches via SCI_SETILEXER — it's a separate, Qt-free C++ library from Scintilla itself since Scintilla 5.0. This project exposes that library directly to Python, so any Scintilla binding can create and configure lexers, not just one tied to a specific Qt/GTK/wx binding — see docs/specs/mission.md for the full background.

Goals

lexilla aims to be:

  • MIT licensed — usable in open-source or closed-source projects freely
  • A faithful, low-level binding of Lexilla's CreateLexer/ILexer5 C++ API — not a redesign of it
  • Binding-agnostic — no dependency on any particular Scintilla binding; the lexer pointer it creates works with any of them via SCI_SETILEXER
  • Available as pre-built wheels for Linux (x86_64, aarch64), Windows (x86_64), and macOS (arm64, x86_64)
  • Not affiliated with the Scintilla/Lexilla project

Installation

Not yet published. Once it is:

pip install lexilla

For convenience glue with pyside6-scintilla:

pip install lexilla[pyside6-scintilla]

Versioning

Version numbers follow <Lexilla version>.<binding revision> — e.g. 5.5.0.0 is binding revision 0 for Lexilla 5.5.0. The binding revision increments for releases of this package that don't correspond to a new Lexilla version, and resets to 0 when Lexilla itself releases a new version.

Documentation

Doc Contents
docs/specs/ Design specifications and action plans for in-progress and planned work
docs/specs/mission.md Project background, goals, and design decisions
GitHub Issues Ordered list of upcoming work
Project board Joint roadmap for lexilla-py and pyside6-scintilla; issues/PRs from both repos are auto-added
docs/bindings.md How the nanobind bindings are built, and how they're expected to grow
docs/build.md Build prerequisites, local build/rebuild, wheels, and publishing
docs/auditing.md How to verify the vendored Lexilla source matches upstream
docs/documenting.md How the docs site is built (stub)
docs/testpypi.md Setting up TestPyPI trusted publishing
examples/ Standalone example apps (planned)

License