LFX Platform

Know more about LFX Platform

LFX Insights

Python Parsing and AST Libraries

Libraries that parse Python code into abstract syntax trees (ASTs) and provide tools for code analysis, manipulation, and transformation without executing the code.

8 projects

2,064 contributors

$8.1M

pycparser

pycparser is a complete parser for the C language, written in pure Python. It can parse C code into an Abstract Syntax Tree (AST) and is designed to be used for static analysis, translation, and other tools that need to process C source code.

Contributors

515

Organizations

151

Software value

$392K

PyParsing

PyParsing is a Python library that provides a framework for creating and executing text parsing grammars. It allows developers to build recursive descent parsers by writing the grammar specification directly in Python code, without requiring separate parser generator tools.

Contributors

432

Organizations

151

Software value

$2.8M

Mistune

Mistune is a fast and full-featured Markdown parser library for Python, offering both pure Python and optimized C implementations. It supports standard Markdown syntax, GitHub Flavored Markdown, and custom syntax extensions.

Contributors

404

Organizations

180

Software value

$438K

LibCST

LibCST is a concrete syntax tree parser and serializer library for Python that enables parsing source code into a concrete syntax tree (CST) format, analyzing and manipulating the code structure while preserving formatting, comments and whitespace, and converting back to source code.

Contributors

379

Organizations

133

Software value

$3.6M

Parso

A Python Parser

Contributors

181

Organizations

73

Software value

$456K

ASTTokens

ASTTokens is a Python library that enables mapping between Python source code and abstract syntax tree (AST) nodes, providing utilities to find the original source text corresponding to AST nodes and vice versa. It helps with source code analysis, manipulation, and transformation tasks.

Contributors

70

Organizations

35

Software value

$163K

cssselect

cssselect is a Python library that parses CSS3 selectors and translates them to XPath 1.0 expressions. It provides functionality to convert CSS selectors to XPath queries, enabling CSS-style querying of XML and HTML documents using XPath engines.

Contributors

64

Organizations

28

Software value

$108K

GAST

GAST is a Python AST (Abstract Syntax Tree) manipulation library that provides a generic AST to represent Python's syntax, independent of the Python version being used. It allows for parsing Python code into an AST and manipulating or analyzing that AST programmatically.

Contributors

10

Organizations

5

Software value

$123K

Looking for a project that’s not listed?