Skip to content

tree-sitter-grammars/tree-sitter-pymanifest

Repository files navigation

tree-sitter-pymanifest

discord pypi

A tree-sitter parser for PyPA manifest files.

Python package

Installation

pip install tree-sitter-pymanifest

Usage

import tree_sitter_pymanifest as pymanifest

with open('MANIFEST.in', 'r') as mf:
   # parse a MANIFEST.in file
   tree = pymanifest.parse(mf.read())
   # get the highlight groups
   hl_groups = pymanifest.highlights(tree)
   # run an arbitrary query
   dir_patterns = pymanifest.query("""
   (command dir_pattern: (pattern) @dir_pattern)
   """, tree.root_node)

References

Editors

    ☑ Neovim
    ☐ Helix
    ☐ Emacs
    ☐ Zed

Changelog

v0.4.0

  • Change bindings layout

v0.3.0

  • Move to tree-sitter-grammars org

v0.2.1

  • Drop Python 3.7 support
  • Remove injections queries
  • Use tree-sitter core highlight captures

v0.2.0

  • Add Python package tests

v0.1.1

  • Bundle queries in the package