This project has been archived by its maintainers, and is no longer receiving any updates.
Features
- Read a Terraform Variables HCL file (variables.tf) and create a Pydantic model from it
- Interpret complex data types (list(string), etc) into Python data types
- Interpret object data types into sub models
- Does not currently support terraform input validation
Requirements
- Python ^3.11
- Pydantic ^1.10.x
- python-hcl2 ^4.3.x
Installation
You can install Tf Vars To Pydantic via [pip] from [PyPI]:
pip install tf-vars-to-pydantic
Usage
Assuming you have a tf vars file that looks like:
variable "foo" {
description = "String variable"
type = string
}
variable "bar" {
description = "String variable with default"
type = number
}
variable "baz" {
type = list(string)
}
variable "qux" {
description = "Boolean variable"
default = true
type = bool
}
from tf_vars_to_pydantic import convert_file
TFVarsModel = convert_file(path="./tests/fixtures/simple.tf", model_name="TFVarsModel")
tfvars_as_pydantic = TFVarsModel(foo="test", bar=7.2, baz=['boop', 'bing', 'bong'])
print(tfvars_as_pydantic)
# foo='test' bar=7.2 baz=['boop', 'bing', 'bong'] qux=True
Contributing
Contributions are very welcome. To learn more, see the Contributor Guide.
License
Distributed under the terms of the MIT license, Tf Vars To Pydantic is free and open source software.
Issues
If you encounter any problems, please [file an issue] along with a detailed description.
Contributors
Andrew 💻 ⚠️ 📖 |
Metadata
Release files for tf-vars-to-pydantic 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tf_vars_to_pydantic-0.1.2.tar.gz | 5.2 kB | Without provenance | Details for tf_vars_to_pydantic-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tf_vars_to_pydantic-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for tf_vars_to_pydantic-0.1.2-py3-none-any.whl |
Total release size: 11.4 kB
Release files / tf_vars_to_pydantic-0.1.2.tar.gz
| Download URL | tf_vars_to_pydantic-0.1.2.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d008e6d8800d31e4d756c401d1edf483571c2f18abb7f476844dbc7b534631a
|
|
BLAKE2b-256 checksum How to use checksums |
c9db36c81d244487ba73f91bb961114bbf61ab7ca79be2d941f726c1a169f4f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / tf_vars_to_pydantic-0.1.2-py3-none-any.whl
| Download URL | tf_vars_to_pydantic-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3144d1b52125184490b54bed9dec45de96af1787974d0111b56ce09e11a89a22
|
|
BLAKE2b-256 checksum How to use checksums |
8bebd5390cb46394ab6998ca16438651cae3f1d95271f64996f5080124ab51cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for tf-vars-to-pydantic 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.