Models
Classes used to facilitate the module's usage.
Variables
options(list): all possible basic options (work for all styles)default_options(dict): a dict with all default optionsstyles(list): all available styles
class DColor
def __init__()
All colors used for this module are made with this class. This uses HTML/hex color codes.
Note that html_code can also be transparent when used for the backgroundColor option!
def __init__(self,
html_code: str | list[str] = "transparent"
) -> NoneReturns:
None: when called as string it will return the color codeRaises:
IncorrectColor: an incorrect html color code is given
def random()
Get a random valid HTML color code.
def random(
) -> DColor()class DStyle
def __init__()
Not to be initialized!
def get_schema()
Returns a dict with the JSON schema (all properties) of the given avatar style.
def get_schema(
style: str
) -> dictReturns:
dict: the dictionary containing the avatar style's schema.
def random()
Get a random style for DStyle.
def random(
) -> strReturns:
str: returns a random Style string.
def from_str()
Get an avatar style from a string.
def from_str(
style_str: str
) -> strReturns:
str: returns a Style string from the given string if the style exists.
Attributes
For more info check Styles.
list=all_stylesadventureradventurer_neutralavataaarsavataaars_neutralbig_earsbig_ears_neutralbig_smilebotttsbottts_neutralcroodlescroodles_neutraldylanfun_emojiglassiconsidenticoninitialsloreleilorelei_neutralmicahminiavsnotionistsnotionists_neutralopen_peepspersonaspixel_artpixel_art_neutralringsshapesthumbs
class DFormat
def __init__()
Not to be initiated!
def from_str()
def from_str(
format_str: str
) -> strReturns:
str: returns a Format string from the given string if the format exists.
Attributes
list=all_formatssvgwebpavifpngjpgjpegjson
class DOptions
def __init__()
def __init__(self,
*,
flip: bool = False,
rotate: int = 0,
scale: int = 100,
radius: int = 0,
size: int = 0,
backgroundColor: DColor | list(DColor) = DColor(),
backgroundType: str = "solid",
backgroundRotation: int = 0,
translateX: int = 0,
translateY: int = 0,
randomizeIds: bool = False
**kwargs
) -> NoneReturns:
DOptions: theDOptionsinstance to use forDAvatar.
randomizeIds
default False
Randomize the IDs in the generated SVG/XML, can be useful if the avatars are included directly in HTML and you want to avoid ID conflicts.
**kwargs
Any
N/A
Kwargs
Attributes
emptydefault_options=default
Last updated
Was this helpful?