citer/build/lib/citer/models.py
2026-02-12 23:55:07 -05:00

27 lines
581 B
Python

from dataclasses import dataclass
from typing import List, Optional
@dataclass
class Author:
given: str
family: str
@property
def full_name(self) -> str:
return f"{self.given} {self.family}".strip()
@dataclass
class WorkMetadata:
title: str
authors: List[Author]
year: Optional[int]
container_title: Optional[str] = None
volume: Optional[str] = None
issue: Optional[str] = None
pages: Optional[str] = None
doi: Optional[str] = None
url: Optional[str] = None
source: str = ""
identifier: Optional[str] = None