Skip to main content

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

Project description

Note We will soon release a major version bump with breaking changes. We recommend starting new projects with the v1 alpha release at


PyPI Version Build Status !pyversions license Documentation Status

pygls (pronounced like "pie glass") is a pythonic generic implementation of the Language Server Protocol for use as a foundation for writing language servers using Python (e.g. Python, XML, etc.). It allows you to write your own language server in just a few lines of code.

Quick Intro


In order to support type-checking, we added pydantic library which requires passing keyword arguments when creating LSP models.

Here's how to create a server and register a code completion feature:

from pygls.capabilities import COMPLETION
from pygls.server import LanguageServer
from pygls.lsp import CompletionItem, CompletionList, CompletionOptions, CompletionParams

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

@server.feature(COMPLETION, CompletionOptions(trigger_characters=[',']))
def completions(params: CompletionParams):
    """Returns completion items."""
    return CompletionList(

server.start_tcp('', 8080)

Show completion list on the client:


Docs and Tutorial

The full documentation and a tutorial is available at

Let Us Know How You Are Using pygls

Submit a Pull Request (PR) with your information against the implementations document.




Your contributions to pygls are 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 a donation.

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-0.13.1.tar.gz (691.5 kB view hashes)

Uploaded source

Built Distribution

pygls-0.13.1-py3-none-any.whl (88.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page