Astatine
A Python library providing helper functions for working with abstract syntax trees (ASTs) to simplify code analysis and manipulation.

What it is
Astatine is a Python package designed to extend the capabilities of Python's built-in ast module. It offers a collection of utility functions that make it easier for developers to parse, analyze, and manipulate Python code through its abstract syntax tree representation. The library addresses the instability of Python's native AST module between releases by providing consistent helper functions.
The main features include extracting attribute names, retrieving constants from AST nodes, identifying context managers, locating docstrings, and obtaining top-level comments. These tools are particularly valuable for developers building linters, code formatters, static analyzers, or any tool that needs to inspect or modify Python code programmatically.
Developers can install Astatine from multiple sources including PyPI, Anaconda Cloud, or directly from its GitHub repository using standard pip installation commands. The library is open source and available under an unspecified license, encouraging community contributions and modifications.
The project maintains comprehensive documentation hosted on Read the Docs, along with tests and quality assurance processes. Its name cleverly references both its AST functionality and the unstable nature of chemical element astatine, reflecting the module's purpose in handling Python's evolving AST implementation.
This description was generated by AI from the site's public content and may contain errors.
What you can do there
- Download and install the Python library
- Access API documentation and references
- Browse source code on GitHub
- Read contributing guidelines
- Access function index and code examples
Who it's for
Python developers working with code analysis, linters, formatters, or static analysis tools
Frequently asked questions about astatine.readthedocs.io
›What is the astatine Python library used for?
Astatine provides helper functions for working with Python's abstract syntax trees, making it easier to analyze and manipulate Python code programmatically.
›How do I install the astatine library?
You can install astatine using pip with the command 'python3 -m pip install astatine --user' or through Anaconda Cloud and GitHub sources.
›What specific functions does astatine provide?
It includes functions like get_attribute_name, get_constants, get_contextmanagers, get_docstring_lineno, get_toplevel_comments, is_type_checking, kwargs_from_node, and mark_text_ranges.
›Is astatine compatible with different Python versions?
The library is designed to help with AST instability between Python releases, suggesting it handles compatibility across different Python versions.
›Where can I find the API documentation for astatine?
Comprehensive API documentation is available on Read the Docs at astatine.readthedocs.io, including API reference and function index.
›Is astatine an open source project?
Yes, astatine is open source with its source code available on GitHub, and it accepts community contributions through a contributing guide.
›What makes astatine different from Python's built-in ast module?
Astatine builds upon Python's native AST module by providing additional utility functions that simplify common AST manipulation tasks and address consistency across Python versions.
