schireson / configly Goto Github PK
View Code? Open in Web Editor NEWSimplify and centralize the loading of configuration, such as environment variables.
License: MIT License
Simplify and centralize the loading of configuration, such as environment variables.
License: MIT License
Issue:
I am running into the following error when loading config from a yaml file:
>>> config = Config.from_yaml("config.yml")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/omark/.pyenv/versions/3.9.6/envs/ma-analytics_notebooks-py39/lib/python3.9/site-packages/configly/config.py", line 40, in from_yaml
return cls.from_loader(YamlLoader(), file, registry=registry)
File "/Users/omark/.pyenv/versions/3.9.6/envs/ma-analytics_notebooks-py39/lib/python3.9/site-packages/configly/config.py", line 33, in from_loader
output = post_process(loader=loader, value=result, registry=registry)
File "/Users/omark/.pyenv/versions/3.9.6/envs/ma-analytics_notebooks-py39/lib/python3.9/site-packages/configly/process.py", line 11, in post_process
result[key] = post_process(loader, item, registry=registry)
File "/Users/omark/.pyenv/versions/3.9.6/envs/ma-analytics_notebooks-py39/lib/python3.9/site-packages/configly/process.py", line 47, in post_process
return loader.load_value(result)
File "/Users/omark/.pyenv/versions/3.9.6/envs/ma-analytics_notebooks-py39/lib/python3.9/site-packages/configly/loaders.py", line 25, in load_value
return self.decoder.load(value)
File "/Users/omark/.pyenv/versions/3.9.6/envs/ma-analytics_notebooks-py39/lib/python3.9/site-packages/ruamel/yaml/main.py", line 434, in load
return constructor.get_single_data()
File "/Users/omark/.pyenv/versions/3.9.6/envs/ma-analytics_notebooks-py39/lib/python3.9/site-packages/ruamel/yaml/constructor.py", line 120, in get_single_data
node = self.composer.get_single_node()
File "_ruamel_yaml.pyx", line 703, in _ruamel_yaml.CParser.get_single_node
File "_ruamel_yaml.pyx", line 904, in _ruamel_yaml.CParser._parse_next_event
ruamel.yaml.scanner.ScannerError: while scanning a block scalar
in "<unicode string>", line 1, column 1
did not find expected comment or line break
in "<unicode string>", line 1, column 2
while scanning a block scalar
in "<unicode string>", line 1, column 1
did not find expected comment or line break
in "<unicode string>", line 1, column 2
To reproduce:
BAD_VAL=">eP2CoFHt*Ppram37DDmF_D=Wuueu-w6H]~HH%bTCq7Lk%q"
bad_val: <% ENV[BAD_VAL, null] %>
from configly import Config
config = Config.from_yaml('config.yml')
Expected Behavior:
Configly treats the "bad_value" like any other quoted string value and does not throw an error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.