# Utility Functions

### *def create\_avatar()*

Create a DAvatar object and return it.

```python
def create_avatar(
    style: DStyle,
    seed: str,
    options: DOptions | None = None,
    customisations: dict | None = None
) -> DAvatar
```

> Returns: a new [`DAvatar`](https://dicebear.vhjan.me/reference/avatar#class-davatar) object

<table><thead><tr><th width="197.80536912751677">Parameter</th><th width="110">Type</th><th width="191">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>style</code></td><td><a href="../../reference/models#class-dstyle">DStyle</a></td><td><code>DStyle.random()</code></td><td>The style of avatar you want to create (<a data-mention href="../customization#styles">#styles</a>)</td></tr><tr><td><code>seed</code></td><td><a href="https://docs.python.org/3/library/stdtypes.html#str">str</a></td><td><code>None</code></td><td>Base string to determine the avatar.</td></tr><tr><td><code>options</code></td><td><a href="../../reference/models#class-doptions">DOptions</a></td><td><code>DOptions.empty</code></td><td>General options for the avatar.</td></tr><tr><td><code>customisations</code></td><td><a href="https://docs.python.org/3/library/stdtypes.html#dict">dict</a></td><td><code>None</code></td><td>Customisations (for the chosen style)</td></tr></tbody></table>

&#x20;

### *def create\_random()*

Create a random DAvatar object and return it.

```python
def create_random(
    randomOptions: bool = False
) -> DAvatar
```

> Returns: a new [`DAvatar`](https://dicebear.vhjan.me/reference/avatar#class-davatar) object

<table><thead><tr><th width="197.80536912751677">Parameter</th><th width="110">Type</th><th width="191">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>randomOptions</code></td><td><a href="https://docs.python.org/3/library/functions.html#bool">bool</a></td><td><code>False</code></td><td>Whether to use random (background) options for this avatar or not</td></tr></tbody></table>

### *def bulk\_create()*

Create a list of [`DAvatar`](#class-davatar) objects (with random seeds).

```python
def bulk_create(
    style: DStyle = DStyle.random(),
    amount: int = 2,
    *,
    options: DOptions = DOptions.default,
    custom: dict = None
) -> list[DAvatar]
```

> Returns: [`list[DAvatar]`](https://docs.python.org/3/library/stdtypes.html?highlight=list#list): a list of [`DAvatar`](https://dicebear.vhjan.me/reference/avatar) objects

<table><thead><tr><th width="137.80536912751677">Parameter</th><th width="150">Type</th><th width="195">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>style</code></td><td><a href="../../reference/models#class-dstyle">DStyle</a></td><td><code>DStyle.random()</code></td><td>The style you want to create (<a data-mention href="../customization#styles">#styles</a>)</td></tr><tr><td><code>amount</code></td><td><a href="https://docs.python.org/3/library/functions.html#int">int</a></td><td><code>2</code></td><td>The amount of DAvatar objects you want to create.</td></tr><tr><td><code>options</code></td><td><a href="../../reference/models#class-doptions">DOptions</a></td><td><code>DOptions.empty</code></td><td>General options for the avatars.</td></tr><tr><td><code>custom</code></td><td><a href="https://docs.python.org/3/library/stdtypes.html#dict">dict</a></td><td><code>None</code></td><td>Customisations (for the chosen style)</td></tr></tbody></table>
