A python API wrapper for DiceBear's avatar generating API.
Project description
DiceBear Py Wrapper
dicebear
is an API wrapper for https://dicebear.com. Using this wrapper you can get custom avatars for your program.
For an example go to examples/dicebear.py
.
Useful links
- PyPI: https://pypi.org/project/dicebear/
- GitHub: https://github.com/jvherck/dicebear
- Dicebear: https://dicebear.com
How to install
Run pip install dicebear
If that doesn't work try py -m pip install dicebear
Usage
from dicebear import DAvatar, DStyle, DOptions, DColor
options = DOptions(
backgroundColor=DColor("#00ddd0"),
rotate=90
)
av = DAvatar(
style=DStyle.pixel_art,
seed="John Apple",
options=options
)
print(av.url_svg)
av.edit(
extra_options=DOptions(
backgroundColor=DColor("#000000")
)
)
# This will keep the `rotate` option but override the `backgroundColor` option
print(av.url_png)
av.edit_specific(
blank_options={
"face": "variant04"
}
)
# This edits the style specific options
print(av.url_png)
Styles
All the possible avatar styles.
https://avatars.dicebear.com/styles
adventurer
adventurer-neutral
avataaars
big-ears
big-ears-neutral
big-smile
bottts
croodles
croodles-neutral
identicon
initials
micah
miniavs
open-peeps
personas
pixel-art
pixel-art-neutral
Base Options
All the possible options for the avatar. These options work for all the styles.
seed
(type:str
) - the seed for the avatar generator (determine its basic looks)dataUri
(type:bool
) - whether to give the dataUriflip
(type:bool
) - flips the image verticallyrotate
(type:int
) - rotates the avatarscale
(type:int
) - the scale of the avatarradius
(type:int
) - the radius of the avatarsize
(type:int
) - the size of the avatarbackgroundColor
(type:DColor( " #ffffff " )
) - the background color of the avatartranslateX
(type:int
) - move the avatar horizontallytranslateY
(type:int
) - move the avatar vertically
Specific Style Options
Specific options to get a more detailed avatar. This is different for every style.
- adventurer
- adventurer-neutral
- avataaars
- big-ears
- big-ears-neutral
- big-smile
- bottts
- croodles
- croodles-neutral
- identicon
- initials
- micah
- miniavs
- open-peeps
- personas
- pixel-art
- pixel-art-neutral
Credits
Special thanks to DiceBear (Florian Körner) for making this amazing API and to all artists that helped making avatars!
Licenses and privacy policy
- Dicebear Licenses: https://avatars.dicebear.com/licenses
- Dicebear Privacy Policy: https://avatars.dicebear.com/legal/privacy-policy
- Dicebear Python API wrapper (this project): https://choosealicense.com/licenses/mit/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dicebear-0.2.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a117010b5de18b76a0fb516074cfab187e7847bc32789e991a6f5dc85ee8c06 |
|
MD5 | 290b28e45b076698f949846108e26ac9 |
|
BLAKE2b-256 | 30f6fa1616a7706c3c9e428899eeff58269cb09e25b5a1ccefd18aacaf257e27 |