module documentation
URN parsing, project-name mapping, and schema transformation utilities.
| Class | |
Transforms schemas between legacy (old) and new format. |
| Function | get |
Extract the trailing identifier from a URN. |
| Function | get |
Extract the project name from a URN. |
| Function | get |
Extract the type segment from a URN. |
| Function | is |
Check whether urn matches the RFC 2141 URN syntax. |
| Function | map |
Recursively replace a URN prefix in all string values of obj. |
| Constant | _URN |
Undocumented |
Extract the trailing identifier from a URN.
Returns the segment after the last colon.
| Parameters | |
urn:str | A valid URN string. |
| Returns | |
str | The identifier. |
| Raises | |
ValueError | If urn is not a valid URN. |
Extract the project name from a URN.
Returns the segment between the first and second colons.
| Parameters | |
urn:str | A valid URN string. |
| Returns | |
str | The project name. |
| Raises | |
ValueError | If urn is not a valid URN. |
Extract the type segment from a URN.
Returns the segment between the second and last colons.
| Parameters | |
urn:str | A valid URN string. |
| Returns | |
str | The type segment. |
| Raises | |
ValueError | If urn is not a valid URN. |
Check whether urn matches the RFC 2141 URN syntax.
| Parameters | |
urn:str | The string to test. |
| Returns | |
bool | True if urn is a valid URN. |
def map_project_name(obj:
dict | list | str | Any, from_urn: str, to_urn: str) -> dict | list | str | Any:
¶
Recursively replace a URN prefix in all string values of obj.
| Parameters | |
obj:dict | list | str | Any | The object to process (dict, list, str, or other). |
fromstr | URN prefix to replace. |
tostr | Replacement URN prefix. |
| Returns | |
dict | list | str | Any | A copy of obj with URN prefixes replaced. |
_URN_PATTERN =
¶
Undocumented
| Value |
|