lk-geimfari / mimesis

Mimesis is a robust data generator for Python that can produce a wide range of fake data in multiple languages.
https://mimesis.name
MIT License
4.4k stars 334 forks source link

Location aware test data #1552

Closed sdp5 closed 4 months ago

sdp5 commented 4 months ago

Feature request

While generating datasets that would be helpful if they can be location aware for the given locale. locale_to_country mapping may not be perfect however can serve the purpose up to an extent.

for example for DE_AT, DE_CH, EN_AU, EN_CA etc.

Thesis

>>> from mimesis import Address
>>> address = Address(locale=Locale.EN_AU)
>>> address.country()
'Ethiopia'
>>> address.calling_code()
'+509'
>>> address.city()
'Hopewell'

Proposal: return an Australian address.

Reasoning

Adding little context to it would help test some real scenarios.

lk-geimfari commented 4 months ago

I'm not sure it makes much sense, but you could use Custom Field Handlers to achieve a similar result.

sdp5 commented 4 months ago

I'm not sure it makes much sense, but you could use Custom Field Handlers to achieve a similar result.

sure thanks @lk-geimfari !