bookops_worldcat.utils
Shared utilities module.
prep_oclc_number_str
prep_oclc_number_str(oclcNumber: str) -> str
Checks for OCLC prefixes and removes them.
PARAMETER | DESCRIPTION |
---|---|
oclcNumber |
OCLC record number as string
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
str
|
|
RAISES | DESCRIPTION |
---|---|
InvalidOclcNumber
|
If |
Source code in bookops_worldcat\utils.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
verify_oclc_number
verify_oclc_number(oclcNumber: Union[int, str]) -> str
Verifies a valid looking OCLC number is passed and normalize it as integer.
PARAMETER | DESCRIPTION |
---|---|
oclcNumber |
OCLC record number as string or integer |
RETURNS | DESCRIPTION |
---|---|
str
|
|
RAISES | DESCRIPTION |
---|---|
InvalidOclcNumber
|
If |
Source code in bookops_worldcat\utils.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
verify_oclc_numbers
verify_oclc_numbers(
oclcNumbers: Union[int, str, List[Union[str, int]]]
) -> List[str]
Parses and verifies list of oclcNumbers
PARAMETER | DESCRIPTION |
---|---|
oclcNumbers |
List of OCLC control numbers. Control numbers can be integers or strings with or without OCLC # prefix. If str, the numbers must be separated by commas. If int, only one number will be parsed. Lists may contain strings or integers or a combination of both. |
RETURNS | DESCRIPTION |
---|---|
List[str]
|
|
RAISES | DESCRIPTION |
---|---|
InvalidOclcNumber
|
If |
Source code in bookops_worldcat\utils.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|