sly
"SLY - Sly Lex Yacc"
Decision gist · record as of 2026-08-14
No—do not install for new projects. The project is formally retired as of December 21, 2025 with no planned maintenance. While the code is stable and license-permissive, the maintainer explicitly recommends considering alternatives. Install only if you are maintaining existing code that already depends on SLY, or if you are willing to fork and maintain it yourself.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or greater.
- Installation is frictionless with no runtime dependencies.
- However, the project was formally retired on December 21, 2025, with the maintainer stating no further maintenance is expected.
License · maintenance · safety
MIT (permissive) — SLY is licensed under the MIT License (permissive), meaning you can use, modify, and distribute it freely with minimal restrictions, though you must include the license notice.
last release 2022-10-25 (1389 days) · last repo commit 2025-12-21 · 862 stars · archived
0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,083,867 downloads/mo, #2,172 on PyPI
Alternatives
Verify before relying
from sly import Lexer, Parser
class MyLexer(Lexer):
tokens = { NAME, NUMBER }
NAME = r'[a-zA-Z_][a-zA-Z0-9_]*'
NUMBER = r'\d+'
class MyParser(Parser):
tokens = MyLexer.tokens
@_('NUMBER')
def expr(self, p):
return int(p.NUMBER)
lexer = MyLexer()
parser = MyParser()
result = parser.parse(lexer.tokenize('text'))- Whether the archived repository will accept security patches or critical bug fixes despite the retirement notice.
- Performance characteristics when parsing large or complex grammars in production settings.
- Compatibility with recent Python versions given the last release was October 2022.
What it is and what it does
SLY is a pure-Python lexer and parser generator based on the LALR(1) algorithm, designed for building compilers and domain-specific language parsers without requiring a separate code generation step. You define lexer and parser rules as Python classes with decorators, and SLY handles tokenization and syntax analysis directly at runtime.
The library was originally developed for instructional purposes and emphasizes extensive error reporting to help users identify common mistakes. It supports empty productions, error recovery, precedence rules, and moderately ambiguous grammars. While not optimized for speed due to its Python implementation, it can handle grammars with several hundred rules. However, the project was retired on December 21, 2025, and no further maintenance is planned.
Use it for
- Building a domain-specific language (DSL) interpreter or compiler without external code generation tools.
- Parsing configuration files or domain-specific syntax with custom error messages for invalid input.
- Educational projects where understanding parser construction and LALR theory is part of the goal.
- Prototyping language features or grammar designs before committing to a production parser generator.
- Embedding a simple expression evaluator into a Python application.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No—do not install for new projects.
The project is formally retired as of December 21, 2025 with no planned maintenance. While the code is stable and license-permissive, the maintainer explicitly recommends considering alternatives. Install only if you are maintaining existing code that already depends on SLY, or if you are willing to fork and maintain it yourself.
Install
sly on PyPI
Before you install
Installation is frictionless with no runtime dependencies. However, the project was formally retired on December 21, 2025, with the maintainer stating no further maintenance is expected. The repository is archived. Users should be aware they are adopting a library that will not receive updates or bug fixes.
Requires Python 3.6 or greater.
License in practice
SLY is licensed under the MIT License (permissive), meaning you can use, modify, and distribute it freely with minimal restrictions, though you must include the license notice.
Quickstart
from sly import Lexer, Parser
class MyLexer(Lexer):
tokens = { NAME, NUMBER }
NAME = r'[a-zA-Z_][a-zA-Z0-9_]*'
NUMBER = r'\d+'
class MyParser(Parser):
tokens = MyLexer.tokens
@_('NUMBER')
def expr(self, p):
return int(p.NUMBER)
lexer = MyLexer()
parser = MyParser()
result = parser.parse(lexer.tokenize('text'))
Verify before relying
- Whether the archived repository will accept security patches or critical bug fixes despite the retirement notice.
- Performance characteristics when parsing large or complex grammars in production settings.
- Compatibility with recent Python versions given the last release was October 2022.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 1,389 days since the last release |
| Last repo commit | repository archived |
| First released | |
| Downloads | 5,083,867 / month, #2,172 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT License |
Evidence: sly-0.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “lex yacc implementation”
- slySLY is a pure-Python implementation of lex and yacc for building…
- plyPLY is a lexer and parser generator for Python that implements lex…
- rplyRPLY is a pure Python parser generator that creates lexers and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also funcparserlib · ply · rply · phply · pygmars · lark-parser · javalang · Parsley · PyMeta3 · pyparsing