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 details)
Built Distribution
File details
Details for the file ast_names-0.1.0.tar.gz
.
File metadata
- Download URL: ast_names-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df4f1a8f7091dae3b4597e4936cbdc3e22400546a0365c77a15100b967b2d3a9 |
|
MD5 | 4e78ab25b87c1ffad2e189f00c0bb9e4 |
|
BLAKE2b-256 | 29b556991d82cd118c7125e6911b4e7b5b6ce20168924c152944c2b446f5d3fa |
File details
Details for the file ast_names-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: ast_names-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7e98ae8a481bc5a22103d0ad1f6bf9d8683414c6b1af29cfb4175423ae8b39a |
|
MD5 | 6df9d0d452c595f924b6e874040dccb6 |
|
BLAKE2b-256 | 4e0de8f13bf31caf622b5a47fa2947cacb1ef9afe5f0303c562059b7edd5ba8f |