Closed hkage closed 3 years ago
This PR will make registration of the provider classes more clean and less code repeating (using the meta class for each provider class).
E.g. instead of using the metaclass and setting the provider id on class level:
class ClearProvider(with_metaclass(ProviderMeta, Provider)): id = 'clear' def alter_value(self, value): return None
it is now possible to register the class directly:
@register('clear') class ClearProvider(Provider): def alter_value(self, value): return None
It is also possible to allow regular expressions as provider IDs (usefull for the Faker provider):
@register('fake.+') class FakeProvider(Provider): regex_match = True
This PR will make registration of the provider classes more clean and less code repeating (using the meta class for each provider class).
E.g. instead of using the metaclass and setting the provider id on class level:
it is now possible to register the class directly:
It is also possible to allow regular expressions as provider IDs (usefull for the Faker provider):