Skip to content

Search

Accessed via client.search.

pycomad.client.SearchClient

SearchClient(http: _HttpSession)

Methods for the /assets/search and /assets/search/nearby endpoints.

search

search(*, q: Optional[str] = None, camera_make: Optional[str] = None, camera_model: Optional[str] = None, creator: Optional[str] = None, keyword: Optional[str] = None, city: Optional[str] = None, country: Optional[str] = None, taken_after: Optional[str] = None, taken_before: Optional[str] = None, has_gps: Optional[bool] = None, limit: Optional[int] = None, offset: Optional[int] = None) -> List[AssetSearchResult]

Search assets using full-text and metadata filters.

All parameters are optional; omit to return all accessible assets.

Parameters:

Name Type Description Default
q Optional[str]

Full-text filter matching name, caption, or description.

None
camera_make Optional[str]

Exact camera make from EXIF (e.g. "Canon").

None
camera_model Optional[str]

Exact camera model from EXIF (e.g. "EOS R5").

None
creator Optional[str]

Partial match on creator name.

None
keyword Optional[str]

Match against IPTC keywords or the keywords text field.

None
city Optional[str]

Partial match on IPTC city.

None
country Optional[str]

Partial match on IPTC country.

None
taken_after Optional[str]

Return assets captured on or after this EXIF datetime string (format: "YYYY:MM:DD HH:MM:SS").

None
taken_before Optional[str]

Return assets captured on or before this EXIF datetime string.

None
has_gps Optional[bool]

When True, return only assets with GPS coordinates.

None
limit Optional[int]

Maximum results to return (default 50, max 200).

None
offset Optional[int]

Pagination offset (default 0).

None

Returns:

Type Description
List[AssetSearchResult]

List of :class:~pycomad.models.AssetSearchResult objects, each

List[AssetSearchResult]

containing the asset and its inline metadata summary.

Raises:

Type Description
ComadAuthError

If not authenticated.

nearby

nearby(lat: float, lon: float, *, radius_km: Optional[float] = None, limit: Optional[int] = None, offset: Optional[int] = None) -> List[AssetSearchResult]

Return assets within a geographic radius.

Matches assets that have GPS coordinates in their EXIF metadata.

Parameters:

Name Type Description Default
lat float

Centre latitude in decimal degrees.

required
lon float

Centre longitude in decimal degrees.

required
radius_km Optional[float]

Search radius in kilometres (default 10).

None
limit Optional[int]

Maximum results to return (default 50, max 200).

None
offset Optional[int]

Pagination offset (default 0).

None

Returns:

Type Description
List[AssetSearchResult]

List of :class:~pycomad.models.AssetSearchResult objects within

List[AssetSearchResult]

the given radius.

Raises:

Type Description
ComadAuthError

If not authenticated.