Mimesis: Add builtins specific data providers.

Created on 29 Dec 2016  路  4Comments  路  Source: lk-geimfari/mimesis

Every language has specific data that suit only for ones. For example SSN for en (USA) or CPF for pt-br. CPF can be useful only for brazilians.

If user want to use this providers then he must be imported explicitly.

Here's how it will look:

>>> from elizabeth import Generic
>>> from elizabeth.builtins import Brazil

>>> generic = Generic('pt-br')

>>> class BrazilProvider(Brazil):
        class Meta:
            name = "brazil_provider"
>>> generic.add_provider(BrazilProvider)
>>> generic.brazil_provider.cpf()
'001.137.297-40'
enhancement

Most helpful comment

@Battleroid @Uncleleech Also i added really small comparison to README (with screenshot).

All 4 comments

@Battleroid What you think about it? Does that sound like something useful?

Yes, this is useful.
Perhaps we can also make a general one for custom pieces of data that can be useful as well altough im having trouble picturing how you'd make that

@Battleroid @Uncleleech Also i added really small comparison to README (with screenshot).

Sounds good.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lk-geimfari picture lk-geimfari  路  3Comments

lk-geimfari picture lk-geimfari  路  7Comments

lk-geimfari picture lk-geimfari  路  5Comments

lk-geimfari picture lk-geimfari  路  6Comments

4kpt picture 4kpt  路  7Comments