Skip to content

Metron

Metron

Client for the Metron comic-book database API.

Handles authentication, rate limiting, caching, and response validation for all requests made to the Metron REST API.

PARAMETER DESCRIPTION
username

Metron account username used for HTTP Basic authentication.

TYPE: str

password

Metron account password used for HTTP Basic authentication.

TYPE: str

cache

Path to the SQLite cache file. If not provided, a default path will be used under /cache.sqlite.

TYPE: Path | None DEFAULT: None

base_url

Root URL of the Metron API.

TYPE: str | None DEFAULT: None

user_agent

Value sent in the User-Agent request header.

TYPE: str | None DEFAULT: None

timeout

Number of seconds to wait for a server response before timing out.

TYPE: float DEFAULT: 20

cache_expiry

Duration for which cached responses are valid. Response cache-headers take precedence.

TYPE: timedelta DEFAULT: timedelta(days=14)

Source code in seagrin/metron.py
Python
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
def __init__(
    self,
    username: str,
    password: str,
    cache: Path | None = None,
    base_url: str | None = None,
    user_agent: str | None = None,
    timeout: float = 20,
    cache_expiry: timedelta = timedelta(days=14),
):
    self._base_url = base_url or "https://metron.cloud/api"
    self._session = CachedLimiterSession(
        backend=SQLiteCache(
            db_path=cache or (get_cache_root() / "cache.sqlite"), serializer="json"
        ),
        expire_after=cache_expiry,
        cache_control=cache_expiry != NEVER_EXPIRE,
        per_minute=20,
        per_day=5_000,
        max_delay=timeout * 2,
        bucket_class=SQLiteBucket,
        per_host=False,
        bucket_name="metron",
    )
    self._session.headers.update(
        {
            "Accept": "application/json",
            "User-Agent": user_agent
            or f"Seagrin/{__version__} ({platform.system()}: {platform.release()}; Python v{platform.python_version()})",  # noqa: E501
        }
    )
    self._session.auth = HTTPBasicAuth(username=username, password=password)
    self._timeout = timeout
    self._cache = cache

Functions

get_arc

Retrieve detailed information about a story arc by ID.

PARAMETER DESCRIPTION
arc_id

The unique identifier of the arc.

TYPE: int

RETURNS DESCRIPTION
Arc

An Arc object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
def get_arc(self, arc_id: int) -> Arc:
    """Retrieve detailed information about a story arc by ID.

    Args:
        arc_id: The unique identifier of the arc.

    Returns:
        An Arc object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/arc/{arc_id}")
        return TypeAdapter(Arc).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_character

Retrieve detailed information about a character by ID.

PARAMETER DESCRIPTION
character_id

The unique identifier of the character.

TYPE: int

RETURNS DESCRIPTION
Character

A Character object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
def get_character(self, character_id: int) -> Character:
    """Retrieve detailed information about a character by ID.

    Args:
        character_id: The unique identifier of the character.

    Returns:
        A Character object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/character/{character_id}")
        return TypeAdapter(Character).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_collection

Retrieve detailed information about a collection item by ID.

Note: This endpoint requires authentication. Users can only access their own collection items.

PARAMETER DESCRIPTION
collection_id

The unique identifier of the collection entry.

TYPE: int

RETURNS DESCRIPTION
Collection

A Collection object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
def get_collection(self, collection_id: int) -> Collection:
    """Retrieve detailed information about a collection item by ID.

    Note: This endpoint requires authentication.
    Users can only access their own collection items.

    Args:
        collection_id: The unique identifier of the collection entry.

    Returns:
        A Collection object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/collection/{collection_id}")
        return TypeAdapter(Collection).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_collection_stats

Retrieve statistics about the authenticated user's collection.

Returns comprehensive statistics including total items, total value, read/unread counts, and breakdowns by format. Note: This endpoint requires authentication.

RETURNS DESCRIPTION
CollectionStats

A CollectionStats object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
def get_collection_stats(self) -> CollectionStats:
    """Retrieve statistics about the authenticated user's collection.

    Returns comprehensive statistics including total items, total value, read/unread counts,
    and breakdowns by format.
    Note: This endpoint requires authentication.

    Returns:
        A CollectionStats object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint="/collection/stats")
        return TypeAdapter(CollectionStats).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_creator

Retrieve detailed information about a creator by ID.

PARAMETER DESCRIPTION
creator_id

The unique identifier of the creator.

TYPE: int

RETURNS DESCRIPTION
Creator

A Creator object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
def get_creator(self, creator_id: int) -> Creator:
    """Retrieve detailed information about a creator by ID.

    Args:
        creator_id: The unique identifier of the creator.

    Returns:
        A Creator object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/creator/{creator_id}")
        return TypeAdapter(Creator).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_imprint

Retrieve detailed information about an imprint by ID.

PARAMETER DESCRIPTION
imprint_id

The unique identifier of the imprint.

TYPE: int

RETURNS DESCRIPTION
Imprint

An Imprint object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
def get_imprint(self, imprint_id: int) -> Imprint:
    """Retrieve detailed information about an imprint by ID.

    Args:
        imprint_id: The unique identifier of the imprint.

    Returns:
        An Imprint object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/imprint/{imprint_id}")
        return TypeAdapter(Imprint).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_issue

Retrieve detailed information about an issue by ID.

PARAMETER DESCRIPTION
issue_id

The unique identifier of the issue.

TYPE: int

RETURNS DESCRIPTION
Issue

An Issue object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
def get_issue(self, issue_id: int) -> Issue:
    """Retrieve detailed information about an issue by ID.

    Args:
        issue_id: The unique identifier of the issue.

    Returns:
        An Issue object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/issue/{issue_id}")
        return TypeAdapter(Issue).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_publisher

Retrieve detailed information about a publisher by ID.

PARAMETER DESCRIPTION
publisher_id

The unique identifier of the publisher.

TYPE: int

RETURNS DESCRIPTION
Publisher

A Publisher object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
def get_publisher(self, publisher_id: int) -> Publisher:
    """Retrieve detailed information about a publisher by ID.

    Args:
        publisher_id: The unique identifier of the publisher.

    Returns:
        A Publisher object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/publisher/{publisher_id}")
        return TypeAdapter(Publisher).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_reading_list

Retrieve detailed information about a reading list by ID.

PARAMETER DESCRIPTION
reading_list_id

The unique identifier of the reading list.

TYPE: int

RETURNS DESCRIPTION
ReadingList

A ReadingList object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
def get_reading_list(self, reading_list_id: int) -> ReadingList:
    """Retrieve detailed information about a reading list by ID.

    Args:
        reading_list_id: The unique identifier of the reading list.

    Returns:
        A ReadingList object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/reading_list/{reading_list_id}")
        return TypeAdapter(ReadingList).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_series

Retrieve detailed information about a series by ID.

PARAMETER DESCRIPTION
series_id

The unique identifier of the series.

TYPE: int

RETURNS DESCRIPTION
Series

A Series object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
def get_series(self, series_id: int) -> Series:
    """Retrieve detailed information about a series by ID.

    Args:
        series_id: The unique identifier of the series.

    Returns:
        A Series object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/series/{series_id}")
        return TypeAdapter(Series).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_team

Retrieve detailed information about a team by ID.

PARAMETER DESCRIPTION
team_id

The unique identifier of the team.

TYPE: int

RETURNS DESCRIPTION
Team

A Team object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
def get_team(self, team_id: int) -> Team:
    """Retrieve detailed information about a team by ID.

    Args:
        team_id: The unique identifier of the team.

    Returns:
        A Team object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/team/{team_id}")
        return TypeAdapter(Team).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

get_universe

Retrieve detailed information about a universe by ID.

PARAMETER DESCRIPTION
universe_id

The unique identifier of the universe.

TYPE: int

RETURNS DESCRIPTION
Universe

A Universe object.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
def get_universe(self, universe_id: int) -> Universe:
    """Retrieve detailed information about a universe by ID.

    Args:
        universe_id: The unique identifier of the universe.

    Returns:
        A Universe object.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        result = self._fetch_item(endpoint=f"/universe/{universe_id}")
        return TypeAdapter(Universe).validate_python(result)
    except ValidationError as err:
        raise ServiceError(err) from err

list_arc_issues

Retrieve a list of issues that are part of a specific story arc.

PARAMETER DESCRIPTION
arc_id

The unique identifier of the arc.

TYPE: int

RETURNS DESCRIPTION
list[CommonIssue]

A list of CommonIssue objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
def list_arc_issues(self, arc_id: int) -> list[CommonIssue]:
    """Retrieve a list of issues that are part of a specific story arc.

    Args:
        arc_id: The unique identifier of the arc.

    Returns:
        A list of CommonIssue objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint=f"/arc/{arc_id}/issue_list")
        return TypeAdapter(list[CommonIssue]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_arcs

Retrieve a list of story arcs with optional filtering.

PARAMETER DESCRIPTION
cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

modified_gt

Return arcs modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter arcs by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonResource]

A list of CommonResource objects representing arcs.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
def list_arcs(
    self,
    cv_id: int | None = None,
    gcd_id: int | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
) -> list[CommonResource]:
    """Retrieve a list of story arcs with optional filtering.

    Args:
        cv_id: Filter by Comic Vine ID.
        gcd_id: Filter by Grand Comics Database ID.
        modified_gt: Return arcs modified after this datetime.
        name: Filter arcs by name (partial match).

    Returns:
        A list of CommonResource objects representing arcs.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={"cv_id": cv_id, "gcd_id": gcd_id, "modified_gt": modified_gt, "name": name}
    )
    try:
        results = self._fetch_list(endpoint="/arc", params=params)
        return TypeAdapter(list[CommonResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_character_issues

Retrieve a list of issues featuring a specific character.

PARAMETER DESCRIPTION
character_id

The unique identifier of the character.

TYPE: int

RETURNS DESCRIPTION
list[CommonIssue]

A list of CommonIssue objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
def list_character_issues(self, character_id: int) -> list[CommonIssue]:
    """Retrieve a list of issues featuring a specific character.

    Args:
        character_id: The unique identifier of the character.

    Returns:
        A list of CommonIssue objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint=f"/character/{character_id}/issue_list")
        return TypeAdapter(list[CommonIssue]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_characters

Retrieve a list of characters with optional filtering.

PARAMETER DESCRIPTION
cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

modified_gt

Return characters modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter characters by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonResource]

A list of CommonResource objects representing characters.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
def list_characters(
    self,
    cv_id: int | None = None,
    gcd_id: int | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
) -> list[CommonResource]:
    """Retrieve a list of characters with optional filtering.

    Args:
        cv_id: Filter by Comic Vine ID.
        gcd_id: Filter by Grand Comics Database ID.
        modified_gt: Return characters modified after this datetime.
        name: Filter characters by name (partial match).

    Returns:
        A list of CommonResource objects representing characters.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={"cv_id": cv_id, "gcd_id": gcd_id, "modified_gt": modified_gt, "name": name}
    )
    try:
        results = self._fetch_list(endpoint="/character", params=params)
        return TypeAdapter(list[CommonResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_collection_missing_issues

Retrieve a list of missing issues for a specific series.

Returns issues from a series that are not in the authenticated user's collection. Note: This endpoint requires authentication.

PARAMETER DESCRIPTION
series_id

The unique identifier of the series.

TYPE: int

RETURNS DESCRIPTION
list[BaseIssue]

A list of BaseIssue objects representing missing issues.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
def list_collection_missing_issues(self, series_id: int) -> list[BaseIssue]:
    """Retrieve a list of missing issues for a specific series.

    Returns issues from a series that are not in the authenticated user's collection.
    Note: This endpoint requires authentication.

    Args:
        series_id: The unique identifier of the series.

    Returns:
        A list of BaseIssue objects representing missing issues.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint=f"/collection/missing_issues/{series_id}")
        return TypeAdapter(list[BaseIssue]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_collection_missing_series

Retrieve a list of series where the user has some issues but is missing others.

Returns series where the authenticated user owns at least one issue but not all issues in the series. Note: This endpoint requires authentication.

RETURNS DESCRIPTION
list[MissingSeries]

A list of MissingSeries objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
def list_collection_missing_series(self) -> list[MissingSeries]:
    """Retrieve a list of series where the user has some issues but is missing others.

    Returns series where the authenticated user owns at least one issue but not all issues in
    the series.
    Note: This endpoint requires authentication.

    Returns:
        A list of MissingSeries objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint="/collection/missing_series")
        return TypeAdapter(list[MissingSeries]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_collections

Retrieve a list of collection items with optional filtering.

Note: This endpoint requires authentication. Users can only access their own collection items.

PARAMETER DESCRIPTION
book_format

Filter by the format of the book.

TYPE: BookFormat | None DEFAULT: None

date_read

Filter by an exact read date.

TYPE: date | None DEFAULT: None

date_read_gt

Filter for items read after the given date.

TYPE: date | None DEFAULT: None

date_read_gte

Filter for items read on or after the given date.

TYPE: date | None DEFAULT: None

date_read_lt

Filter for items read before the given date.

TYPE: date | None DEFAULT: None

date_read_lte

Filter for items read on or before the given date.

TYPE: date | None DEFAULT: None

grade

Filter by the assigned grade value.

TYPE: Grade | None DEFAULT: None

grading_company

Filter by the grading company that issued the grade.

TYPE: GradingCompany | None DEFAULT: None

is_read

Filter by read status.

TYPE: bool | None DEFAULT: None

modified_gt

Return collections modified after this datetime.

TYPE: datetime | None DEFAULT: None

purchase_date

Filter by an exact purchase date.

TYPE: date | None DEFAULT: None

purchase_date_gt

Filter for items purchased after the given date.

TYPE: date | None DEFAULT: None

purchase_date_gte

Filter for items purchased on or after the given date.

TYPE: date | None DEFAULT: None

purchase_date_lt

Filter for items purchased before the given date.

TYPE: date | None DEFAULT: None

purchase_date_lte

Filter for items purchased on or before the given date.

TYPE: date | None DEFAULT: None

purchase_store

Filter by the name of the purchase store.

TYPE: str | None DEFAULT: None

rating

Filter by the assigned rating value.

TYPE: Rating | None DEFAULT: None

series_id

Filter by series id.

TYPE: int | None DEFAULT: None

storage_location

Filter by the storage location of the item.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[BaseCollection]

A list of BaseCollection objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
def list_collections(
    self,
    book_format: BookFormat | None = None,
    date_read: date | None = None,
    date_read_gt: date | None = None,
    date_read_gte: date | None = None,
    date_read_lt: date | None = None,
    date_read_lte: date | None = None,
    grade: Grade | None = None,
    grading_company: GradingCompany | None = None,
    is_read: bool | None = None,
    modified_gt: datetime | None = None,
    purchase_date: date | None = None,
    purchase_date_gt: date | None = None,
    purchase_date_gte: date | None = None,
    purchase_date_lt: date | None = None,
    purchase_date_lte: date | None = None,
    purchase_store: str | None = None,
    rating: Rating | None = None,
    series_id: int | None = None,
    storage_location: str | None = None,
) -> list[BaseCollection]:
    """Retrieve a list of collection items with optional filtering.

    Note: This endpoint requires authentication.
    Users can only access their own collection items.

    Args:
        book_format: Filter by the format of the book.
        date_read: Filter by an exact read date.
        date_read_gt: Filter for items read after the given date.
        date_read_gte: Filter for items read on or after the given date.
        date_read_lt: Filter for items read before the given date.
        date_read_lte: Filter for items read on or before the given date.
        grade: Filter by the assigned grade value.
        grading_company: Filter by the grading company that issued the grade.
        is_read: Filter by read status.
        modified_gt: Return collections modified after this datetime.
        purchase_date: Filter by an exact purchase date.
        purchase_date_gt: Filter for items purchased after the given date.
        purchase_date_gte: Filter for items purchased on or after the given date.
        purchase_date_lt: Filter for items purchased before the given date.
        purchase_date_lte: Filter for items purchased on or before the given date.
        purchase_store: Filter by the name of the purchase store.
        rating: Filter by the assigned rating value.
        series_id: Filter by series id.
        storage_location: Filter by the storage location of the item.

    Returns:
        A list of BaseCollection objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={
            "book_format": book_format,
            "date_read": date_read,
            "date_read_gt": date_read_gt,
            "date_read_gte": date_read_gte,
            "date_read_lt": date_read_lt,
            "date_read_lte": date_read_lte,
            "grade": grade,
            "grading_company": grading_company,
            "is_read": is_read,
            "issue__series": series_id,
            "modified_gt": modified_gt,
            "purchase_date": purchase_date,
            "purchase_date_gt": purchase_date_gt,
            "purchase_date_gte": purchase_date_gte,
            "purchase_date_lt": purchase_date_lt,
            "purchase_date_lte": purchase_date_lte,
            "purchase_store": purchase_store,
            "rating": rating,
            "storage_location": storage_location,
        }
    )
    try:
        results = self._fetch_list(endpoint="/collection", params=params)
        return TypeAdapter(list[BaseCollection]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_creators

Retrieve a list of creators with optional filtering.

PARAMETER DESCRIPTION
cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

modified_gt

Return creators modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter creators by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonResource]

A list of CommonResource objects representing creators.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
def list_creators(
    self,
    cv_id: int | None = None,
    gcd_id: int | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
) -> list[CommonResource]:
    """Retrieve a list of creators with optional filtering.

    Args:
        cv_id: Filter by Comic Vine ID.
        gcd_id: Filter by Grand Comics Database ID.
        modified_gt: Return creators modified after this datetime.
        name: Filter creators by name (partial match).

    Returns:
        A list of CommonResource objects representing creators.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={"cv_id": cv_id, "gcd_id": gcd_id, "modified_gt": modified_gt, "name": name}
    )
    try:
        results = self._fetch_list(endpoint="/creator", params=params)
        return TypeAdapter(list[CommonResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_imprints

Retrieve a list of imprints with optional filtering.

PARAMETER DESCRIPTION
cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

modified_gt

Return imprints modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter imprints by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonResource]

A list of CommonResource objects representing imprints.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
def list_imprints(
    self,
    cv_id: int | None = None,
    gcd_id: int | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
) -> list[CommonResource]:
    """Retrieve a list of imprints with optional filtering.

    Args:
        cv_id: Filter by Comic Vine ID.
        gcd_id: Filter by Grand Comics Database ID.
        modified_gt: Return imprints modified after this datetime.
        name: Filter imprints by name (partial match).

    Returns:
        A list of CommonResource objects representing imprints.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={"cv_id": cv_id, "gcd_id": gcd_id, "modified_gt": modified_gt, "name": name}
    )
    try:
        results = self._fetch_list(endpoint="/imprint", params=params)
        return TypeAdapter(list[CommonResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_issues

Retrieve a list of issues with optional filtering.

PARAMETER DESCRIPTION
alt_number

Filter by the issue's alternate number.

TYPE: str | None DEFAULT: None

character_id

Filter by the creator ID.

TYPE: int | None DEFAULT: None

cover_hash

Filter by the hash value of the issue's cover image.

TYPE: str | None DEFAULT: None

cover_month

Filter by the cover month (1-12).

TYPE: int | None DEFAULT: None

cover_year

Filter by the cover year.

TYPE: int | None DEFAULT: None

creator_id

Filter by the creator ID.

TYPE: int | None DEFAULT: None

cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

foc_date

Filter by an exact Final Order Cutoff (FOC) date.

TYPE: date | None DEFAULT: None

foc_date_range_after

Filter for issues with an FOC date after the given date.

TYPE: date | None DEFAULT: None

foc_date_range_before

Filter for issues with an FOC date before the given date.

TYPE: date | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

imprint_id

Filter by the associated imprint ID.

TYPE: int | None DEFAULT: None

imprint_name

Filter by the associated imprint name.

TYPE: str | None DEFAULT: None

missing_cv_id

If True, return only issues missing a Comic Vine ID.

TYPE: bool | None DEFAULT: None

missing_gcd_id

If True, return only issues missing a Grand Comics Database ID.

TYPE: bool | None DEFAULT: None

modified_gt

Return issues modified after this datetime.

TYPE: datetime | None DEFAULT: None

number

Filter by the issue number.

TYPE: str | None DEFAULT: None

publisher_id

Filter by the publisher ID.

TYPE: int | None DEFAULT: None

publisher_name

Filter by the publisher name.

TYPE: str | None DEFAULT: None

rating

Filter by the issue rating.

TYPE: str | None DEFAULT: None

role_ids

Filter by a list of role IDs.

TYPE: list[int] | None DEFAULT: None

series_id

Filter by the series ID.

TYPE: int | None DEFAULT: None

series_name

Filter by the series name.

TYPE: str | None DEFAULT: None

series_volume

Filter by the series volume number.

TYPE: int | None DEFAULT: None

series_year_began

Filter by the year the series began.

TYPE: int | None DEFAULT: None

sku

Filter by the distributor SKU.

TYPE: str | None DEFAULT: None

store_date

Filter by an exact store date.

TYPE: date | None DEFAULT: None

store_date_range_after

Filter for issues with a store date after the given date.

TYPE: date | None DEFAULT: None

store_date_range_before

Filter for issues with a store date before the given date.

TYPE: date | None DEFAULT: None

team_id

Filter by the team ID.

TYPE: int | None DEFAULT: None

universe_id

Filter by the universe ID.

TYPE: int | None DEFAULT: None

upc

Filter by the issue's UPC barcode.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonIssue]

A list of CommonIssue objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
def list_issues(
    self,
    alt_number: str | None = None,
    character_id: int | None = None,
    cover_hash: str | None = None,
    cover_month: int | None = None,
    cover_year: int | None = None,
    creator_id: int | None = None,
    cv_id: int | None = None,
    foc_date: date | None = None,
    foc_date_range_after: date | None = None,
    foc_date_range_before: date | None = None,
    gcd_id: int | None = None,
    imprint_id: int | None = None,
    imprint_name: str | None = None,
    missing_cv_id: bool | None = None,
    missing_gcd_id: bool | None = None,
    modified_gt: datetime | None = None,
    number: str | None = None,
    publisher_id: int | None = None,
    publisher_name: str | None = None,
    rating: str | None = None,
    role_ids: list[int] | None = None,
    series_id: int | None = None,
    series_name: str | None = None,
    series_volume: int | None = None,
    series_year_began: int | None = None,
    sku: str | None = None,
    store_date: date | None = None,
    store_date_range_after: date | None = None,
    store_date_range_before: date | None = None,
    team_id: int | None = None,
    universe_id: int | None = None,
    upc: str | None = None,
) -> list[CommonIssue]:
    """Retrieve a list of issues with optional filtering.

    Args:
        alt_number: Filter by the issue's alternate number.
        character_id: Filter by the creator ID.
        cover_hash: Filter by the hash value of the issue's cover image.
        cover_month: Filter by the cover month (1-12).
        cover_year: Filter by the cover year.
        creator_id: Filter by the creator ID.
        cv_id: Filter by Comic Vine ID.
        foc_date: Filter by an exact Final Order Cutoff (FOC) date.
        foc_date_range_after: Filter for issues with an FOC date after the given date.
        foc_date_range_before: Filter for issues with an FOC date before the given date.
        gcd_id: Filter by Grand Comics Database ID.
        imprint_id: Filter by the associated imprint ID.
        imprint_name: Filter by the associated imprint name.
        missing_cv_id: If True, return only issues missing a Comic Vine ID.
        missing_gcd_id: If True, return only issues missing a Grand Comics Database ID.
        modified_gt: Return issues modified after this datetime.
        number: Filter by the issue number.
        publisher_id: Filter by the publisher ID.
        publisher_name: Filter by the publisher name.
        rating: Filter by the issue rating.
        role_ids: Filter by a list of role IDs.
        series_id: Filter by the series ID.
        series_name: Filter by the series name.
        series_volume: Filter by the series volume number.
        series_year_began: Filter by the year the series began.
        sku: Filter by the distributor SKU.
        store_date: Filter by an exact store date.
        store_date_range_after: Filter for issues with a store date after the given date.
        store_date_range_before: Filter for issues with a store date before the given date.
        team_id: Filter by the team ID.
        universe_id: Filter by the universe ID.
        upc: Filter by the issue's UPC barcode.

    Returns:
        A list of CommonIssue objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={
            "alt_number": alt_number,
            "character_id": character_id,
            "cover_hash": cover_hash,
            "cover_month": cover_month,
            "cover_year": cover_year,
            "creator_id": creator_id,
            "cv_id": cv_id,
            "foc_date": foc_date,
            "foc_date_range_after": foc_date_range_after,
            "foc_date_range_before": foc_date_range_before,
            "gcd_id": gcd_id,
            "imprint_id": imprint_id,
            "imprint_name": imprint_name,
            "missing_cv_id": missing_cv_id,
            "missing_gcd_id": missing_gcd_id,
            "modified_gt": modified_gt,
            "number": number,
            "publisher_id": publisher_id,
            "publisher_name": publisher_name,
            "rating": rating,
            "role_id": ",".join(str(x) for x in role_ids) if role_ids else None,
            "series_id": series_id,
            "series_name": series_name,
            "series_volume": series_volume,
            "series_year_began": series_year_began,
            "sku": sku,
            "store_date": store_date,
            "store_date_range_after": store_date_range_after,
            "store_date_range_before": store_date_range_before,
            "team_id": team_id,
            "universe_id": universe_id,
            "upc": upc,
        }
    )
    try:
        results = self._fetch_list(endpoint="/issue", params=params)
        return TypeAdapter(list[CommonIssue]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_publisher_series

Retrieve a list of series that are part of a specific publisher.

PARAMETER DESCRIPTION
publisher_id

The unique identifier of the publisher.

TYPE: int

RETURNS DESCRIPTION
list[CommonSeries]

A list of CommonSeries objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
def list_publisher_series(self, publisher_id: int) -> list[CommonSeries]:
    """Retrieve a list of series that are part of a specific publisher.

    Args:
        publisher_id: The unique identifier of the publisher.

    Returns:
        A list of CommonSeries objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint=f"/publisher/{publisher_id}/series_list")
        return TypeAdapter(list[CommonSeries]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_publishers

Retrieve a list of publishers with optional filtering.

PARAMETER DESCRIPTION
cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

modified_gt

Return publishers modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter publishers by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonResource]

A list of CommonResource objects representing publishers.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
def list_publishers(
    self,
    cv_id: int | None = None,
    gcd_id: int | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
) -> list[CommonResource]:
    """Retrieve a list of publishers with optional filtering.

    Args:
        cv_id: Filter by Comic Vine ID.
        gcd_id: Filter by Grand Comics Database ID.
        modified_gt: Return publishers modified after this datetime.
        name: Filter publishers by name (partial match).

    Returns:
        A list of CommonResource objects representing publishers.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={"cv_id": cv_id, "gcd_id": gcd_id, "modified_gt": modified_gt, "name": name}
    )
    try:
        results = self._fetch_list(endpoint="/publisher", params=params)
        return TypeAdapter(list[CommonResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_reading_list_items

Retrieve a list of items that are part of a specific reading list.

PARAMETER DESCRIPTION
reading_list_id

The unique identifier of the reading list.

TYPE: int

RETURNS DESCRIPTION
list[ReadingListItem]

A list of ReadingListItem objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
def list_reading_list_items(self, reading_list_id: int) -> list[ReadingListItem]:
    """Retrieve a list of items that are part of a specific reading list.

    Args:
        reading_list_id: The unique identifier of the reading list.

    Returns:
        A list of ReadingListItem objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint=f"/reading_list/{reading_list_id}/items")
        return TypeAdapter(list[ReadingListItem]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_reading_lists

Retrieve a list of reading lists with optional filtering.

PARAMETER DESCRIPTION
attribution_source

Filter by the source of attribution.

TYPE: AttributionSource | None DEFAULT: None

average_rating_gte

Filter for reading lists with an average rating greater than or equal to this value.

TYPE: int | None DEFAULT: None

is_private

Filter by privacy status.

TYPE: bool | None DEFAULT: None

list_type

Filter by the type of reading list.

TYPE: EventType | None DEFAULT: None

modified_gt

Return reading lists modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter reading lists by name (partial match).

TYPE: str | None DEFAULT: None

publisher_name

Filter by the publisher name.

TYPE: str | None DEFAULT: None

user_id

Filter by the owner user's ID.

TYPE: int | None DEFAULT: None

username

Filter by the owner user's username.

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[BaseReadingList]

A list of BaseReadingList objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
def list_reading_lists(
    self,
    attribution_source: AttributionSource | None = None,
    average_rating_gte: int | None = None,
    is_private: bool | None = None,
    list_type: EventType | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
    publisher_name: str | None = None,
    user_id: int | None = None,
    username: str | None = None,
) -> list[BaseReadingList]:
    """Retrieve a list of reading lists with optional filtering.

    Args:
        attribution_source: Filter by the source of attribution.
        average_rating_gte: Filter for reading lists with an average rating greater than or
            equal to this value.
        is_private: Filter by privacy status.
        list_type: Filter by the type of reading list.
        modified_gt: Return reading lists modified after this datetime.
        name: Filter reading lists by name (partial match).
        publisher_name: Filter by the publisher name.
        user_id: Filter by the owner user's ID.
        username: Filter by the owner user's username.

    Returns:
        A list of BaseReadingList objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={
            "attribution_source": attribution_source,
            "average_rating_gte": average_rating_gte,
            "is_private": is_private,
            "list_type": list_type,
            "modified_gt": modified_gt,
            "name": name,
            "publisher": publisher_name,
            "user": user_id,
            "username": username,
        }
    )
    try:
        results = self._fetch_list(endpoint="/reading_list", params=params)
        return TypeAdapter(list[BaseReadingList]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_roles

Retrieve a list of roles with optional filtering.

PARAMETER DESCRIPTION
modified_gt

Return roles modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter roles by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[GenericResource]

A list of GenericResource objects representing roles.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
def list_roles(
    self, modified_gt: datetime | None = None, name: str | None = None
) -> list[GenericResource]:
    """Retrieve a list of roles with optional filtering.

    Args:
        modified_gt: Return roles modified after this datetime.
        name: Filter roles by name (partial match).

    Returns:
        A list of GenericResource objects representing roles.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(data={"modified_gt": modified_gt, "name": name})
    try:
        results = self._fetch_list(endpoint="/role", params=params)
        return TypeAdapter(list[GenericResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_series

Retrieve a list of series with optional filtering.

PARAMETER DESCRIPTION
character_id

Filter by the character ID.

TYPE: int | None DEFAULT: None

creator_id

Filter by the creator ID.

TYPE: int | None DEFAULT: None

cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

imprint_id

Filter by the imprint ID.

TYPE: int | None DEFAULT: None

imprint_name

Filter by the associated imprint name.

TYPE: str | None DEFAULT: None

missing_cv_id

If True, return only series missing a Comic Vine ID.

TYPE: bool | None DEFAULT: None

missing_gcd_id

If True, return only series missing a Grand Comics Database ID.

TYPE: bool | None DEFAULT: None

modified_gt

Return series modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter series by name (partial match).

TYPE: str | None DEFAULT: None

publisher_id

Filter by the publisher ID.

TYPE: int | None DEFAULT: None

publisher_name

Filter by the publisher name.

TYPE: str | None DEFAULT: None

role_ids

Filter by a list of role IDs.

TYPE: list[int] | None DEFAULT: None

series_type_name

Filter by the series type name.

TYPE: str | None DEFAULT: None

series_type_id

Filter by the series type ID.

TYPE: int | None DEFAULT: None

status

Filter by the publication status.

TYPE: int | None DEFAULT: None

team_id

Filter by the team ID.

TYPE: int | None DEFAULT: None

universe_id

Filter by the universe ID.

TYPE: int | None DEFAULT: None

volume

Filter by the series volume number.

TYPE: int | None DEFAULT: None

year_began

Filter by the year the series began.

TYPE: int | None DEFAULT: None

year_end

Filter by the year the series ended.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonSeries]

A list of CommonSeries objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
def list_series(
    self,
    character_id: int | None = None,
    creator_id: int | None = None,
    cv_id: int | None = None,
    gcd_id: int | None = None,
    imprint_id: int | None = None,
    imprint_name: str | None = None,
    missing_cv_id: bool | None = None,
    missing_gcd_id: bool | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
    publisher_id: int | None = None,
    publisher_name: str | None = None,
    role_ids: list[int] | None = None,
    series_type_name: str | None = None,
    series_type_id: int | None = None,
    status: int | None = None,
    team_id: int | None = None,
    universe_id: int | None = None,
    volume: int | None = None,
    year_began: int | None = None,
    year_end: int | None = None,
) -> list[CommonSeries]:
    """Retrieve a list of series with optional filtering.

    Args:
        character_id: Filter by the character ID.
        creator_id: Filter by the creator ID.
        cv_id: Filter by Comic Vine ID.
        gcd_id: Filter by Grand Comics Database ID.
        imprint_id: Filter by the imprint ID.
        imprint_name: Filter by the associated imprint name.
        missing_cv_id: If True, return only series missing a Comic Vine ID.
        missing_gcd_id: If True, return only series missing a Grand Comics Database ID.
        modified_gt: Return series modified after this datetime.
        name: Filter series by name (partial match).
        publisher_id: Filter by the publisher ID.
        publisher_name: Filter by the publisher name.
        role_ids: Filter by a list of role IDs.
        series_type_name: Filter by the series type name.
        series_type_id: Filter by the series type ID.
        status: Filter by the publication status.
        team_id: Filter by the team ID.
        universe_id: Filter by the universe ID.
        volume: Filter by the series volume number.
        year_began: Filter by the year the series began.
        year_end: Filter by the year the series ended.

    Returns:
        A list of CommonSeries objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={
            "character_id": character_id,
            "creator_id": creator_id,
            "cv_id": cv_id,
            "gcd_id": gcd_id,
            "imprint_id": imprint_id,
            "imprint_name": imprint_name,
            "missing_cv_id": missing_cv_id,
            "missing_gcd_id": missing_gcd_id,
            "modified_gt": modified_gt,
            "name": name,
            "publisher_id": publisher_id,
            "publisher_name": publisher_name,
            "role_id": ",".join(str(x) for x in role_ids) if role_ids else None,
            "series_type": series_type_name,
            "series_type_id": series_type_id,
            "status": status,
            "team_id": team_id,
            "universe_id": universe_id,
            "volume": volume,
            "year_began": year_began,
            "year_end": year_end,
        }
    )
    try:
        results = self._fetch_list(endpoint="/series", params=params)
        return TypeAdapter(list[CommonSeries]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_series_issues

Retrieve a list of issues that are part of a specific series.

PARAMETER DESCRIPTION
series_id

The unique identifier of the series.

TYPE: int

RETURNS DESCRIPTION
list[CommonIssue]

A list of CommonIssue objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
def list_series_issues(self, series_id: int) -> list[CommonIssue]:
    """Retrieve a list of issues that are part of a specific series.

    Args:
        series_id: The unique identifier of the series.

    Returns:
        A list of CommonIssue objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint=f"/series/{series_id}/issue_list")
        return TypeAdapter(list[CommonIssue]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_series_types

Retrieve a list of series types with optional filtering.

PARAMETER DESCRIPTION
modified_gt

Return series types modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter series types by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[GenericResource]

A list of GenericResource objects representing series types.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
def list_series_types(
    self, modified_gt: datetime | None = None, name: str | None = None
) -> list[GenericResource]:
    """Retrieve a list of series types with optional filtering.

    Args:
        modified_gt: Return series types modified after this datetime.
        name: Filter series types by name (partial match).

    Returns:
        A list of GenericResource objects representing series types.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(data={"modified_gt": modified_gt, "name": name})
    try:
        results = self._fetch_list(endpoint="/series_type", params=params)
        return TypeAdapter(list[GenericResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_team_issues

Retrieve a list of issues that are part of a specific team.

PARAMETER DESCRIPTION
team_id

The unique identifier of the team.

TYPE: int

RETURNS DESCRIPTION
list[CommonIssue]

A list of CommonIssue objects.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
def list_team_issues(self, team_id: int) -> list[CommonIssue]:
    """Retrieve a list of issues that are part of a specific team.

    Args:
        team_id: The unique identifier of the team.

    Returns:
        A list of CommonIssue objects.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    try:
        results = self._fetch_list(endpoint=f"/team/{team_id}/issue_list")
        return TypeAdapter(list[CommonIssue]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_teams

Retrieve a list of teams with optional filtering.

PARAMETER DESCRIPTION
cv_id

Filter by Comic Vine ID.

TYPE: int | None DEFAULT: None

gcd_id

Filter by Grand Comics Database ID.

TYPE: int | None DEFAULT: None

modified_gt

Return teams modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter teams by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonResource]

A list of CommonResource objects representing teams.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
def list_teams(
    self,
    cv_id: int | None = None,
    gcd_id: int | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
) -> list[CommonResource]:
    """Retrieve a list of teams with optional filtering.

    Args:
        cv_id: Filter by Comic Vine ID.
        gcd_id: Filter by Grand Comics Database ID.
        modified_gt: Return teams modified after this datetime.
        name: Filter teams by name (partial match).

    Returns:
        A list of CommonResource objects representing teams.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={"cv_id": cv_id, "gcd_id": gcd_id, "modified_gt": modified_gt, "name": name}
    )
    try:
        results = self._fetch_list(endpoint="/team", params=params)
        return TypeAdapter(list[CommonResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err

list_universes

Retrieve a list of universes with optional filtering.

PARAMETER DESCRIPTION
designation

Filter universes by designation (partial match).

TYPE: str | None DEFAULT: None

modified_gt

Return universes modified after this datetime.

TYPE: datetime | None DEFAULT: None

name

Filter universes by name (partial match).

TYPE: str | None DEFAULT: None

RETURNS DESCRIPTION
list[CommonResource]

A list of CommonResource objects representing universes.

RAISES DESCRIPTION
ServiceError

If the API response is invalid or validation fails.

AuthenticationError

If credentials are invalid.

RateLimitError

If the API rate limit is exceeded.

Source code in seagrin/metron.py
Python
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
def list_universes(
    self,
    designation: str | None = None,
    modified_gt: datetime | None = None,
    name: str | None = None,
) -> list[CommonResource]:
    """Retrieve a list of universes with optional filtering.

    Args:
        designation: Filter universes by designation (partial match).
        modified_gt: Return universes modified after this datetime.
        name: Filter universes by name (partial match).

    Returns:
        A list of CommonResource objects representing universes.

    Raises:
        ServiceError: If the API response is invalid or validation fails.
        AuthenticationError: If credentials are invalid.
        RateLimitError: If the API rate limit is exceeded.
    """
    params = filter_params(
        data={"designation": designation, "modified_gt": modified_gt, "name": name}
    )
    try:
        results = self._fetch_list(endpoint="/universe", params=params)
        return TypeAdapter(list[CommonResource]).validate_python(results)
    except ValidationError as err:
        raise ServiceError(err) from err