https://github.com/ragnarok540/astspy
Abstract Syntax Tree SPY
https://github.com/ragnarok540/astspy
abstract-syntax-tree ast classes code-metrics functions line-numbers lines-of-code metrics metrics-gathering python spy static-analysis static-code-analysis statistics
Last synced: 2 days ago
JSON representation
Abstract Syntax Tree SPY
- Host: GitHub
- URL: https://github.com/ragnarok540/astspy
- Owner: Ragnarok540
- License: mit
- Created: 2019-07-07T15:44:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-21T15:36:08.000Z (8 months ago)
- Last Synced: 2025-06-04T00:09:09.264Z (8 months ago)
- Topics: abstract-syntax-tree, ast, classes, code-metrics, functions, line-numbers, lines-of-code, metrics, metrics-gathering, python, spy, static-analysis, static-code-analysis, statistics
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# astspy
astspy (Abstract Syntax Tree SPY) is an open source command line tool to
extract information from Python source code files.
astspy can be used with Python 3 and 2 code, but make sure to
analyze files from each version in their respective environments.
# Features
- Print the names of classes and functions found in the file
- Calculate an aproximation of the number of lines of code of each class
or function definition (sizes)
- See what functions or classes have docstrings
- Print the locations of the definitions in the file (line numbers)
- Get stats from the sizes of the definitions
## Installation
You can install, upgrade, and uninstall ``astspy.py`` with these commands:
```sh
$ pip install astspy
$ pip install --upgrade astspy
$ pip uninstall astspy
```
## Help
To get help use:
```sh
$ astspy -h
```