No project description provided
Project description
hcl2-ast
A HCL2 parser and evaluator based on python-hcl2 that produces an Abstract Syntax Tree.
Note: This project is in an early stage. It does not currently cover all HCL2 syntax features and does not have good test coverage.
Usage
from hcl2_ast import parse_string
module = parse_string("""
hello {
name = "World"
}
""")
print(module.pformat())
Outputs:
Module(body=[
Block(
name='hello',
args=[],
body=[
Attribute(key='name', value=Literal(value='World')),
]
),
])
Also check out the hcl2-eval package to evaluate HCL2 configuration ASTs.
Compatibility
hcl2-ast requires Python 3.6 or higher.
Known issues
- No understanding of operator precedence in expressions (grouping with parentheses works as expected)
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
hcl2-ast-0.2.0-1.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for hcl2_ast-0.2.0_1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c92a652fecad1a2b3420eb394b2d21a221c18c329b461a0aeba0d7d0be69285 |
|
MD5 | 0ed12f42d374f867886dee895dc68e29 |
|
BLAKE2b-256 | 7a382ced34762d99e41be7a87a54a96cfd2fd979ab8e2162495ac6d5c71e20a1 |