I wasn't able to find a method in the python faker library similar to the javascript library method faker.fake for combining faker API methods using a mustache string format. If this does exist, can someone share references/docs on how to use this? If not, can someone help with a workaround?
Asked
Active
Viewed 112 times
0
-
There isn't a faker method, but you can use fstrings to get the job done `f'{fake.suffix_male()}{fake.name_male()}` – Fabio Craig Wimmer Florey Apr 23 '22 at 03:37
-
Check out the README and the Wiki tab on the github page https://github.com/joke2k/faker – Alexander Apr 23 '22 at 04:48
-
@FabioCraigWimmerFlorey With the `faker.fake` in js library, I could specify a way for faker to generate values in a non-programmatic way (for ex: in a JSON file with `{"faker": { "fake": "{{datatype.uuid}}"}`) I could just pass the `faker.fake` object in JSON as a parameter to `faker.fake` method and get UUIDs. I don't see that happening with `fstrings` as they're still a programmatic way to specify templates. – K.N. Bhargav Apr 23 '22 at 05:49
-
@alexpdev If there's a particular section on the README or Wiki that addresses this question, can you please share a link to that section? – K.N. Bhargav Apr 23 '22 at 05:52