Created
November 28, 2021 19:28
-
-
Save deusmachinea/6f2012efb5d4fb981d75ce829931b8f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from py_avataaars import PyAvataaar | |
| def generate_mock_user_details(path, name): | |
| avatar = pa.PyAvataaar( | |
| style=pa.AvatarStyle.TRANSPARENT, | |
| skin_color=pa.SkinColor[random.choice([i.name for i in pa.SkinColor])], | |
| hair_color=pa.HairColor[random.choice([i.name for i in pa.HairColor])], | |
| facial_hair_type=pa.FacialHairType[random.choice([i.name for i in pa.FacialHairType])], | |
| facial_hair_color=pa.HairColor[random.choice([i.name for i in pa.HairColor])], | |
| top_type=pa.TopType[random.choice([i.name for i in pa.TopType])], | |
| hat_color=pa.Color[random.choice([i.name for i in pa.Color])], | |
| mouth_type=pa.MouthType[random.choice([i.name for i in pa.MouthType])], | |
| eye_type=pa.EyesType[random.choice([i.name for i in pa.EyesType])], | |
| eyebrow_type=pa.EyebrowType[random.choice([i.name for i in pa.EyebrowType])], | |
| nose_type=pa.NoseType[random.choice([i.name for i in pa.NoseType])], | |
| accessories_type=pa.AccessoriesType[random.choice([i.name for i in pa.AccessoriesType])], | |
| clothe_type=pa.ClotheType[random.choice([i.name for i in pa.ClotheType])], | |
| clothe_color=pa.Color[random.choice([i.name for i in pa.Color])], | |
| clothe_graphic_type=pa.ClotheGraphicType[random.choice([i.name for i in pa.ClotheGraphicType])], | |
| ) | |
| avatar.render_png_file(f'{path}/{name}.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment