bookops_worldcat.utils
Shared utilities module.
prep_oclc_number_str
prep_oclc_number_str(oclcNumber: str) -> str
Checks for OCLC prefixes and removes them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
oclcNumber |
str
|
OCLC record as string |
required |
Returns:
Type | Description |
---|---|
str
|
oclcNumber as int |
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 |
|
verify_oclc_number
verify_oclc_number(oclcNumber: Union[int, str]) -> str
Verifies a valid looking OCLC number is passed and normalize it as integer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
oclcNumber |
Union[int, str]
|
OCLC record number |
required |
Returns:
Type | Description |
---|---|
str
|
oclcNumber |
Source code in bookops_worldcat\utils.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
verify_oclc_numbers
verify_oclc_numbers(
oclcNumbers: Union[str, List[Union[str, int]]]
) -> List[str]
Parses and verifies list of oclcNumbers
Parameters:
Name | Type | Description | Default |
---|---|---|---|
oclcNumbers |
Union[str, List[Union[str, int]]]
|
list of OCLC control numbers for which holdings should be set; they can be integers or strings with or without OCLC # prefix; if str the numbers must be separated by comma |
required |
Returns: vetted_numbers: list of vetted oclcNumbers
Source code in bookops_worldcat\utils.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|