> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-sdk-testing-latest.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Registry

export const GitHubLink = ({url}) => <a href={url} target="_blank" rel="noopener noreferrer" className="github-source-link">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
    </svg>
    GitHub source
  </a>;

<GitHubLink url="https://github.com/wandb/wandb/blob/main/wandb/apis/public/registries/registry.py#L38" />

## <kbd>class</kbd> Registry

```python theme={null}
(service_api: 'ServiceApi',
organization: 'str',
entity: 'str',
name: 'str',
attrs: 'RegistryFragment | None' = None)
```

## Description

A single registry in the Registry.

## Args

* `service_api`:
* `organization`:
* `entity`:
* `name`:
* `attrs`:

## Properties

### <kbd>property</kbd> id

The unique ID for this registry.

### <kbd>property</kbd> full\_name

Full name of the registry including the `wandb-registry-` prefix.

### <kbd>property</kbd> name

Name of the registry without the `wandb-registry-` prefix.

### <kbd>property</kbd> entity

Organization entity of the registry.

### <kbd>property</kbd> organization

Organization name of the registry.

### <kbd>property</kbd> description

Description of the registry.

### <kbd>property</kbd> allow\_all\_artifact\_types

Return whether all artifact types are allowed in the registry.

If `True`, artifacts of any type can be added. If `False`, artifacts are
restricted to the types listed in `artifact_types`.

### <kbd>property</kbd> artifact\_types

Returns the artifact types allowed in the registry.

If `allow_all_artifact_types` is `True` then `artifact_types` reflects the
types previously saved or currently used in the registry.
If `allow_all_artifact_types` is `False` then artifacts are restricted to the
types in `artifact_types`.

Note:
Previously saved artifact types cannot be removed.

### <kbd>property</kbd> created\_at

Timestamp of when the registry was created.

### <kbd>property</kbd> updated\_at

Timestamp of when the registry was last updated.

### <kbd>property</kbd> path

### <kbd>property</kbd> visibility

Visibility of the registry.

## Methods

### <kbd>method</kbd> add\_members

```python theme={null}
self, *members: 'User | UserMember | Team | TeamMember | str'
```

Adds users or teams to this registry.

##### Arguments

* `members`: The users or teams to add to the registry. Accepts `User` objects, `Team` objects, or their string IDs.

##### Raises

* `TypeError`: If no members are passed as arguments.
* `ValueError`: If unable to infer or parse the user or team IDs.

##### Examples

```python theme={null}
import wandb

api = wandb.Api()

# Fetch an existing registry
registry = api.registry(name="my-registry", organization="my-org")

user1 = api.user(username="some-user")
user2 = api.user(username="other-user")
registry.add_members(user1, user2)

my_team = api.team(name="my-team")
registry.add_members(my_team)
```

### <kbd>method</kbd> collections

```python theme={null}
self,
filter: 'dict[str, Any] | None' = None,
order: 'str | None' = None,
per_page: 'PositiveInt' = 100,
start: 'str | None' = None
```

Returns the collections belonging to this registry.

##### Arguments

* `filter`: Optional mapping of filters to apply to the collections query.
* `order`: Optional string to specify the order of the results. If prefixed with '+', sorts ascending (default). If prefixed with '-', sorts descending.
* `per_page`: The number of results to fetch per page. Usually there is no reason to change this.
* `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute.

### <kbd>method</kbd> create

```python theme={null}
api: 'Api',
organization: 'str',
name: 'str',
visibility: "Literal['organization', 'restricted']",
description: 'str | None' = None,
artifact_types: 'list[str] | None' = None
```

Create a new registry.

The registry name must be unique within the organization.
This function should be called using `api.create_registry()`

##### Arguments

* `api`: The W\&B API instance.
* `organization`: The name of the organization.
* `name`: The name of the registry (without the `wandb-registry-` prefix).
* `visibility`: The visibility level ('organization' or 'restricted').
* `description`: An optional description for the registry.
* `artifact_types`: An optional list of allowed artifact types.

##### Raises

* `ValueError`: If a registry with the same name already exists in the organization or if the creation fails.

### <kbd>method</kbd> delete

```python theme={null}
self
```

Delete the registry. This is irreversible.

### <kbd>method</kbd> load

```python theme={null}
self
```

Load registry attributes from the backend.

### <kbd>method</kbd> members

```python theme={null}
self
```

Returns the current members (users and teams) of this registry.

### <kbd>method</kbd> remove\_members

```python theme={null}
self, *members: 'User | UserMember | Team | TeamMember | str'
```

Removes users or teams from this registry.

##### Arguments

* `members`: The users or teams to remove from the registry. Accepts `User` objects, `Team` objects, or their string IDs.

##### Raises

* `TypeError`: If no members are passed as arguments.
* `ValueError`: If unable to infer or parse the user or team IDs.

##### Examples

```python theme={null}
import wandb

api = wandb.Api()

# Fetch an existing registry
registry = api.registry(name="my-registry", organization="my-org")

user1 = api.user(username="some-user")
user2 = api.user(username="other-user")
registry.remove_members(user1, user2)

old_team = api.team(name="old-team")
registry.remove_members(old_team)
```

### <kbd>method</kbd> save

```python theme={null}
self
```

Save registry attributes to the backend.

### <kbd>method</kbd> team\_members

```python theme={null}
self
```

Returns the current member teams of this registry.

### <kbd>method</kbd> update\_member

```python theme={null}
self,
member: 'User | UserMember | Team | TeamMember | str',
role: 'MemberRole | str'
```

Updates the role of a member (user or team) within this registry.

##### Arguments

* `member`: The user or team to update the role of. Accepts a `User` object, `Team` object, or their string ID.
* `role`: The new role to assign to the member. May be one of: - "admin" - "member" - "viewer" - "restricted\_viewer" (if supported by the W\&B server)

##### Raises

* `ValueError`: If unable to infer the user or team ID.

##### Examples

Make all users in the registry admins

```python theme={null}
import wandb

api = wandb.Api()

# Fetch an existing registry
registry = api.registry(name="my-registry", organization="my-org")

for member in registry.user_members():
    registry.update_member(member.user, role="admin")
```

### <kbd>method</kbd> user\_members

```python theme={null}
self
```

Returns the current member users of this registry.

### <kbd>method</kbd> versions

```python theme={null}
self,
filter: 'dict[str, Any] | None' = None,
per_page: 'PositiveInt' = 100,
start: 'str | None' = None
```

Returns the artifact versions belonging to this registry.

##### Arguments

* `filter`: Optional mapping of filters to apply to the artifact versions query.
* `per_page`: The number of results to fetch per page. Usually there is no reason to change this.
* `start`: Pagination cursor for resuming a past query, captured from a previous paginator's `.cursor` attribute.
