> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 레지스트리 항목 찾기

> UI에서 대화형으로 또는 쿼리를 사용해 프로그래밍 방식으로 레지스트리, 컬렉션, 아티팩트 버전을 검색하는 방법을 알아보세요.

[W\&B Registry에서 대화형으로](/ko/models/registry/search_registry#search-for-registry-items) 또는 [W\&B Python SDK](/ko/models/registry/search_registry#query-registry-items)를 사용해 프로그래밍 방식으로 레지스트리, 컬렉션, 아티팩트 버전을 찾으세요.

검색 결과에는 볼 권한이 있는 항목만 표시됩니다.

<Info>
  W\&B Registry를 쿼리할 때 사용하는 문법과 사용 가능한 Operator는 MongoDB 쿼리와 유사하지만 동일하지는 않습니다.
</Info>

<div id="search-for-registry-items">
  ## 레지스트리 항목 검색
</div>

이름으로 컬렉션과 레지스트리를 찾으려면 [W\&B Registry 홈페이지의 검색창](/ko/models/registry/search_registry#basic-search)을 사용하세요. 이름, 태그, 설명, 생성 날짜 등의 특정 속성을 기준으로 레지스트리, 컬렉션 또는 아티팩트 버전을 찾으려면 [고급 검색](/ko/models/registry/search_registry#advanced-search)을 사용하세요.

<div id="basic-search">
  ### 기본 검색
</div>

W\&B Registry 홈페이지에서 레지스트리와 컬렉션을 검색하려면 다음과 같이 하세요:

1. W\&B Registry로 이동합니다.
2. 페이지 상단의 검색창에 검색어를 입력합니다.
3. Enter 키를 눌러 검색합니다.

<div id="advanced-search">
  ### 고급 검색
</div>

고급 검색을 사용해 레지스트리, 컬렉션 또는 아티팩트 버전을 검색하세요. 필터를 사용하면 이름, 태그, 설명, 생성 날짜 등의 속성을 기준으로 특정 레지스트리 항목을 검색할 수 있습니다.

1. W\&B Registry로 이동합니다.
2. 홈 화면 상단에서 **Advanced**를 클릭합니다.
3. **레지스트리**, **컬렉션** 또는 **아티팩트 버전** 버튼을 선택합니다.
4. **Filters**를 클릭합니다.
5. 왼쪽부터 순서대로 필터링할 속성, 연산자, 값을 선택합니다. 필터를 여러 개 추가해 검색 범위를 좁힐 수 있습니다.
6. Enter 키를 눌러 필터를 적용합니다.

<div id="query-registry-items">
  ## 레지스트리 항목 쿼리
</div>

[`wandb.Api().registries()`](/ko/models/ref/python/public-api/api#registries)와 *쿼리 조건식*을 사용해 레지스트리, 컬렉션, 아티팩트 버전을 필터링합니다. 쿼리 조건식은 반환되는 항목이 충족해야 하는 기준을 지정하는 조건입니다.

쿼리 조건식을 만들려면 [쿼리 이름](/ko/models/registry/search_registry#filterable-fields), 하나 이상의 [Operator](/ko/models/registry/search_registry#supported-operators), 그리고 값으로 구성된 JSON과 유사한 딕셔너리를 사용합니다. 다음 코드 스니펫은 쿼리 조건식의 일반적인 구조를 보여줍니다.

```python theme={null}
{
    "query_name": {
        "operator": value
    }
}
```

다음 섹션에서는 사용 가능한 레지스트리 [쿼리 이름](/ko/models/registry/search_registry#filterable-fields), [지원되는 Operator](/ko/models/registry/search_registry#supported-operators), 그리고 [예제 쿼리](/ko/models/registry/search_registry#example-queries)를 설명합니다.

<div id="filterable-fields">
  ### 필터링 가능한 필드
</div>

다음 표에는 필터링할 항목의 유형에 따라 사용할 수 있는 쿼리 이름이 나와 있습니다:

|       | 쿼리 이름                                                    |
| ----- | -------------------------------------------------------- |
| 레지스트리 | `name`, `description`, `created_at`, `updated_at`        |
| 컬렉션   | `name`, `tag`, `description`, `created_at`, `updated_at` |
| 버전    | `tag`, `alias`, `created_at`, `updated_at`, `metadata`   |

<div id="supported-operators">
  ### 지원되는 Operator
</div>

W\&B는 레지스트리 항목을 필터링할 때 다음 비교 및 논리 Operator를 지원합니다:

<div id="comparison-operators">
  #### 비교 Operator
</div>

| Operator | 설명    |
| -------- | ----- |
| `$eq`    | 같음    |
| `$ne`    | 같지 않음 |
| `$gt`    | 초과    |
| `$gte`   | 이상    |
| `$lt`    | 미만    |
| `$lte`   | 이하    |

<div id="logical-operators">
  #### 논리 Operator
</div>

| Operator | 설명                                                                            |
| -------- | ----------------------------------------------------------------------------- |
| `$and`   | 하나 이상의 조건에 [AND](https://en.wikipedia.org/wiki/Logical_conjunction) 논리를 적용합니다 |
| `$or`    | 하나 이상의 조건에 [OR](https://en.wikipedia.org/wiki/Logical_disjunction) 논리를 적용합니다  |
| `$nor`   | 하나 이상의 조건에 [NOR](https://en.wikipedia.org/wiki/Logical_NOR) 논리를 적용합니다         |
| `$not`   | 조건에 [NOT](https://en.wikipedia.org/wiki/Negation) 논리를 적용합니다                   |

<div id="other-operators">
  #### 기타 Operator
</div>

| Operator    | 설명        |
| ----------- | --------- |
| `$regex`    | 정규식 패턴 매칭 |
| `$exists`   | 필드 존재 여부  |
| `$contains` | 문자열에 값 포함 |

<div id="example-queries">
  ### 예제 쿼리
</div>

다음 코드 예제에서는 일반적인 검색 시나리오 몇 가지를 보여줍니다.

`wandb.Api().registries()` 방법을 사용하려면 먼저 W\&B Python SDK ([`wandb`](/ko/models/ref/python/)) 라이브러리를 임포트하세요:

```python theme={null}
import wandb

# (선택) 가독성을 위해 wandb.Api() 클래스의 인스턴스를 생성합니다
api = wandb.Api()
```

`model` 문자열이 포함된 모든 레지스트리를 필터링합니다:

```python theme={null}
# `model` 문자열이 포함된 모든 레지스트리를 필터링합니다
registry_filters = {
    "name": {"$regex": "model"}
}

# 필터와 일치하는 모든 레지스트리의 반복 가능 객체를 반환합니다
registries = api.registries(filter=registry_filters)
```

컬렉션 이름에 `yolo` 문자열이 포함된 모든 컬렉션을 레지스트리와 무관하게 필터링합니다:

```python theme={null}
# 컬렉션 이름에 `yolo` 문자열이 포함된 모든 컬렉션을 레지스트리와 무관하게 필터링합니다
collection_filters = {
    "name": {"$regex": "yolo"}
}

# 필터와 일치하는 모든 컬렉션의 반복 가능 객체를 반환합니다
collections = api.registries().collections(filter=collection_filters)
```

컬렉션 이름에 문자열 `yolo`가 포함되고 태그로 `cnn`이 지정된, 레지스트리와 무관한 모든 컬렉션을 필터링합니다:

```python theme={null}
# 컬렉션 이름에 문자열 `yolo`가 포함되고 태그로 `cnn`이 지정된,
# 레지스트리와 무관한 모든 컬렉션을 필터링합니다
collection_filters = {
    "name": {"$regex": "yolo"},
    "tag": "cnn"
}

# 필터와 일치하는 모든 컬렉션의 반복 가능 객체를 반환합니다
collections = api.registries().collections(filter=collection_filters)
```

`model` 문자열을 포함하고, 태그 `image-classification` 또는 `latest` 별칭 중 하나가 있는 모든 아티팩트 버전을 찾습니다:

```python theme={null}
# `model` 문자열을 포함하고, 태그 `image-classification` 또는 `latest` 별칭 중 하나가 있는 모든 아티팩트 버전을 찾습니다
registry_filters = {
    "name": {"$regex": "model"}
}

# 논리 연산자 $or를 사용하여 아티팩트 버전을 필터링합니다
version_filters = {
    "$or": [
        {"tag": "image-classification"},
        {"alias": "production"}
    ]
}

# 필터와 일치하는 모든 아티팩트 버전의 반복 가능 객체를 반환합니다
artifacts = api.registries(filter=registry_filters).collections().versions(filter=version_filters)
```

앞선 코드 스니펫의 `artifacts` 반복 가능 객체의 각 항목은 `Artifact` 클래스의 인스턴스입니다. 즉, 각 아티팩트의 `name`, `collection`, `aliases`, `tags`, `created_at` 등과 같은 속성에 액세스할 수 있습니다:

```python theme={null}
for art in artifacts:
    print(f"artifact name: {art.name}")
    print(f"collection artifact belongs to: { art.collection.name}")
    print(f"artifact aliases: {art.aliases}")
    print(f"tags attached to artifact: {art.tags}")
    print(f"artifact created at: {art.created_at}\n")
```

아티팩트 객체의 전체 속성 목록은 API 레퍼런스 문서의 [Artifacts Class](/ko/models/ref/python/experiments/artifact/)를 참조하세요.

레지스트리나 컬렉션과 관계없이, 2024-01-08부터 2025-03-04 13:10 UTC 사이에 생성된 모든 아티팩트 버전을 필터링합니다:

```python theme={null}
# 2024-01-08부터 2025-03-04 13:10 UTC 사이에 생성된 모든 아티팩트 버전을 찾습니다. 

artifact_filters = {
    "alias": "latest",
    "created_at" : {"$gte": "2024-01-08", "$lte": "2025-03-04 13:10:00"},
}

# 필터와 일치하는 모든 아티팩트 버전의 반복 가능 객체를 반환합니다
artifacts = api.registries().collections().versions(filter=artifact_filters)
```

<Note>
  `created_at` 및 `updated_at` 쿼리에는 `YYYY-MM-DD HH:MM:SS` 형식으로 날짜와 시간을 지정하세요. 날짜만 기준으로 필터링하려면 시, 분, 초는 생략할 수 있습니다.
</Note>
