|
6 | 6 | import re |
7 | 7 | import uuid |
8 | 8 | from getpass import getuser |
9 | | -from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Union |
10 | | - |
11 | | -from typing_extensions import TypedDict |
| 9 | +from typing import IO, Any, Callable, Dict, List, Optional, Tuple, TypedDict, Union |
12 | 10 |
|
13 | 11 |
|
14 | 12 | def _whoami() -> Tuple[str, str]: |
@@ -112,24 +110,26 @@ def _valid_orcid(orcid: Optional[str]) -> str: |
112 | 110 | "oa:motivatedBy": Dict[str, str], |
113 | 111 | }, |
114 | 112 | ) |
115 | | -Aggregate = TypedDict( |
116 | | - "Aggregate", |
117 | | - { |
118 | | - "uri": Optional[str], |
119 | | - "bundledAs": Optional[Dict[str, Any]], |
120 | | - "mediatype": Optional[str], |
121 | | - "conformsTo": Optional[Union[str, List[str]]], |
122 | | - "createdOn": Optional[str], |
123 | | - "createdBy": Optional[Dict[str, str]], |
124 | | - }, |
125 | | - total=False, |
126 | | -) |
| 113 | + |
| 114 | + |
| 115 | +class Aggregate(TypedDict, total=False): |
| 116 | + """RO Aggregate class.""" |
| 117 | + |
| 118 | + uri: Optional[str] |
| 119 | + bundledAs: Optional[Dict[str, Any]] |
| 120 | + mediatype: Optional[str] |
| 121 | + conformsTo: Optional[Union[str, List[str]]] |
| 122 | + createdOn: Optional[str] |
| 123 | + createdBy: Optional[Dict[str, str]] |
| 124 | + |
| 125 | + |
127 | 126 | # Aggregate.bundledAs is actually type Aggregate, but cyclic definitions are not supported |
128 | | -AuthoredBy = TypedDict( |
129 | | - "AuthoredBy", |
130 | | - {"orcid": Optional[str], "name": Optional[str], "uri": Optional[str]}, |
131 | | - total=False, |
132 | | -) |
| 127 | +class AuthoredBy(TypedDict, total=False): |
| 128 | + """RO AuthoredBy class.""" |
| 129 | + |
| 130 | + orcid: Optional[str] |
| 131 | + name: Optional[str] |
| 132 | + uri: Optional[str] |
133 | 133 |
|
134 | 134 |
|
135 | 135 | def checksum_copy( |
|
0 commit comments