This release is a pre-release and may not be stable for production use.
sublime-text-stubs
PEP 561 typing stubs
for the Sublime Text plugin API,
covering the sublime, sublime_plugin and sublime_types modules.
The stubs carry the API documentation as docstrings, so hovering a symbol in an editor shows the same prose as the official API reference.
Sublime Text exposes these modules only inside its own embedded interpreter, so they cannot be imported or introspected from a normal Python environment. Installing this package as a dev dependency gives type checkers and editors something to resolve them against.
Installation
uv add --dev sublime-text-stubs
# or
pip install --upgrade sublime-text-stubs
Versioning
Versions follow the scheme 1.${st_build_version}.${patch}:
| Version | Sublime Text build | Embedded Python |
|---|---|---|
1.4200.* |
4200 (stable) | 3.8 |
1.4206.* |
4206 (dev) | 3.14 |
The leading 1 is the schema version of this package itself,
the middle segment is the Sublime Text build the stubs describe,
and the trailing segment is the patch level within that build.
This is deliberately not semantic versioning.
Pin the build you target:
sublime-text-stubs = "==1.4200.*"
Sublime Text 4 also still ships a legacy Python 3.3 runtime. It is scheduled for removal and is not targeted by this package.
Notes for plugin authors
- Commands do not declare
run. Sublime Text invokes it with command-specific keyword arguments, so the stubs leave the signature to your subclass. Writedef run(self, **kwargs), ordef run(self, edit, **kwargs)for aTextCommand. is_enabled,is_visible,is_checkedanddescriptionreceive their command arguments the same dynamic way, but they are declared without parameters, exactly as Sublime Text declares them.def is_enabled(self),def is_enabled(self, my_arg="")anddef is_enabled(self, **kwargs)all type-check. A required parameter is rejected, and that rejection is correct: such an override also raisesTypeErrorat runtime when the command is invoked without that argument.TextChangeListener.bufferissublime.Buffer, notBuffer | None. The plugin host attaches the listener immediately after constructing it, so no handler can observe the unattached state.sublime_types.ModifierKeysexists only in these stubs, as the type of themodifier_keysentry of anEvent. Import it inside anif TYPE_CHECKING:block, since the real module has no such name at runtime.
The stubs are validated by type-checking sample consumer code, not against the running editor, so divergences from the actual runtime API are possible. Please report any you find.
Contributing
See CONTRIBUTING.md for the project structure, how the stubs are generated and validated, and how to correct them.
License
Not yet chosen. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sublime_text_stubs-1.4200.0b1.tar.gz.
File metadata
- Download URL: sublime_text_stubs-1.4200.0b1.tar.gz
- Upload date:
- Size: 55.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79a84e1cfa373bcf0f822bd0b36db4c517abbe0729e50c50a77e839ba754103d
|
|
| MD5 |
734dbac73485a7bc797fa291b6ed74bd
|
|
| BLAKE2b-256 |
16d78db77b7bb6473a001cfffbc4ee340197801c256c5731ceee91f9a34a3b9b
|
Provenance
The following attestation bundles were made for sublime_text_stubs-1.4200.0b1.tar.gz:
Publisher:
release.yml on SublimeText/sublime-text-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sublime_text_stubs-1.4200.0b1.tar.gz -
Subject digest:
79a84e1cfa373bcf0f822bd0b36db4c517abbe0729e50c50a77e839ba754103d - Sigstore transparency entry: 2326072811
- Sigstore integration time:
-
Permalink:
SublimeText/sublime-text-stubs@7e2f4262f88b0b52d75756ea00a948240605b08a -
Branch / Tag:
refs/tags/v1.4200.0b1 - Owner: https://github.com/SublimeText
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7e2f4262f88b0b52d75756ea00a948240605b08a -
Trigger Event:
push
-
Statement type:
File details
Details for the file sublime_text_stubs-1.4200.0b1-py3-none-any.whl.
File metadata
- Download URL: sublime_text_stubs-1.4200.0b1-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56965fd12d16284afa36df3eac06a495c1ca58a61f6f4052dc0bd44eeece355b
|
|
| MD5 |
978268b7e9b19f41d47e697c3043e269
|
|
| BLAKE2b-256 |
4ebfcf6637761e7527e52f68a3d7865a09b8678bfb11e0ab8ce6f633c2775fe1
|
Provenance
The following attestation bundles were made for sublime_text_stubs-1.4200.0b1-py3-none-any.whl:
Publisher:
release.yml on SublimeText/sublime-text-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sublime_text_stubs-1.4200.0b1-py3-none-any.whl -
Subject digest:
56965fd12d16284afa36df3eac06a495c1ca58a61f6f4052dc0bd44eeece355b - Sigstore transparency entry: 2326072845
- Sigstore integration time:
-
Permalink:
SublimeText/sublime-text-stubs@7e2f4262f88b0b52d75756ea00a948240605b08a -
Branch / Tag:
refs/tags/v1.4200.0b1 - Owner: https://github.com/SublimeText
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7e2f4262f88b0b52d75756ea00a948240605b08a -
Trigger Event:
push
-
Statement type: