comicbox.box.computed.notes ¶
Read structured metadata back out of a free-text notes field.
Most formats have one notes field and nowhere else to put a tagger name, a timestamp, a release date, a database id or a url, so taggers write all of them into that prose. This module parses each of those back into its own comicbox field.
Grammar read here¶
Tagged with|by <tagger>[ <version>]->taggeron <YYYY-MM-DD[ T]HH:MM:SS...>->updated_at[RELDATE:<date>]->date.cover_date+ partsusing info from <source>paired with[Issue ID <key>]->identifiers[source](ComicTagger’s own stamp)urn:<source>:<type>:<key>->identifiers[source][<source>:<type>:<key>],[CVDB1234]->identifiers[source]
Urls in notes are read one step earlier, by url_identifiers, because the stamp below replaces the whole notes text and a url that lived only in that prose would otherwise be gone.
What the tagger stamp writes back¶
ComicboxComputedStamp._get_computed_notes_stamp rebuilds notes from scratch as Tagged with <tagger> on <ts> [Issue ID <comicvine key>] plus a urn for every identifier. It is a projection of the structured fields, not an edit of the text it replaces, so restamping is lossy as text. Each loss, and why it is not a loss of data:
[RELDATE:...]is not written back. The date it named was parsed intodate.cover_date/year/month/day, which every write format carries, so the date survives; only the prose spelling of it is dropped.- Urls are not written back.
url_identifierscollected them intourlsbefore the stamp ran, andurlsis a real field. using info from <source>is not written back. The source it named is what each urn’s first field says, so the fact survives in a form this parser can read without a second clause to pair it with.- Bracketed
[CVDB1234]-style identifiers come back as urns. Different spelling, same source, type and key. [Issue ID <key>]is written for ComicVine only, for ComicTagger’s benefit. Comicbox reads its own ids back from the urns, which cover every source.- Anything else a human wrote in notes is discarded. That is the one real loss, and it is the point of the field being a stamp: the stamp is only written when the caller asks comicbox to write, convert or export.
ComicboxComputedNotes ¶
Bases: ComicboxComputedUrlIdentifiers
Computed metadata methods for notes field.
Source code in comicbox/box/computed/notes.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
get_computed_from_notes(sub_data) ¶
Parse the tagger, updated_at & identifier from notes if not already set.
Source code in comicbox/box/computed/notes.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |