Skip to main content

Language Server Protocol Types implementation for Python

lsprotocol is a Python implementation of object types used in the Language Server Protocol (LSP). This repository contains the code generator and the generated types for LSP.

Overview

LSP is used by editors to communicate with various tools to enables services like code completion, documentation on hover, formatting, code analysis, etc. The intent of this library is to allow you to build on top of the types used by LSP. This repository will be kept up to date with the latest version of LSP as it is updated.

Installation

python -m pip install lsprotocol

Usage

Using LSP types

from lsprotocol import types

position = types.Position(line=10, character=3)

Using built-in type converters

# test.py
import json
from lsprotocol import converters, types

position = types.Position(line=10, character=3)
converter = converters.get_converter()
print(json.dumps(converter.unstructure(position, unstructure_as=types.Position)))

Output:

> python test.py
{"line": 10, "character": 3}

Metadata

Release files for lsprotocol 2025.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsprotocol 2025.0.0
File Size Uploaded
lsprotocol-2025.0.0.tar.gz 74.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lsprotocol 2025.0.0
File Interpreter ABI Platform
lsprotocol-2025.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 151.1 kB

Release files / lsprotocol-2025.0.0.tar.gz

Download URL lsprotocol-2025.0.0.tar.gz
Size 74.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e879da2b9301e82cfc3e60d805630487ac2f7ab17492f4f5ba5aaba94fe56c29
BLAKE2b-256 checksum
How to use checksums
e92667b84e6ec1402f0e6764ef3d2a0aaf9a79522cc1d37738f4e5bb0b21521a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Release files / lsprotocol-2025.0.0-py3-none-any.whl

Download URL lsprotocol-2025.0.0-py3-none-any.whl
Size 76.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9d78f25221f2a60eaa4a96d3b4ffae011b107537facee61d3da3313880995c7
BLAKE2b-256 checksum
How to use checksums
7bf092f2d609d6642b5f30cb50a885d2bf1483301c69d5786286500d15651ef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page