Skip to content

Scalr/pygohcl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

34ad7ff · Oct 18, 2024
Oct 18, 2024
Sep 30, 2024
Sep 30, 2024
Feb 11, 2022
May 20, 2020
Oct 18, 2024
Oct 18, 2024
Oct 18, 2024
Sep 9, 2024
Sep 2, 2024
Sep 30, 2024
Sep 9, 2024
Sep 30, 2024
Jan 12, 2023
Oct 18, 2024

Repository files navigation

pygohcl python package

pygohcl

Python wrapper for hashicorp/hcl (v2).

Requirements

The following versions are supported - 3.8, 3.9, 3.10, 3.11, 3.12, 3.13.

Setup

pip install pygohcl

Usage

>>> import pygohcl
>>> pygohcl.loads("""variable "docker_ports" {
...   type = list(object({
...     internal = number
...     external = number
...     protocol = string
...   }))
...   default = [
...     {
...       internal = 8300
...       external = 8300
...       protocol = "tcp"
...     }
...   ]
... }""")
{'variable': {'docker_ports': {'default': [{'external': 8300, 'internal': 8300, 'protocol': 'tcp'}], 'type': 'list(object({internal=numberexternal=numberprotocol=string}))'}}}

Building locally

You can use the following commands to build a wheel for your platform:

pip install wheel
python setup.py bdist_wheel

The wheel will be available in ./dist/.