Skip to main content

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 the API you can get custom avatars for your program.

How to install

Run pip install dicebear
If that doesn't work try py -m pip install dicebear

Usage

from dicebear import Avatar

options = {
    "flip": True,
    "rotate": 90
}

av = Avatar(type="avataaars", seed="John Apple", options=options) # this returns a URL to the avatar
print(av)

av.edit(options={"flip": True}) # this will edit the avatar instance 
print(av)

Options

All the possible options for the avatar.

  • seed (type: string) - the seed for the avatar generator
  • dataUri (type: boolean) - wether or not to give the dataUri
  • flip (type: boolean) - flips the image vertically
  • rotate (type: int) - rotates the avatar
  • scale (type: int) - edits the scale of the avatar
  • radius (type: int) - edits the radius of the avatar
  • size (type: int) - the size of the avatar
  • backgroundColor (type: hex 0x) - the background color of the avatar
  • translateX (type: int) - move the avatar horizontally
  • translateY (type: int) - move the avatar vertically

Styles

All the possible avatar styles.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dicebear-0.1.2.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

dicebear-0.1.2-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page