← Về thư mục
skills/peer-review/scripts/_common.py
- ValidationError · class · L26-L27 — class ValidationError(ValueError)
- _duplicate_safe_object · function · L30-L36 — def _duplicate_safe_object(pairs: list[tuple[str, Any]]) -> dict[str, Any]
- safe_input_path · function · L39-L59 — def safe_input_path(raw_path: str | Path, suffixes: Iterable[str]) -> Path
- safe_output_path · function · L62-L85 — def safe_output_path( raw_path: str | Path, suffix: str, *, force: bool = False ) -> Path
- read_json · function · L88-L102 — def read_json(raw_path: str | Path) -> Any
- read_markdown · function · L105-L114 — def read_markdown(raw_path: str | Path) -> str
- read_csv_records · function · L117-L180 — def read_csv_records( raw_path: str | Path, *, required_fields: Iterable[str], allowed_fields: Iterable[str] | None = None, max_rows: int = MAX_ROWS, ) -> list[dict[str, str]]
- require_object · function · L183-L186 — def require_object(value: Any, context: str) -> dict[str, Any]
- require_exact_keys · function · L189-L203 — def require_exact_keys( value: dict[str, Any], *, required: Iterable[str], optional: Iterable[str] = (), context: str, ) -> None
- require_list · function · L206-L219 — def require_list( value: Any, context: str, *, minimum: int = 0, maximum: int = MAX_LIST_ITEMS, ) -> list[Any]
- require_text · function · L222-L241 — def require_text( value: Any, context: str, *, allow_empty: bool = False, minimum: int = 1, maximum: int = MAX_TEXT_CHARS, ) -> str
- require_bool · function · L244-L247 — def require_bool(value: Any, context: str) -> bool
- require_enum · function · L250-L257 — def require_enum(value: Any, choices: Iterable[str], context: str) -> str
- require_identifier · function · L260-L264 — def require_identifier(value: Any, context: str) -> str
- require_unique · function · L267-L277 — def require_unique(values: Iterable[str], context: str) -> None
- require_text_list · function · L280-L291 — def require_text_list( value: Any, context: str, *, minimum: int = 0, maximum: int = 100, ) -> list[str]
- require_identifier_list · function · L294-L307 — def require_identifier_list( value: Any, context: str, *, minimum: int = 0, maximum: int = 100, ) -> list[str]
- split_identifiers · function · L310-L321 — def split_identifiers( value: Any, context: str, *, allow_empty: bool = False ) -> list[str]
- require_iso_date · function · L324-L330 — def require_iso_date(value: Any, context: str) -> str
- require_url · function · L333-L337 — def require_url(value: Any, context: str, *, allow_empty: bool = False) -> str
- require_doi · function · L340-L344 — def require_doi(value: Any, context: str, *, allow_empty: bool = False) -> str
- atomic_write_text · function · L347-L369 — def atomic_write_text( destination: Path, text: str, *, mode: int = 0o600 ) -> Path
- write_json_report · function · L372-L381 — def write_json_report( data: Any, output: str | Path | None, *, force: bool = False ) -> None
- write_markdown · function · L384-L388 — def write_markdown( text: str, output: str | Path, *, force: bool = False ) -> Path
- issue · function · L391-L393 — def issue(code: str, field: str) -> dict[str, str]
- error_exit · function · L396-L398 — def error_exit(exc: ValidationError) -> int