foliolib.folio.api.quickMarc.Marcspecifications

class foliolib.folio.api.quickMarc.Marcspecifications(tenant: str)

Bases: foliolib.folio.FolioApi

quickMARC MARC Specifications

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

getmarcspecification(recordType, fieldTag)

Get MARC specification by recordType and fieldTag

getmarcspecification(recordType, fieldTag)

Get MARC specification by recordType and fieldTag

GET /marc-specifications/{recordType}/{fieldTag}

Parameters
  • recordType (str) – Record type (enum: [‘bibliographic’, ‘holdings’, ‘authority’], example: bibliographic)

  • fieldTag (str) – Field’s tag (pattern: ^[0-9]{3}$, example: 008)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

  • OkapiRequestNotFound – MARC specification with a given recordType and fieldTag not found

  • OkapiRequestFatalError – Internal server error, e.g. due to misconfiguration

Schema

{
    "type": "object",
    "description": "MARC specification definition",
    "properties": {
        "tag": {
            "description": "Field's tag",
            "type": "string",
            "pattern": "^[0-9]{3}$",
            "example": "008"
        },
        "format": {
            "type": "string",
            "description": "MARC Format",
            "enum": [
                "BIBLIOGRAPHIC",
                "HOLDINGS",
                "AUTHORITY"
            ]
        },
        "label": {
            "description": "Label of the specification",
            "type": "string"
        },
        "url": {
            "description": "Url to details about field spec",
            "type": "string",
            "format": "uri"
        },
        "repeatable": {
            "description": "If this field can appear multiple time in MARC record",
            "type": "boolean"
        },
        "required": {
            "description": "If this field is required in MARC record",
            "type": "boolean"
        },
        "spec": {
            "type": "object",
            "description": "Details of the specification",
            "properties": {
                "types": {
                    "description": "Array of types",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "description": "Specification type definition",
                        "properties": {
                            "code": {
                                "description": "Type codename",
                                "type": "string",
                                "example": "books"
                            },
                            "identifiedBy": {
                                "description": "Conditions used to identify MARC specification type",
                                "type": "object",
                                "properties": {
                                    "or": {
                                        "description": "Single condition",
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "description": "Specification condition definition",
                                            "properties": {
                                                "tag": {
                                                    "description": "Field's tag",
                                                    "type": "string",
                                                    "pattern": "^([0-9]{3})|(LDR)$",
                                                    "example": "LDR"
                                                },
                                                "positions": {
                                                    "description": "Map of condition definitions",
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string",
                                                            "minLength": 1,
                                                            "maxLength": 1,
                                                            "example": "a"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "tag",
                                                "positions"
                                            ]
                                        }
                                    }
                                },
                                "required": [
                                    "or"
                                ]
                            },
                            "items": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "description": "Specification item definition",
                                    "properties": {
                                        "code": {
                                            "description": "Item code",
                                            "type": "string",
                                            "example": "Entered"
                                        },
                                        "name": {
                                            "description": "Item name",
                                            "type": "string",
                                            "example": "Date entered on file"
                                        },
                                        "order": {
                                            "description": "Item order",
                                            "type": "integer",
                                            "example": 0
                                        },
                                        "position": {
                                            "description": "Position in field",
                                            "type": "integer",
                                            "example": 0
                                        },
                                        "length": {
                                            "description": "Length from position",
                                            "type": "integer",
                                            "example": 5
                                        },
                                        "isArray": {
                                            "description": "Is item an array of values",
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "readOnly": {
                                            "description": "Is item read only",
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "allowedValues": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "description": "Specification item value definition",
                                                "properties": {
                                                    "code": {
                                                        "description": "Value code",
                                                        "type": "string",
                                                        "example": "e"
                                                    },
                                                    "name": {
                                                        "description": "Value name",
                                                        "type": "string",
                                                        "example": "Detailed date"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "name",
                                        "order",
                                        "position",
                                        "length",
                                        "isArray",
                                        "readOnly"
                                    ]
                                }
                            }
                        },
                        "required": [
                            "code",
                            "identifiedBy",
                            "items"
                        ]
                    }
                }
            },
            "required": [
                "types"
            ]
        }
    },
    "required": [
        "tag",
        "format",
        "label",
        "url",
        "repeatable",
        "required",
        "spec"
    ]
}