Closed lk-geimfari closed 7 years ago
Can you explain more details about that?
The data providers are this ?
And the manually add that you said are the method in add_provider
in generic.py
file?
Automatically that you say is load from data profile folder and run the add_provider
soon after?
It would be awesome to add new provider to generic automatically, i.e from __all__
. Keep in mind that we use lazy initialization for providers which use locale
.
Why some attributes have the underscore and other not?
Because some providers pull data from files when another not. if attribute start with underscore then it use file from data/locale/provider.json
and we use lazy initialization for ones.
What you think about read the class in providers folder, and insert it in __all__
list, and the Generic
class read this list and call __new__
from each element.
The problem would be detect when call lazy load or normal load.. The current _
at begin from attribute.
At this moment it should be done manually, which means that every time a new data provider appears, you must manually add it to Generic (), which is not convenient. I suggest add all providers from
__all__
to Generic() automatically, but we need to save current API.Any ideas?