bestconfig's People
Forkers
chernogorskybestconfig's Issues
Traceback can be more helpful when KeyError is raised
Right now it is hard to determine what config parameter is absent in .env
or any other config sources.
Feature request: Add information about what parameter is missing like "KeyError: couldn't find source for config parameter TOKEN_1
"
Example (how traceback looks in current version):
>>> import bestconfig
>>> config = bestconfig.Config()
>>>
>>> def f():
... ...
... ...
... a = config['TOKEN_1']
... ...
... b = config['TOKEN_2']
... ...
...
>>> f()
Traceback (most recent call last):
File "/home/m-danya/code/public-habit-tracker/venv/lib/python3.10/site-packages/bestconfig/config_provider.py", line 56, in get
value = self._unsafe_access_key(item)
File "/home/m-danya/code/public-habit-tracker/venv/lib/python3.10/site-packages/bestconfig/config_provider.py", line 182, in _unsafe_access_key
raise KeyError
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 4, in f
File "/home/m-danya/code/public-habit-tracker/venv/lib/python3.10/site-packages/bestconfig/config_provider.py", line 158, in __getitem__
return self.get(item, raise_absent=True)
File "/home/m-danya/code/public-habit-tracker/venv/lib/python3.10/site-packages/bestconfig/config_provider.py", line 67, in get
raise KeyError
KeyError
For now, is it impossible to determine whether TOKEN_1
or TOKEN_2
is absent. This feature would greatly improve this package. Thanks.
this cant support cyrillic symbols
Hi, can you add support for cyrillic symbols in utf8 please? https://i.imgur.com/rN7a9qT.png
config.yml example
version: 1
messages:
hello: "Привет"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.