litestar-org / polyfactory

Simple and powerful factories for mock data generation
https://polyfactory.litestar.dev/
MIT License
934 stars 73 forks source link

Enhancement: Consider supporting `mimesis` as a fake data provider #394

Open sobolevn opened 9 months ago

sobolevn commented 9 months ago

Summary

faker is great! But, https://github.com/lk-geimfari/mimesis is also very cool. It is faster and has way more types of data and data itself.

It would be very nice to include the support for it, since it can add more structured data to users' structures.

I happen to be a maintainer of both :)

CC @lk-geimfari

Basic Example

No response

Drawbacks and Impact

It can increase the comlexity of the project.

Unresolved questions

No response


Funding

Fund with Polar

guacs commented 9 months ago

Should we add support for it or just completely switch out faker with mimesis? I think the latter would be easier (albeit a breaking change), and also don't see too much benefit in supporting both of them.

@litestar-org/members, thoughts?

provinzkraut commented 9 months ago

Should we add support for it or just completely switch out faker with mimesis? I think the latter would be easier (albeit a breaking change), and also don't see too much benefit in supporting both of them.

@litestar-org/members, thoughts?

+1 for switching to mimesis if it proves to be beneficial in terms of ergonomics and/or performance.

v3ss0n commented 9 months ago

just checked and that whats i am actually looking! cool!.

lk-geimfari commented 9 months ago

I would be happy to provide assistance with the transition to mimesis. Let me know if you have any questions.

kaine-bruce-dmt commented 3 weeks ago

New to the project. Was looking into Polyfactory (as TypedDict/dataclass/Pydantic support)

In general I have started using Mimesis over Faker.

I have definitely felt the benefits of Mimesis over Faker in terms of performance. Mainly spin up time on generating X amount of test data for unit tests.

Was anything ever done with this? Is the project still using Faker under the hood?

guacs commented 3 weeks ago

@kaine-bruce-dmt Hey, thanks for the interest! This is something that's planned, however it'd be nice if we could do it in a way that we can allow users to use faker or mimesis. Basically, create an abstraction layer that has a defined interface so that any such data generation library (or a custom implementation) could be used. So, currently this is still using faker under the hood.

This may be a breaking change, but I think that's okay and worth doing. It might be possible to do this in a non-breaking way, but I'm not too sure about that. I've been meaning to implement this, but I haven't had the time the past few months to work on it.

If you have any ideas or questions, please feel free to ask. We'd be happy to help!