dynaconf
dynaconf copied to clipboard
[RFC] implement `settings.populate_args` - `settings.populate_attrs` decorators.
populate_args
@settings.populate_args()
def a_function(server, port):
...
# optionally mapped
@settings.populate_args(server="db.config.server")
def a_function(server, port):
...
s_function(port=8888) # server will be read from dynaconf settings if not passed
populate attrs
@settings.populate_attr("db.config")
class Server:
server: str
port: int
s = Server(port=8888)
s.server # loaded from dynaconf settings
s.port
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.