Skip to main content

a pythonic generic language server (pronounced like "pie glass").

Project description

PyPI Version !pyversions license Documentation Status

pygls: The Generic Language Server Framework

pygls (pronounced like "pie glass") is a pythonic generic implementation of the Language Server Protocol for use as a foundation for writing your own Language Servers in just a few lines of code.


from pygls.server import LanguageServer
from lsprotocol.types import (

server = LanguageServer("example-server", "v0.1")

def completions(params: CompletionParams):
    items = []
    document = server.workspace.get_document(params.text_document.uri)
    current_line = document.lines[params.position.line].strip()
    if current_line.endswith("hello."):
        items = [
    return CompletionList(is_incomplete=False, items=items)


Which might look something like this when you trigger autocompletion in your editor:


Docs and Tutorial

The full documentation and a tutorial are available at

Projects based on pygls

We keep a table of all known pygls implementations. Please submit a Pull Request with your own or any that you find are missing.


The main alternative to pygls is Microsoft's NodeJS-based Generic Language Server Framework. Being from Microsoft it is focussed on extending VSCode, although in theory it could be used to support any editor. So this is where pygls might be a better choice if you want to support more editors, as pygls is not focussed around VSCode.

There are also other Language Servers with "general" in their descriptons, or at least intentions. They are however only general in the sense of having powerful configuration. They achieve generality in so much as configuration is able to, as opposed to what programming (in pygls' case) can achieve.


Your contributions to pygls are most welcome ❤️ Please review the Contributing and Code of Conduct documents for how to get started.


Open Law Library is a 501(c)(3) tax exempt organization. Help us maintain our open source projects and open the law to all with sponsorship.


We would like to give special thanks to the following supporters:



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygls-1.0.1.tar.gz (674.5 kB view hashes)

Uploaded Source

Built Distribution

pygls-1.0.1-py3-none-any.whl (40.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page