Skip to main content

DiceBear Core (Python)

stars license

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

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.6.0.tar.gz (49.0 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.6.0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dicebear_core-10.6.0.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dicebear_core-10.6.0.tar.gz
Algorithm Hash digest
SHA256 d0f770a57ff277c9b47a49ee943a51e8b60e093bfdbf38cb5080e01085b5b206
MD5 f47b77c0090ba5e5dbb2465be7056424
BLAKE2b-256 8978650910cdd47619a01a8448f26b2f5a7f55092c0a1505fbbec71bf21f296d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dicebear_core-10.6.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.6.0-py3-none-any.whl.

File metadata

  • Download URL: dicebear_core-10.6.0-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dicebear_core-10.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fd8bd3b21b02c5ed6ef428e2cc4295dcd31d5def7ddd7514d02cdb3e4a16bc3
MD5 4318f4d5ef9d60b6d1bacd39d97bd035
BLAKE2b-256 431ee3dad224aa77b79a5db9e2bbbab795cdd54e579e367e4f742ce55092ac4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dicebear_core-10.6.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.

Release history Release notifications | RSS feed

10.7.0

2 files

10.6.1

2 files

This release

10.6.0 This release

2 files

10.5.0

2 files

10.4.0

2 files

10.3.2

2 files

10.3.1

2 files

10.3.0

2 files

10.2.0

2 files

10.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page