--- id: tree-sitter-kotlin version: "1.1.0" license: MIT license_treatment: permissive maintenance: dormant --- # tree-sitter-kotlin — Kotlin grammar for tree-sitter License: permissive · Maintenance: dormant · Downloads: 2.2M/mo ## What it is and what it does tree-sitter-kotlin is a language grammar binding for Kotlin that integrates with the tree-sitter incremental parsing framework. It provides precompiled wheels for Python 3.9+ across Linux, macOS (Intel and ARM), and Windows, reducing installation friction on supported platforms. The package is maintained as part of the tree-sitter-grammars community project and follows the official Kotlin language specification. The grammar enables you to parse Kotlin source code and extract its syntax tree for analysis, transformation, or code generation tasks. It is typically used in tools that need to understand or manipulate Kotlin code structure—such as linters, refactoring engines, documentation generators, or language servers—without requiring a full Kotlin compiler. Use it for: - Build a Kotlin linter or code style checker that traverses the syntax tree to enforce conventions. - Extract function signatures and class definitions from Kotlin source for documentation generation. - Perform automated refactoring by identifying and transforming specific syntax patterns in Kotlin files. - Analyze Kotlin codebases to gather metrics on code complexity, function count, or dependency usage. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Kotlin language grammar for tree-sitter, enabling incremental parsing and syntax tree analysis of Kotlin code. Yes, if you need to parse and analyze Kotlin code programmatically. The MIT license is unrestricted, no security vulnerabilities are known, and precompiled wheels make installation straightforward on common platforms. However, maintenance is dormant (last release 582 days ago), so verify that the grammar covers your Kotlin version and feature set before committing to a production tool. ## Install pip install tree-sitter-kotlin uv add tree-sitter-kotlin poetry add tree-sitter-kotlin ## Installing tree-sitter-kotlin Before you install: Medium install friction due to compiled wheels for multiple platforms. Dormant maintenance status—last release 582 days ago, though repository remains active with a recent commit on 2025-01-16. License in practice: MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install tree-sitter-kotlin import tree_sitter_kotlin Requires Python ≥3.9. Requires tree-sitter as a runtime dependency (not listed in package metadata). Verify before relying: - Whether tree-sitter is declared as a runtime dependency or must be installed separately. - Completeness of Kotlin grammar coverage relative to the official Kotlin language specification. - Performance characteristics and memory footprint for large codebases. - How to use the imported module to parse Kotlin code (usage pattern not documented in fact sheet). ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: dormant - Downloads: 2.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags kotlin parsing tree-sitter, kotlin syntax tree grammar, incremental kotlin parser, kotlin ast generation, tree-sitter language binding, kotlin code analysis grammar, kotlin, parsing, ast [View on SkillFed](https://skillfed.io/packages/tree-sitter-kotlin) · [View on PyPI](https://pypi.org/project/tree-sitter-kotlin/)