dicebear-schema 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,719 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "definitions": {
4
+ "camelCaseName": {
5
+ "description": "A camelCase identifier used for named things defined in the definition (colors, components, variants). Must start with a lowercase letter and may contain letters and digits.",
6
+ "type": "string",
7
+ "pattern": "^[a-z][a-zA-Z0-9]*$",
8
+ "maxLength": 64
9
+ },
10
+ "colorName": {
11
+ "description": "A reference to a color palette defined in the top-level `colors` section.",
12
+ "allOf": [{ "$ref": "#/definitions/camelCaseName" }]
13
+ },
14
+ "componentName": {
15
+ "description": "A reference to a component defined in the top-level `components` section.",
16
+ "allOf": [{ "$ref": "#/definitions/camelCaseName" }]
17
+ },
18
+ "translateValue": {
19
+ "description": "A translation value expressed as a percentage of the component's width (for `x`) or height (for `y`). Defines a range the PRNG picks from. Set `min === max` for a fixed value. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.",
20
+ "type": "object",
21
+ "properties": {
22
+ "min": { "type": "number", "minimum": -1000, "maximum": 1000 },
23
+ "max": { "type": "number", "minimum": -1000, "maximum": 1000 },
24
+ "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 2000 }
25
+ },
26
+ "required": ["min", "max"],
27
+ "additionalProperties": false
28
+ },
29
+ "hexColor": {
30
+ "description": "A hex color with leading `#`, in 3, 4, 6, or 8 digit form.",
31
+ "type": "string",
32
+ "pattern": "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$",
33
+ "maxLength": 9
34
+ },
35
+ "colorValue": {
36
+ "description": "A color value for `fill`, `stroke`, `stop-color`, and other color attributes. Either a plain string (any CSS color format — named color, hex, `rgb()`, `oklch()`, `color-mix()`, local paint server reference `url(#id)`, etc.) or an object referencing a named color palette defined in the top-level `colors` section. CSS color syntax is not validated; invalid colors are the browser's problem.",
37
+ "anyOf": [
38
+ { "$ref": "#/definitions/attributeString" },
39
+ {
40
+ "description": "A reference to a named color palette. At render time, the PRNG selects a color value from the referenced palette.",
41
+ "type": "object",
42
+ "properties": {
43
+ "type": { "const": "color" },
44
+ "name": {
45
+ "description": "The name of the color palette to reference.",
46
+ "$ref": "#/definitions/colorName"
47
+ }
48
+ },
49
+ "required": ["type", "name"],
50
+ "additionalProperties": false
51
+ }
52
+ ]
53
+ },
54
+ "safeUrl": {
55
+ "description": "A URL restricted to HTTP and HTTPS protocols.",
56
+ "type": "string",
57
+ "pattern": "^https?://",
58
+ "maxLength": 2048
59
+ },
60
+ "filteredString": {
61
+ "description": "Base definition for the filtered-string family (`attributeString`, `cssString`). Blocks a shared set of known-dangerous patterns: external `url(...)` references (local `url(#id)` is allowed), `expression()`, `behavior:`, `-moz-binding`, `javascript:` / `vbscript:` URI schemes, and backslash escape sequences. This is not a general CSS sanitizer — it is a defense-in-depth injection filter, so substring matches of blocked tokens will reject otherwise-harmless strings (e.g. a plain text containing the literal word `javascript:`). The `maxLength` here acts as an absolute ceiling for all derivatives; callers narrow it further.",
62
+ "type": "string",
63
+ "maxLength": 16384,
64
+ "not": {
65
+ "type": "string",
66
+ "anyOf": [
67
+ { "type": "string", "pattern": "[uU][rR][lL]\\s*\\(\\s*[^#)\\s]" },
68
+ {
69
+ "type": "string",
70
+ "pattern": "[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN]\\s*\\("
71
+ },
72
+ {
73
+ "type": "string",
74
+ "pattern": "[bB][eE][hH][aA][vV][iI][oO][rR]\\s*:"
75
+ },
76
+ {
77
+ "type": "string",
78
+ "pattern": "-[mM][oO][zZ]-[bB][iI][nN][dD][iI][nN][gG]"
79
+ },
80
+ {
81
+ "type": "string",
82
+ "pattern": "[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]\\s*:"
83
+ },
84
+ {
85
+ "type": "string",
86
+ "pattern": "[vV][bB][sS][cC][rR][iI][pP][tT]\\s*:"
87
+ },
88
+ { "type": "string", "pattern": "\\\\" }
89
+ ]
90
+ }
91
+ },
92
+ "attributeString": {
93
+ "description": "The default value type for generic SVG attribute values — transform lists, numeric values, keywords, and so on. No syntactic validation; only the common `filteredString` injection filter applies.",
94
+ "type": "string",
95
+ "allOf": [{ "$ref": "#/definitions/filteredString" }],
96
+ "maxLength": 1024
97
+ },
98
+ "pathDataString": {
99
+ "description": "Used for the `d` attribute of `<path>`. Same filter as `attributeString`, but with a much larger length budget to accommodate complex path geometry.",
100
+ "type": "string",
101
+ "allOf": [{ "$ref": "#/definitions/filteredString" }],
102
+ "maxLength": 16384
103
+ },
104
+ "cssString": {
105
+ "description": "Used for inline `style` attribute content and `<style>` element bodies. Known-dangerous `@`-rules — `@import`, `@font-face`, `@document`, `@charset` — are rejected in addition to the common `filteredString` injection filter. Other `@`-rules (`@media`, `@keyframes`, `@supports`, `@layer`, etc.) are permitted, but the `filteredString` injection filter still applies to their contents — so external `url(...)` references inside e.g. an `@media` rule are still blocked. This is not a general CSS sanitizer.",
106
+ "type": "string",
107
+ "allOf": [{ "$ref": "#/definitions/filteredString" }],
108
+ "maxLength": 4096,
109
+ "not": {
110
+ "type": "string",
111
+ "anyOf": [
112
+ { "type": "string", "pattern": "@[iI][mM][pP][oO][rR][tT]" },
113
+ {
114
+ "type": "string",
115
+ "pattern": "@[fF][oO][nN][tT]-[fF][aA][cC][eE]"
116
+ },
117
+ {
118
+ "type": "string",
119
+ "pattern": "@[dD][oO][cC][uU][mM][eE][nN][tT]"
120
+ },
121
+ { "type": "string", "pattern": "@[cC][hH][aA][rR][sS][eE][tT]" }
122
+ ]
123
+ }
124
+ },
125
+ "element": {
126
+ "description": "An SVG node. One of four mutually exclusive forms, discriminated by `type` (and `name` for the `<style>` special case): a text element, a component reference, a `<style>` element, or any other SVG element.",
127
+ "anyOf": [
128
+ { "$ref": "#/definitions/textElement" },
129
+ { "$ref": "#/definitions/componentReference" },
130
+ { "$ref": "#/definitions/styleElement" },
131
+ { "$ref": "#/definitions/genericElement" }
132
+ ]
133
+ },
134
+ "textElement": {
135
+ "description": "A raw text node. Its `value` becomes the text content rendered into the parent element.",
136
+ "type": "object",
137
+ "properties": {
138
+ "type": { "const": "text" },
139
+ "value": {
140
+ "description": "Either a plain string, or a `variable` reference resolved at render time to the seed's initials.",
141
+ "anyOf": [
142
+ { "type": "string", "maxLength": 4096 },
143
+ {
144
+ "type": "object",
145
+ "properties": {
146
+ "type": { "const": "variable" },
147
+ "name": { "enum": ["initial", "initials"] }
148
+ },
149
+ "required": ["type", "name"],
150
+ "additionalProperties": false
151
+ }
152
+ ]
153
+ }
154
+ },
155
+ "required": ["type", "value"],
156
+ "additionalProperties": false
157
+ },
158
+ "componentReference": {
159
+ "description": "A reference to a named component defined in the top-level `components` section. At render time, the PRNG selects one of the component's variants. Optional `attributes` are applied to the generated `<use>` tag — most commonly a `transform` placing the instance, but any allowlisted attribute is accepted.",
160
+ "type": "object",
161
+ "properties": {
162
+ "type": { "const": "component" },
163
+ "name": { "$ref": "#/definitions/componentName" },
164
+ "attributes": { "$ref": "#/definitions/attributes" }
165
+ },
166
+ "required": ["type", "name"],
167
+ "additionalProperties": false
168
+ },
169
+ "styleElement": {
170
+ "description": "An SVG `<style>` element. Its CSS content must be provided as `text` children; each child's value is validated as a CSS string with a stricter content policy than generic SVG attribute values.",
171
+ "type": "object",
172
+ "properties": {
173
+ "type": { "const": "element" },
174
+ "name": { "const": "style" },
175
+ "attributes": { "$ref": "#/definitions/attributes" },
176
+ "children": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "object",
180
+ "properties": {
181
+ "type": { "const": "text" },
182
+ "value": { "$ref": "#/definitions/cssString" }
183
+ },
184
+ "required": ["type", "value"],
185
+ "additionalProperties": false
186
+ },
187
+ "maxItems": 64
188
+ }
189
+ },
190
+ "required": ["type", "name"],
191
+ "additionalProperties": false
192
+ },
193
+ "genericElement": {
194
+ "description": "Any SVG element other than `<style>`, which has its own stricter content policy.",
195
+ "type": "object",
196
+ "properties": {
197
+ "type": { "const": "element" },
198
+ "name": {
199
+ "description": "The SVG tag name. Only a safe subset of SVG elements is permitted; dangerous elements such as `script`, `foreignObject`, or `a` are excluded.",
200
+ "enum": [
201
+ "circle",
202
+ "clipPath",
203
+ "defs",
204
+ "desc",
205
+ "ellipse",
206
+ "feBlend",
207
+ "feColorMatrix",
208
+ "feComponentTransfer",
209
+ "feComposite",
210
+ "feConvolveMatrix",
211
+ "feDiffuseLighting",
212
+ "feDisplacementMap",
213
+ "feDistantLight",
214
+ "feDropShadow",
215
+ "feFlood",
216
+ "feFuncA",
217
+ "feFuncB",
218
+ "feFuncG",
219
+ "feFuncR",
220
+ "feGaussianBlur",
221
+ "feImage",
222
+ "feMerge",
223
+ "feMergeNode",
224
+ "feMorphology",
225
+ "feOffset",
226
+ "fePointLight",
227
+ "feSpecularLighting",
228
+ "feSpotLight",
229
+ "feTile",
230
+ "feTurbulence",
231
+ "filter",
232
+ "g",
233
+ "image",
234
+ "line",
235
+ "linearGradient",
236
+ "marker",
237
+ "mask",
238
+ "metadata",
239
+ "mpath",
240
+ "path",
241
+ "pattern",
242
+ "polygon",
243
+ "polyline",
244
+ "radialGradient",
245
+ "rect",
246
+ "stop",
247
+ "svg",
248
+ "switch",
249
+ "symbol",
250
+ "text",
251
+ "textPath",
252
+ "title",
253
+ "tspan",
254
+ "use",
255
+ "view"
256
+ ]
257
+ },
258
+ "attributes": { "$ref": "#/definitions/attributes" },
259
+ "children": {
260
+ "type": "array",
261
+ "items": { "$ref": "#/definitions/element" },
262
+ "maxItems": 1024
263
+ }
264
+ },
265
+ "required": ["type", "name"],
266
+ "additionalProperties": false
267
+ },
268
+ "attributes": {
269
+ "description": "A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.",
270
+ "type": "object",
271
+ "properties": {
272
+ "alignment-baseline": { "$ref": "#/definitions/attributeString" },
273
+ "amplitude": { "$ref": "#/definitions/attributeString" },
274
+ "azimuth": { "$ref": "#/definitions/attributeString" },
275
+ "baseFrequency": { "$ref": "#/definitions/attributeString" },
276
+ "baseline-shift": { "$ref": "#/definitions/attributeString" },
277
+ "bias": { "$ref": "#/definitions/attributeString" },
278
+ "class": { "$ref": "#/definitions/attributeString" },
279
+ "clipPathUnits": { "$ref": "#/definitions/attributeString" },
280
+ "clip-path": { "$ref": "#/definitions/attributeString" },
281
+ "clip-rule": { "$ref": "#/definitions/attributeString" },
282
+ "color": {
283
+ "$ref": "#/definitions/colorValue"
284
+ },
285
+ "color-interpolation": { "$ref": "#/definitions/attributeString" },
286
+ "color-interpolation-filters": {
287
+ "$ref": "#/definitions/attributeString"
288
+ },
289
+ "crossorigin": { "$ref": "#/definitions/attributeString" },
290
+ "cx": { "$ref": "#/definitions/attributeString" },
291
+ "cy": { "$ref": "#/definitions/attributeString" },
292
+ "d": { "$ref": "#/definitions/pathDataString" },
293
+ "decoding": { "$ref": "#/definitions/attributeString" },
294
+ "diffuseConstant": { "$ref": "#/definitions/attributeString" },
295
+ "direction": { "$ref": "#/definitions/attributeString" },
296
+ "display": { "$ref": "#/definitions/attributeString" },
297
+ "divisor": { "$ref": "#/definitions/attributeString" },
298
+ "dominant-baseline": { "$ref": "#/definitions/attributeString" },
299
+ "dx": { "$ref": "#/definitions/attributeString" },
300
+ "dy": { "$ref": "#/definitions/attributeString" },
301
+ "edgeMode": { "$ref": "#/definitions/attributeString" },
302
+ "elevation": { "$ref": "#/definitions/attributeString" },
303
+ "exponent": { "$ref": "#/definitions/attributeString" },
304
+ "fill": { "$ref": "#/definitions/colorValue" },
305
+ "fill-opacity": { "$ref": "#/definitions/attributeString" },
306
+ "fill-rule": { "$ref": "#/definitions/attributeString" },
307
+ "filter": { "$ref": "#/definitions/attributeString" },
308
+ "filterUnits": { "$ref": "#/definitions/attributeString" },
309
+ "flood-color": {
310
+ "$ref": "#/definitions/colorValue"
311
+ },
312
+ "flood-opacity": { "$ref": "#/definitions/attributeString" },
313
+ "font-family": {
314
+ "anyOf": [
315
+ { "$ref": "#/definitions/attributeString" },
316
+ {
317
+ "type": "object",
318
+ "properties": {
319
+ "type": { "const": "variable" },
320
+ "name": { "const": "fontFamily" }
321
+ },
322
+ "required": ["type", "name"],
323
+ "additionalProperties": false
324
+ }
325
+ ]
326
+ },
327
+ "font-size": { "$ref": "#/definitions/attributeString" },
328
+ "font-size-adjust": { "$ref": "#/definitions/attributeString" },
329
+ "font-style": { "$ref": "#/definitions/attributeString" },
330
+ "font-variant": { "$ref": "#/definitions/attributeString" },
331
+ "font-weight": {
332
+ "anyOf": [
333
+ { "$ref": "#/definitions/attributeString" },
334
+ {
335
+ "type": "object",
336
+ "properties": {
337
+ "type": { "const": "variable" },
338
+ "name": { "const": "fontWeight" }
339
+ },
340
+ "required": ["type", "name"],
341
+ "additionalProperties": false
342
+ }
343
+ ]
344
+ },
345
+ "fx": { "$ref": "#/definitions/attributeString" },
346
+ "fy": { "$ref": "#/definitions/attributeString" },
347
+ "gradientTransform": { "$ref": "#/definitions/attributeString" },
348
+ "gradientUnits": { "$ref": "#/definitions/attributeString" },
349
+ "height": { "$ref": "#/definitions/attributeString" },
350
+ "href": {
351
+ "anyOf": [
352
+ {
353
+ "type": "string",
354
+ "pattern": "^#[a-zA-Z_][a-zA-Z0-9_.-]*$",
355
+ "maxLength": 128
356
+ },
357
+ {
358
+ "type": "string",
359
+ "pattern": "^data:image/(png|gif|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$",
360
+ "maxLength": 262144
361
+ }
362
+ ]
363
+ },
364
+ "id": { "$ref": "#/definitions/attributeString" },
365
+ "image-rendering": { "$ref": "#/definitions/attributeString" },
366
+ "in": { "$ref": "#/definitions/attributeString" },
367
+ "in2": { "$ref": "#/definitions/attributeString" },
368
+ "intercept": { "$ref": "#/definitions/attributeString" },
369
+ "k1": { "$ref": "#/definitions/attributeString" },
370
+ "k2": { "$ref": "#/definitions/attributeString" },
371
+ "k3": { "$ref": "#/definitions/attributeString" },
372
+ "k4": { "$ref": "#/definitions/attributeString" },
373
+ "kernelMatrix": { "$ref": "#/definitions/attributeString" },
374
+ "kernelUnitLength": { "$ref": "#/definitions/attributeString" },
375
+ "lang": { "$ref": "#/definitions/attributeString" },
376
+ "lengthAdjust": { "$ref": "#/definitions/attributeString" },
377
+ "letter-spacing": { "$ref": "#/definitions/attributeString" },
378
+ "lighting-color": {
379
+ "$ref": "#/definitions/colorValue"
380
+ },
381
+ "marker-end": { "$ref": "#/definitions/attributeString" },
382
+ "marker-mid": { "$ref": "#/definitions/attributeString" },
383
+ "marker-start": { "$ref": "#/definitions/attributeString" },
384
+ "markerHeight": { "$ref": "#/definitions/attributeString" },
385
+ "markerUnits": { "$ref": "#/definitions/attributeString" },
386
+ "markerWidth": { "$ref": "#/definitions/attributeString" },
387
+ "mask": { "$ref": "#/definitions/attributeString" },
388
+ "maskContentUnits": { "$ref": "#/definitions/attributeString" },
389
+ "maskUnits": { "$ref": "#/definitions/attributeString" },
390
+ "media": { "$ref": "#/definitions/attributeString" },
391
+ "method": { "$ref": "#/definitions/attributeString" },
392
+ "mode": { "$ref": "#/definitions/attributeString" },
393
+ "numOctaves": { "$ref": "#/definitions/attributeString" },
394
+ "offset": { "$ref": "#/definitions/attributeString" },
395
+ "opacity": { "$ref": "#/definitions/attributeString" },
396
+ "operator": { "$ref": "#/definitions/attributeString" },
397
+ "order": { "$ref": "#/definitions/attributeString" },
398
+ "orient": { "$ref": "#/definitions/attributeString" },
399
+ "overflow": { "$ref": "#/definitions/attributeString" },
400
+ "paint-order": { "$ref": "#/definitions/attributeString" },
401
+ "path": { "$ref": "#/definitions/attributeString" },
402
+ "pathLength": { "$ref": "#/definitions/attributeString" },
403
+ "patternContentUnits": { "$ref": "#/definitions/attributeString" },
404
+ "patternTransform": { "$ref": "#/definitions/attributeString" },
405
+ "patternUnits": { "$ref": "#/definitions/attributeString" },
406
+ "points": { "$ref": "#/definitions/attributeString" },
407
+ "preserveAlpha": { "$ref": "#/definitions/attributeString" },
408
+ "preserveAspectRatio": { "$ref": "#/definitions/attributeString" },
409
+ "primitiveUnits": { "$ref": "#/definitions/attributeString" },
410
+ "r": { "$ref": "#/definitions/attributeString" },
411
+ "radius": { "$ref": "#/definitions/attributeString" },
412
+ "refX": { "$ref": "#/definitions/attributeString" },
413
+ "refY": { "$ref": "#/definitions/attributeString" },
414
+ "result": { "$ref": "#/definitions/attributeString" },
415
+ "rx": { "$ref": "#/definitions/attributeString" },
416
+ "ry": { "$ref": "#/definitions/attributeString" },
417
+ "scale": { "$ref": "#/definitions/attributeString" },
418
+ "seed": { "$ref": "#/definitions/attributeString" },
419
+ "shape-rendering": { "$ref": "#/definitions/attributeString" },
420
+ "slope": { "$ref": "#/definitions/attributeString" },
421
+ "specularConstant": { "$ref": "#/definitions/attributeString" },
422
+ "specularExponent": { "$ref": "#/definitions/attributeString" },
423
+ "spreadMethod": { "$ref": "#/definitions/attributeString" },
424
+ "startOffset": { "$ref": "#/definitions/attributeString" },
425
+ "stdDeviation": { "$ref": "#/definitions/attributeString" },
426
+ "stitchTiles": { "$ref": "#/definitions/attributeString" },
427
+ "stop-color": {
428
+ "$ref": "#/definitions/colorValue"
429
+ },
430
+ "stop-opacity": { "$ref": "#/definitions/attributeString" },
431
+ "stroke": { "$ref": "#/definitions/colorValue" },
432
+ "stroke-dasharray": { "$ref": "#/definitions/attributeString" },
433
+ "stroke-dashoffset": { "$ref": "#/definitions/attributeString" },
434
+ "stroke-linecap": { "$ref": "#/definitions/attributeString" },
435
+ "stroke-linejoin": { "$ref": "#/definitions/attributeString" },
436
+ "stroke-miterlimit": { "$ref": "#/definitions/attributeString" },
437
+ "stroke-opacity": { "$ref": "#/definitions/attributeString" },
438
+ "stroke-width": { "$ref": "#/definitions/attributeString" },
439
+ "style": { "$ref": "#/definitions/cssString" },
440
+ "surfaceScale": { "$ref": "#/definitions/attributeString" },
441
+ "systemLanguage": { "$ref": "#/definitions/attributeString" },
442
+ "tabindex": { "$ref": "#/definitions/attributeString" },
443
+ "tableValues": { "$ref": "#/definitions/attributeString" },
444
+ "targetX": { "$ref": "#/definitions/attributeString" },
445
+ "targetY": { "$ref": "#/definitions/attributeString" },
446
+ "text-anchor": { "$ref": "#/definitions/attributeString" },
447
+ "text-decoration": { "$ref": "#/definitions/attributeString" },
448
+ "text-rendering": { "$ref": "#/definitions/attributeString" },
449
+ "textLength": { "$ref": "#/definitions/attributeString" },
450
+ "transform": { "$ref": "#/definitions/attributeString" },
451
+ "transform-origin": { "$ref": "#/definitions/attributeString" },
452
+ "type": { "$ref": "#/definitions/attributeString" },
453
+ "values": { "$ref": "#/definitions/attributeString" },
454
+ "viewBox": { "$ref": "#/definitions/attributeString" },
455
+ "visibility": { "$ref": "#/definitions/attributeString" },
456
+ "width": { "$ref": "#/definitions/attributeString" },
457
+ "word-spacing": { "$ref": "#/definitions/attributeString" },
458
+ "writing-mode": { "$ref": "#/definitions/attributeString" },
459
+ "x": { "$ref": "#/definitions/attributeString" },
460
+ "x1": { "$ref": "#/definitions/attributeString" },
461
+ "x2": { "$ref": "#/definitions/attributeString" },
462
+ "xChannelSelector": { "$ref": "#/definitions/attributeString" },
463
+ "y": { "$ref": "#/definitions/attributeString" },
464
+ "y1": { "$ref": "#/definitions/attributeString" },
465
+ "y2": { "$ref": "#/definitions/attributeString" },
466
+ "yChannelSelector": { "$ref": "#/definitions/attributeString" },
467
+ "z": { "$ref": "#/definitions/attributeString" }
468
+ },
469
+ "additionalProperties": false
470
+ },
471
+ "componentProbability": {
472
+ "description": "The probability, expressed as a percentage, that this component is rendered at all.",
473
+ "type": "number",
474
+ "minimum": 0,
475
+ "maximum": 100
476
+ },
477
+ "componentRotate": {
478
+ "description": "A rotation in degrees. Defines a range the PRNG picks from. Set `min === max` for a fixed angle. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.",
479
+ "type": "object",
480
+ "properties": {
481
+ "min": { "type": "number", "minimum": -360, "maximum": 360 },
482
+ "max": { "type": "number", "minimum": -360, "maximum": 360 },
483
+ "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 720 }
484
+ },
485
+ "required": ["min", "max"],
486
+ "additionalProperties": false
487
+ },
488
+ "componentScale": {
489
+ "description": "A scale factor around the component's own center (`1` corresponds to the original size). Defines a range the PRNG picks from. Set `min === max` for a fixed scale. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.",
490
+ "type": "object",
491
+ "properties": {
492
+ "min": { "type": "number", "minimum": 0, "maximum": 10 },
493
+ "max": { "type": "number", "minimum": 0, "maximum": 10 },
494
+ "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 10 }
495
+ },
496
+ "required": ["min", "max"],
497
+ "additionalProperties": false
498
+ },
499
+ "componentTranslate": {
500
+ "description": "A positional translation applied to the component after placement. Values are interpreted as a percentage of the component's size.",
501
+ "type": "object",
502
+ "properties": {
503
+ "x": { "$ref": "#/definitions/translateValue" },
504
+ "y": { "$ref": "#/definitions/translateValue" }
505
+ },
506
+ "additionalProperties": false
507
+ },
508
+ "componentBase": {
509
+ "description": "A base component definition with its own dimensions and variants. The PRNG selects one variant per render based on the seed.",
510
+ "type": "object",
511
+ "properties": {
512
+ "width": {
513
+ "description": "The natural width of the component canvas in pixels.",
514
+ "type": "number",
515
+ "minimum": 1,
516
+ "maximum": 1000000
517
+ },
518
+ "height": {
519
+ "description": "The natural height of the component canvas in pixels.",
520
+ "type": "number",
521
+ "minimum": 1,
522
+ "maximum": 1000000
523
+ },
524
+ "probability": { "$ref": "#/definitions/componentProbability" },
525
+ "rotate": { "$ref": "#/definitions/componentRotate" },
526
+ "scale": { "$ref": "#/definitions/componentScale" },
527
+ "translate": { "$ref": "#/definitions/componentTranslate" },
528
+ "variants": {
529
+ "description": "The available visual variants of this component. The PRNG selects one variant per render. Keys must be `camelCaseName` identifiers.",
530
+ "type": "object",
531
+ "propertyNames": { "$ref": "#/definitions/camelCaseName" },
532
+ "additionalProperties": {
533
+ "type": "object",
534
+ "properties": {
535
+ "elements": {
536
+ "description": "The SVG elements that make up this variant.",
537
+ "type": "array",
538
+ "items": { "$ref": "#/definitions/element" },
539
+ "maxItems": 1024
540
+ },
541
+ "weight": {
542
+ "description": "A weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected unless all available variants have a weight of 0.",
543
+ "type": "number",
544
+ "minimum": 0,
545
+ "maximum": 1000000
546
+ }
547
+ },
548
+ "required": ["elements"],
549
+ "additionalProperties": false
550
+ },
551
+ "maxProperties": 512
552
+ }
553
+ },
554
+ "required": ["width", "height", "variants"],
555
+ "additionalProperties": false
556
+ },
557
+ "componentAlias": {
558
+ "description": "An alias that inherits its dimensions, variants, and transforms from another component referenced by `extends`. Aliases have no per-instance overrides — they are pure references.",
559
+ "type": "object",
560
+ "properties": {
561
+ "extends": {
562
+ "description": "The name of an existing, non-alias component in this `components` map.",
563
+ "$ref": "#/definitions/componentName"
564
+ }
565
+ },
566
+ "required": ["extends"],
567
+ "additionalProperties": false
568
+ }
569
+ },
570
+ "type": "object",
571
+ "properties": {
572
+ "$id": {
573
+ "type": "string",
574
+ "maxLength": 256
575
+ },
576
+ "$schema": {
577
+ "type": "string",
578
+ "maxLength": 256
579
+ },
580
+ "$comment": {
581
+ "type": "string",
582
+ "maxLength": 4096
583
+ },
584
+ "meta": {
585
+ "description": "Metadata about the avatar style, such as license information, creator details, and source references.",
586
+ "type": "object",
587
+ "properties": {
588
+ "license": {
589
+ "description": "License information for the avatar style.",
590
+ "type": "object",
591
+ "properties": {
592
+ "name": {
593
+ "description": "The name of the license, e.g. `CC BY 4.0`.",
594
+ "type": "string",
595
+ "maxLength": 128
596
+ },
597
+ "url": {
598
+ "description": "A link to the full license text.",
599
+ "$ref": "#/definitions/safeUrl"
600
+ },
601
+ "text": {
602
+ "description": "The full license text.",
603
+ "type": "string",
604
+ "maxLength": 32768
605
+ }
606
+ },
607
+ "additionalProperties": false
608
+ },
609
+ "creator": {
610
+ "description": "Information about the creator of the avatar style.",
611
+ "type": "object",
612
+ "properties": {
613
+ "name": {
614
+ "description": "The name of the creator.",
615
+ "type": "string",
616
+ "maxLength": 128
617
+ },
618
+ "url": {
619
+ "description": "A link to the creator's website or profile.",
620
+ "$ref": "#/definitions/safeUrl"
621
+ }
622
+ },
623
+ "additionalProperties": false
624
+ },
625
+ "source": {
626
+ "description": "Information about the original source of the artwork.",
627
+ "type": "object",
628
+ "properties": {
629
+ "name": {
630
+ "description": "The name of the original source.",
631
+ "type": "string",
632
+ "maxLength": 128
633
+ },
634
+ "url": {
635
+ "description": "A link to the original source.",
636
+ "$ref": "#/definitions/safeUrl"
637
+ }
638
+ },
639
+ "additionalProperties": false
640
+ }
641
+ },
642
+ "additionalProperties": false
643
+ },
644
+ "attributes": {
645
+ "description": "Global SVG presentation attributes applied to the root `<svg>` element.",
646
+ "$ref": "#/definitions/attributes"
647
+ },
648
+ "canvas": {
649
+ "description": "The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.",
650
+ "type": "object",
651
+ "properties": {
652
+ "elements": {
653
+ "description": "The list of SVG elements that make up the avatar.",
654
+ "type": "array",
655
+ "items": { "$ref": "#/definitions/element" },
656
+ "maxItems": 1024
657
+ },
658
+ "width": {
659
+ "description": "The natural width of the avatar canvas in pixels.",
660
+ "type": "number",
661
+ "minimum": 1,
662
+ "maximum": 1000000
663
+ },
664
+ "height": {
665
+ "description": "The natural height of the avatar canvas in pixels.",
666
+ "type": "number",
667
+ "minimum": 1,
668
+ "maximum": 1000000
669
+ }
670
+ },
671
+ "required": ["elements", "width", "height"],
672
+ "additionalProperties": false
673
+ },
674
+ "components": {
675
+ "description": "Named, reusable SVG components. Each component defines a set of variants that the PRNG can select from at render time, or aliases another component to render an additional, independently-randomized instance of it. Keys must be `camelCaseName` identifiers.",
676
+ "type": "object",
677
+ "propertyNames": { "$ref": "#/definitions/camelCaseName" },
678
+ "additionalProperties": {
679
+ "anyOf": [
680
+ { "$ref": "#/definitions/componentBase" },
681
+ { "$ref": "#/definitions/componentAlias" }
682
+ ]
683
+ },
684
+ "maxProperties": 512
685
+ },
686
+ "colors": {
687
+ "description": "Named color palettes used by the avatar. The PRNG selects colors from these groups at render time. Color groups can define constraints such as contrast or exclusion rules. Keys must be `camelCaseName` identifiers.",
688
+ "type": "object",
689
+ "propertyNames": { "$ref": "#/definitions/camelCaseName" },
690
+ "additionalProperties": {
691
+ "type": "object",
692
+ "properties": {
693
+ "values": {
694
+ "description": "The list of hex color values the PRNG can choose from.",
695
+ "type": "array",
696
+ "items": { "$ref": "#/definitions/hexColor" },
697
+ "minItems": 1,
698
+ "maxItems": 128
699
+ },
700
+ "notEqualTo": {
701
+ "description": "A list of other color names. The selected color value must differ from the color values selected in those colors. The schema does not prevent cycles (e.g. `a` notEqualTo `b` and `b` notEqualTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.",
702
+ "type": "array",
703
+ "items": { "$ref": "#/definitions/colorName" },
704
+ "maxItems": 64
705
+ },
706
+ "contrastTo": {
707
+ "description": "The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen. The schema does not prevent cycles (e.g. `a` contrastTo `b` and `b` contrastTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.",
708
+ "$ref": "#/definitions/colorName"
709
+ }
710
+ },
711
+ "required": ["values"],
712
+ "additionalProperties": false
713
+ },
714
+ "maxProperties": 512
715
+ }
716
+ },
717
+ "required": ["canvas"],
718
+ "additionalProperties": false
719
+ }
@@ -0,0 +1,282 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "DiceBear options schema",
4
+ "type": "object",
5
+ "definitions": {
6
+ "flip": {
7
+ "type": "string",
8
+ "enum": ["none", "horizontal", "vertical", "both"]
9
+ },
10
+ "rotate": {
11
+ "type": "number",
12
+ "minimum": -360,
13
+ "maximum": 360
14
+ },
15
+ "scale": {
16
+ "type": "number",
17
+ "minimum": 0,
18
+ "maximum": 10
19
+ },
20
+ "translate": {
21
+ "type": "number",
22
+ "minimum": -1000,
23
+ "maximum": 1000
24
+ },
25
+ "borderRadius": {
26
+ "type": "number",
27
+ "minimum": 0,
28
+ "maximum": 50
29
+ },
30
+ "color": {
31
+ "type": "string",
32
+ "pattern": "^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"
33
+ },
34
+ "colorFill": {
35
+ "type": "string",
36
+ "enum": ["solid", "linear", "radial"]
37
+ },
38
+ "colorFillStops": {
39
+ "type": "integer",
40
+ "minimum": 2
41
+ },
42
+ "fontFamilyName": {
43
+ "type": "string",
44
+ "pattern": "^[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*(, ?[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*)*$",
45
+ "maxLength": 256
46
+ },
47
+ "fontWeight": {
48
+ "type": "integer",
49
+ "minimum": 1,
50
+ "maximum": 1000
51
+ },
52
+ "variantName": {
53
+ "type": "string",
54
+ "pattern": "^[a-z][a-zA-Z0-9]*$",
55
+ "maxLength": 64
56
+ },
57
+ "rotateOption": {
58
+ "anyOf": [
59
+ { "$ref": "#/definitions/rotate" },
60
+ {
61
+ "type": "array",
62
+ "items": { "$ref": "#/definitions/rotate" },
63
+ "minItems": 0,
64
+ "maxItems": 2
65
+ }
66
+ ]
67
+ },
68
+ "translateOption": {
69
+ "anyOf": [
70
+ { "$ref": "#/definitions/translate" },
71
+ {
72
+ "type": "array",
73
+ "items": { "$ref": "#/definitions/translate" },
74
+ "minItems": 0,
75
+ "maxItems": 2
76
+ }
77
+ ]
78
+ },
79
+ "scaleOption": {
80
+ "anyOf": [
81
+ { "$ref": "#/definitions/scale" },
82
+ {
83
+ "type": "array",
84
+ "items": { "$ref": "#/definitions/scale" },
85
+ "minItems": 0,
86
+ "maxItems": 2
87
+ }
88
+ ]
89
+ }
90
+ },
91
+ "properties": {
92
+ "seed": {
93
+ "type": "string",
94
+ "description": "The starting value for the pseudorandom number generator (PRNG) used in the avatar generation process. This option is essential for creating unique and consistent avatars. By setting a specific seed, you ensure that the same sequence of random characteristics is applied, allowing identical avatars to be reproduced. This is especially valuable for maintaining consistency across sessions and allowing users to share or recreate their personalized avatars.",
95
+ "maxLength": 1024
96
+ },
97
+ "size": {
98
+ "type": "integer",
99
+ "description": "Specifies the dimensions of the avatar in pixels. If no size is specified, the avatar defaults to a responsive design or scales to 100% of its container. This flexibility allows the avatar to seamlessly adapt to different screen sizes and layouts, ensuring optimal display across devices and environments.",
100
+ "minimum": 1,
101
+ "maximum": 4096
102
+ },
103
+ "idRandomization": {
104
+ "type": "boolean",
105
+ "description": "Generates random values for all IDs present in the SVG. This process ensures that while the avatar appears visually identical, the underlying code remains unique. This is particularly useful for embedding the same avatar multiple times in a document without running into duplicate ID conflicts that can interfere with styles and scripts."
106
+ },
107
+ "title": {
108
+ "type": "string",
109
+ "description": "Specifies an accessible title for the avatar. When set, the SVG will include a <title> element and an aria-label attribute, allowing screen readers and other assistive technologies to describe the avatar to users.",
110
+ "maxLength": 256
111
+ },
112
+ "flip": {
113
+ "description": "Specifies how the avatar will be flipped. Options include `none` for no flip, `horizontal` for a left-to-right flip, `vertical` for an upside-down flip, and `both` for a complete flip. If specified as an array, the PRNG will choose from the available options.",
114
+ "anyOf": [
115
+ {
116
+ "$ref": "#/definitions/flip"
117
+ },
118
+ {
119
+ "type": "array",
120
+ "items": {
121
+ "$ref": "#/definitions/flip"
122
+ },
123
+ "minItems": 0,
124
+ "maxItems": 4
125
+ }
126
+ ]
127
+ },
128
+ "fontFamily": {
129
+ "description": "Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.",
130
+ "anyOf": [
131
+ {
132
+ "$ref": "#/definitions/fontFamilyName"
133
+ },
134
+ {
135
+ "type": "array",
136
+ "items": {
137
+ "$ref": "#/definitions/fontFamilyName"
138
+ },
139
+ "minItems": 0,
140
+ "maxItems": 128
141
+ }
142
+ ]
143
+ },
144
+ "fontWeight": {
145
+ "description": "Specifies the font weight used for text rendering. The value must be an integer between 1 and 1000. If specified as an array, the PRNG will choose from the available options.",
146
+ "anyOf": [
147
+ {
148
+ "$ref": "#/definitions/fontWeight"
149
+ },
150
+ {
151
+ "type": "array",
152
+ "items": {
153
+ "$ref": "#/definitions/fontWeight"
154
+ },
155
+ "minItems": 0,
156
+ "maxItems": 128
157
+ }
158
+ ]
159
+ },
160
+ "scale": {
161
+ "description": "Sets the scaling of the avatar. A value of `1` corresponds to the original size of the avatar. This setting affects the size of the avatar itself, but not the size of the avatar container; any excess content will be clipped. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
162
+ "allOf": [{ "$ref": "#/definitions/scaleOption" }]
163
+ },
164
+ "borderRadius": {
165
+ "description": "This is the radius of the corners of the avatar. This value can be a float or an integer. A value of 0 means that the avatar has sharp corners, while larger values result in more rounded corners. The maximum value is 50, which turns the avatar into a complete circle. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
166
+ "anyOf": [
167
+ {
168
+ "$ref": "#/definitions/borderRadius"
169
+ },
170
+ {
171
+ "type": "array",
172
+ "items": {
173
+ "$ref": "#/definitions/borderRadius"
174
+ },
175
+ "minItems": 0,
176
+ "maxItems": 2
177
+ }
178
+ ]
179
+ }
180
+ },
181
+ "patternProperties": {
182
+ "^[a-z][a-zA-Z0-9]*Probability$": {
183
+ "type": "number",
184
+ "description": "Represents the probability that a component of the avatar will be displayed. The value can be either a float or an integer, but is interpreted as a percentage. For example, a value of 0 means the part will never be displayed, while a value of 100 means it will always be displayed.",
185
+ "minimum": 0,
186
+ "maximum": 100
187
+ },
188
+ "^[a-z][a-zA-Z0-9]*Variant$": {
189
+ "description": "Specifies which variants of the avatar part can be selected by the PRNG and their relative weights. A string or array of strings filters which variants the PRNG can choose from. An object maps variant names to non-negative weights, simultaneously filtering and weighting selection. Variant names must be camelCase identifiers.",
190
+ "anyOf": [
191
+ {
192
+ "$ref": "#/definitions/variantName"
193
+ },
194
+ {
195
+ "type": "array",
196
+ "items": {
197
+ "$ref": "#/definitions/variantName"
198
+ },
199
+ "minItems": 0,
200
+ "maxItems": 128
201
+ },
202
+ {
203
+ "type": "object",
204
+ "propertyNames": { "$ref": "#/definitions/variantName" },
205
+ "additionalProperties": {
206
+ "type": "number",
207
+ "minimum": 0
208
+ },
209
+ "minProperties": 1,
210
+ "maxProperties": 512
211
+ }
212
+ ]
213
+ },
214
+ "^[a-z][a-zA-Z0-9]*Color$": {
215
+ "description": "Specifies which colors for the avatar component can be selected by the PRNG. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options. The color must be specified as a hex value.",
216
+ "anyOf": [
217
+ {
218
+ "$ref": "#/definitions/color"
219
+ },
220
+ {
221
+ "type": "array",
222
+ "items": {
223
+ "$ref": "#/definitions/color"
224
+ },
225
+ "minItems": 0,
226
+ "maxItems": 128
227
+ }
228
+ ]
229
+ },
230
+ "^[a-z][a-zA-Z0-9]*ColorFill$": {
231
+ "description": "Specifies the color fill method for the avatar component. Options include `solid` for a flat color, `linear` for a linear gradient, and `radial` for a radial gradient. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options.",
232
+ "anyOf": [
233
+ {
234
+ "$ref": "#/definitions/colorFill"
235
+ },
236
+ {
237
+ "type": "array",
238
+ "items": {
239
+ "$ref": "#/definitions/colorFill"
240
+ },
241
+ "minItems": 0,
242
+ "maxItems": 128
243
+ }
244
+ ]
245
+ },
246
+ "^[a-z][a-zA-Z0-9]*ColorFillStops$": {
247
+ "description": "Specifies the number of color stops for gradient fills. This value is only relevant when the color fill method is set to `linear` or `radial`. The minimum value is 2. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
248
+ "anyOf": [
249
+ {
250
+ "$ref": "#/definitions/colorFillStops"
251
+ },
252
+ {
253
+ "type": "array",
254
+ "items": {
255
+ "$ref": "#/definitions/colorFillStops"
256
+ },
257
+ "minItems": 0,
258
+ "maxItems": 2
259
+ }
260
+ ]
261
+ },
262
+ "^[a-z][a-zA-Z0-9]*ColorAngle$": {
263
+ "description": "Specifies the angle for the color gradient. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
264
+ "allOf": [{ "$ref": "#/definitions/rotateOption" }]
265
+ },
266
+ "^rotate$": {
267
+ "description": "This is the rotation angle for the entire avatar. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation in both directions. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
268
+ "allOf": [{ "$ref": "#/definitions/rotateOption" }]
269
+ },
270
+ "^translateY$": {
271
+ "description": "This is the vertical translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar down and negative values move it up. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
272
+ "allOf": [{ "$ref": "#/definitions/translateOption" }]
273
+ },
274
+ "^translateX$": {
275
+ "description": "This is the horizontal translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar to the right and negative values move it to the left. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
276
+ "allOf": [{ "$ref": "#/definitions/translateOption" }]
277
+ }
278
+ },
279
+ "propertyNames": { "maxLength": 128 },
280
+ "additionalProperties": false,
281
+ "maxProperties": 512
282
+ }
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.4
2
+ Name: dicebear-schema
3
+ Version: 1.1.0
4
+ Summary: JSON Schema definitions for DiceBear avatar styles and options
5
+ Project-URL: Homepage, https://www.dicebear.com
6
+ Project-URL: Repository, https://github.com/dicebear/schema
7
+ Project-URL: Issues, https://github.com/dicebear/schema/issues
8
+ Author-email: Florian Körner <contact@florian-koerner.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: avatar,dicebear,json-schema,schema
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+
23
+ # @dicebear/schema
24
+
25
+ JSON Schema definitions for [DiceBear](https://dicebear.com) avatar styles and options.
26
+
27
+ ## Schemas
28
+
29
+ This package exports two JSON Schemas (Draft 07):
30
+
31
+ ### `definition.json`
32
+
33
+ Validates avatar style definitions — the files that describe how a DiceBear avatar style is structured. A definition includes:
34
+
35
+ - **`canvas`** _(required)_ — The SVG canvas dimensions and root element tree
36
+ - **`components`** — Named, reusable SVG components with variants. At render time, a PRNG selects one variant per component. Components can also be declared as aliases of another component via `extends`, producing an independently-randomized instance.
37
+ - **`colors`** — Named color palettes. Colors can define constraints such as `notEqualTo` (must differ from another color) or `contrastTo` (picks the highest-contrast value).
38
+ - **`attributes`** — Global SVG attributes applied to the root `<svg>` element
39
+ - **`meta`** — License, creator, and source metadata
40
+
41
+ Only a safe subset of SVG elements and attributes is permitted. Event handlers, external URL references, and CSS injection patterns are explicitly blocked.
42
+
43
+ #### Additional Documentation
44
+
45
+ https://www.dicebear.com/specification/definition-schema/
46
+
47
+ ### `options.json`
48
+
49
+ Validates the options object passed by users when generating an avatar. Supported properties include:
50
+
51
+ | Property | Type | Description |
52
+ | ----------------- | ------------------------------ | ------------------------------------------------------------- |
53
+ | `seed` | `string` | PRNG seed for reproducible avatars |
54
+ | `size` | `integer` | Output size in pixels (1 to 4096) |
55
+ | `title` | `string` | Accessible title rendered as `<title>` and `aria-label` |
56
+ | `flip` | `string \| array` | Mirror direction: `none`, `horizontal`, `vertical`, or `both` |
57
+ | `scale` | `number \| [min, max]` | Scaling factor (0 to 10, 1 = original size) |
58
+ | `rotate` | `number \| [min, max]` | Rotation in degrees (−360 to 360) |
59
+ | `translateX` | `number \| [min, max]` | Horizontal offset (−1000 to 1000) |
60
+ | `translateY` | `number \| [min, max]` | Vertical offset (−1000 to 1000) |
61
+ | `borderRadius` | `number \| [min, max]` | Corner radius (0 = sharp, 50 = circle) |
62
+ | `idRandomization` | `boolean` | SVG ID randomization to avoid conflicts |
63
+ | `fontFamily` | `string \| array` | Font family for text rendering |
64
+ | `fontWeight` | `integer \| array` | Font weight (1 to 1000) |
65
+ | `*Probability` | `number` | Component display probability (0 to 100) |
66
+ | `*Variant` | `string \| string[] \| object` | Component variant filter and weights |
67
+ | `*Color` | `string \| array` | Hex colors |
68
+ | `*ColorFill` | `string \| array` | Color fill: `solid`, `linear`, or `radial` |
69
+ | `*ColorFillStops` | `integer \| [min, max]` | Gradient color stops (min 2) |
70
+ | `*ColorAngle` | `number \| [min, max]` | Gradient angle (−360 to 360) |
71
+
72
+ When an option accepts an array, the PRNG either picks from the list (for discrete values) or picks a value within the range (for numeric min/max pairs).
73
+
74
+ ## Usage
75
+
76
+ **JavaScript**
77
+
78
+ ```bash
79
+ npm install @dicebear/schema
80
+ ```
81
+
82
+ ```js
83
+ import definitionSchema from "@dicebear/schema/definition.json" with { type: "json" };
84
+ import optionsSchema from "@dicebear/schema/options.json" with { type: "json" };
85
+ ```
86
+
87
+ **PHP**
88
+
89
+ ```bash
90
+ composer require dicebear/schema
91
+ ```
92
+
93
+ ```php
94
+ $basePath = \Composer\InstalledVersions::getInstallPath('dicebear/schema');
95
+
96
+ $definition = json_decode(file_get_contents($basePath . '/src/definition.json'), true);
97
+ $options = json_decode(file_get_contents($basePath . '/src/options.json'), true);
98
+ ```
99
+
100
+ **Python**
101
+
102
+ ```bash
103
+ pip install dicebear-schema
104
+ ```
105
+
106
+ ```python
107
+ import json
108
+ from importlib.resources import files
109
+
110
+ definition = json.loads(files("dicebear_schema").joinpath("definition.json").read_text("utf-8"))
111
+ options = json.loads(files("dicebear_schema").joinpath("options.json").read_text("utf-8"))
112
+ ```
113
+
114
+ **CDN**
115
+
116
+ The schemas are available directly via CDN — no installation required. We recommend using a specific version to ensure stability:
117
+
118
+ ```
119
+ https://cdn.hopjs.net/npm/@dicebear/schema@1.1.0/dist/definition.min.json
120
+ https://cdn.hopjs.net/npm/@dicebear/schema@1.1.0/dist/options.min.json
121
+ ```
122
+
123
+ ## Contributing
124
+
125
+ See [CONTRIBUTING.md](https://github.com/dicebear/schema/blob/main/CONTRIBUTING.md) for local development, testing,
126
+ and the release process.
127
+
128
+ ## Sponsors
129
+
130
+ Advertisement: Many thanks to our sponsors who provide us with free or discounted products.
131
+
132
+ <a href="https://bunny.net/" target="_blank" rel="noopener noreferrer">
133
+ <picture>
134
+ <source media="(prefers-color-scheme: dark)" srcset="https://www.dicebear.com/sponsors/bunny-light.svg">
135
+ <source media="(prefers-color-scheme: light)" srcset="https://www.dicebear.com/sponsors/bunny-dark.svg">
136
+ <img alt="bunny.net" src="https://www.dicebear.com/sponsors/bunny-dark.svg" height="64">
137
+ </picture>
138
+ </a>
@@ -0,0 +1,6 @@
1
+ dicebear_schema/definition.json,sha256=3ZjbqgObwOkyT6DnTAjz1-knUc-CTRn5WlP8PWcqZK0,33026
2
+ dicebear_schema/options.json,sha256=B25Pqior6SXoy9m86-5L5uVaRGIH2ecChSEa3pXRCjo,11632
3
+ dicebear_schema-1.1.0.dist-info/METADATA,sha256=1QWb70-bS70msN5B3t9N8P3CIByiha7m6lwLkuYbqMk,6679
4
+ dicebear_schema-1.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
5
+ dicebear_schema-1.1.0.dist-info/licenses/LICENSE,sha256=4zeQDnrV6dHdedV4l_pcIQQ8ENjJy_5A5lKjJpdA9c8,1072
6
+ dicebear_schema-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.30.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Florian Körner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.