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.44k stars 336 forks source link

Where do I find the fill_fake() method? #704

Closed kishvanchee closed 5 years ago

kishvanchee commented 5 years ago

User().fill_fake(count=2000, locale='de')

I am trying to do this, but I am not able to find the source code for this.

lk-geimfari commented 5 years ago

Actually it was just an example. You must implement it by yourself.

kishvanchee commented 5 years ago

Ah okie. A couple more questions if you don't mind.

  1. I feel it would be helpful if Actually it was just an example. You must implement it by yourself. this can be written in the docs itself.

  2. Is it possible to create a fill_fake() method for the base class? To word it better, basically incorporate the method such that it can be called by any class. I can try implementing this and create a PR if I get the time.

lk-geimfari commented 5 years ago
  1. I think that it's pretty clear that it was just an example, but you can create PR with explanations in docs, if you disagree with me.

  2. I am not sure, that I understood you, but if you mean something like BaseProvider.fill_fake() then it have not sense.

kishvanchee commented 5 years ago
  1. I meant that even though it was an example shown, I did not expect that it would be an example which didn't have code implemented in the package. I'll give a PR for this when I get time then. Thanks. :)

  2. Yes I meant like BaseProvider.fill_fake() thus this could be useful for any of the other providers. (again, Please forgive me I am yet to go through the source code properly to understand how it is implemented.) I was hoping for a generic method, which can be used, say Address().address().fill_fake(count=100).

lk-geimfari commented 5 years ago

Oh, no. It's not good idea and we won't add such method to API, sorry.

If you need list of some kind of data, just use standard Python tools for it:

_ = [address.adaress() for i in range(100)]
kishvanchee commented 5 years ago

It's not good idea and we won't add such method to API, sorry.

Can you please expand why this is not a good idea? I just want to understand it. :)

lk-geimfari commented 5 years ago

Because there is no need to add such a simple thing to API and make it complex. Mimesis solves the problem it must solve: generating data.

If you need such feature, just create mixin for it.

kishvanchee commented 5 years ago

Ohk cool. Thank you very much. I'll close the issue.