# Instagram/LibCST

A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree

Repository: https://github.com/Instagram/LibCST
Canonical: https://ross.abutalabs.com/products/libcst
Homepage: https://libcst.readthedocs.io/
Language: Python
License: NOASSERTION
License Family: other
Last push: 2026-08-11T05:22:09+00:00

## Health v2 (maintenance only)
Score: 93/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 83, longevity 100
- inputs: {"age_days": 2584, "days_push": 22, "days_rel": 35, "gap_med": 45.0, "n_releases_24m": 11}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1939, forks 228 (observed 2026-08-28T04:05:57.274613+00:00)

## What it is
LibCST is a concrete syntax tree (CST) parser and serializer library for Python that preserves formatting details like whitespace and comments. It enables lossless programmatic reading, analysis, and transformation of Python source code.

## Use cases
- parse python source code into a syntax tree
- write codemods to refactor python codebases
- build custom linters for python
- automatically rewrite python files while preserving formatting
- analyze python code for static analysis tools

## When to choose
- you need lossless round-tripping of python source including comments and whitespace
- you are building codemods, linters, or refactoring tools for python
- you need typed tree nodes with visitor and transformer patterns

## When to avoid
- you only need the abstract syntax tree without formatting details (use ast)
- you are parsing languages other than python
- you need extremely fast parsing with no tree fidelity requirements

## Facets
- artifact type: library
- maturity: active
- function: parser, serialization, developer-tools
- domain: parsers, developer-tools, programming-languages
- platform: python, cross-platform
- tags: concrete-syntax-tree, code-analysis, codemod, python-source-transformation, ast

## Member repositories
- Instagram/LibCST (main) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:57.274613+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:08:10.545218+00:00, confidence not recorded.
  - readme: https://github.com/Instagram/LibCST (fetched 2026-08-28T04:05:57.274613+00:00, sha 5b9ce80c1ab9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
