Collect top level variable names using the ast.
Project description
ast_names
Collect top level variable names using the ast.
Installation
pip install ast_names
Usage
>>> from ast_names import ast_names
>>> ast_names("""
... import sys, os
... import sys as foo
...
... from foo import (
... bar as baz,
... alpha
... )
...
... MYCONSTANT = 1
...
... def my_func():
... ...
...
... class MyClass:
... ...
... """)
{'os', 'MYCONSTANT', 'alpha', 'baz', 'foo', 'sys', 'MyClass', 'my_func'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ast_names-0.1.0.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for ast_names-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7e98ae8a481bc5a22103d0ad1f6bf9d8683414c6b1af29cfb4175423ae8b39a |
|
MD5 | 6df9d0d452c595f924b6e874040dccb6 |
|
BLAKE2b-256 | 4e0de8f13bf31caf622b5a47fa2947cacb1ef9afe5f0303c562059b7edd5ba8f |