Skip to main content

Unique avatars from dozens of styles — deterministic, customizable, vector-based.

Project description

DiceBear Core (Python)

Python implementation of the DiceBear avatar library. Generates deterministic SVG avatars from style definitions and a seed string.

DiceBear is available for multiple languages. All implementations share the same PRNG and rendering pipeline, producing identical SVG output for the same seed, style, and options — regardless of the language used.

Playground | Documentation

Installation

pip install dicebear-core

Requires Python 3.10 or newer.

Usage

import json
from importlib.resources import files

from dicebear import Avatar

# From a style definition (here from the dicebear-styles package)
definition = json.loads(
    files("dicebear_styles").joinpath("lorelei.json").read_text("utf-8")
)

avatar = Avatar(definition, {"seed": "John Doe", "size": 128})

avatar.to_string()    # SVG string
avatar.to_data_uri()  # data:image/svg+xml;charset=utf-8,...

Using the Style class

from dicebear import Avatar, Style

style = Style(definition)

# Create multiple avatars from the same style
avatar1 = Avatar(style, {"seed": "Alice"})
avatar2 = Avatar(style, {"seed": "Bob"})

Sponsors

Advertisement: Many thanks to our sponsors who provide us with free or discounted products.

bunny.net

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_core-10.2.0.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dicebear_core-10.2.0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file dicebear_core-10.2.0.tar.gz.

File metadata

  • Download URL: dicebear_core-10.2.0.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dicebear_core-10.2.0.tar.gz
Algorithm Hash digest
SHA256 577e02da8b604c058cd8cf30e7e3b94db11097c3724b840fb830d280840fdd68
MD5 038f78744e3de602fd08a658bc3ee1d9
BLAKE2b-256 1ef2b9bb3f80e2e27e5937b50358acd84bd7c5e75cc9671fe2a9d06c0313d4c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dicebear_core-10.2.0.tar.gz:

Publisher: publish.yml on dicebear/dicebear

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dicebear_core-10.2.0-py3-none-any.whl.

File metadata

  • Download URL: dicebear_core-10.2.0-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dicebear_core-10.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9689ce6462bd389b3200cf12b11d56b031c40d3378e4b510352e105a45fca522
MD5 dc16bff1d5774b3af7030475c38b6cc2
BLAKE2b-256 ccce7edf06e089e885cee87950539eac3b011ab68f362556479133d26194254c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dicebear_core-10.2.0-py3-none-any.whl:

Publisher: publish.yml on dicebear/dicebear

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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