base POC python

This commit is contained in:
Eau
2026-02-25 17:27:19 -06:00
commit 9dea99016b
8 changed files with 173 additions and 0 deletions

24
python/sample.py Normal file
View File

@@ -0,0 +1,24 @@
from config import Configuration, query_property
class SampleConfiguration(Configuration):
plain_file = query_property("$.plain")
reference = query_property("$.working_reference")
broken_reference = query_property("$.broken_reference")
encrypted_file = query_property("$.encrypted_file")
sample_config="""
plain: !FileData plain_file.txt
working_reference: !FileReference plain_file.txt
broken_reference: !FileReference fake_file.txt
encrypted_file: !EncryptedFileData
filename: encrypted_file.txt
key: !FileReference key.txt
"""
config = SampleConfiguration()
config.load_data(config_source=sample_config)
from pprint import pprint
pprint([config.reference, config.broken_reference, config.plain_file.read_data(),config.encrypted_file.read_data()])