pySemanticSlides API Documentation
doi
Created on 2023-02-12
@author: wf
DOI
dataclass
get DOI data
Source code in slides/doi.py
12 13 14 15 16 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 47 48 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 74 75 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 |
|
debug_dump(d)
dump the given dict if debug mode is on
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d(dict) |
the dictionary to dump |
required |
Source code in slides/doi.py
20 21 22 23 24 25 26 27 28 |
|
fetchBibTexDict()
get a latex BibTexDict for my doi
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
a dict with bibliographic metadata in bibtex latex format |
Source code in slides/doi.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
fetchBibtexMeta()
get the meta data for my doi by getting the bibtext JSON result for the doi
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
metadata |
Source code in slides/doi.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
fetchCiteprocMeta()
get the meta data for my doi by getting the Citeproc JSON result for the doi
see https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
metadata |
Source code in slides/doi.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
fetchMeta(headers)
get the metadata for my doi
Parameters:
Name | Type | Description | Default |
---|---|---|---|
headers(dict) |
the headers to use |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
the metadata according to the given headers |
Source code in slides/doi.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
fetchPlainTextBibTexDict()
get a plain text BibTexDict for my doi
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
a dict with bibliographic metadata in bibtex utf-8 (no latex) format |
Source code in slides/doi.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
keyvalue_parser
Created on 2023-02-14
@author: wf
BaseKeyValueParser
general KeyValue Parser
Source code in slides/keyvalue_parser.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 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 |
|
__init__(config)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config(KeyValueParserConfig) |
the configuration to use |
required |
Source code in slides/keyvalue_parser.py
102 103 104 105 106 107 108 109 110 111 |
|
add_error(error_msg)
add the given error to my list of errors
Parameters:
Name | Type | Description | Default |
---|---|---|---|
error_msg(str) |
the error to add |
required |
Source code in slides/keyvalue_parser.py
122 123 124 125 126 127 128 129 130 131 |
|
getStrippedValues(value_list)
strip all values in the given value list
Source code in slides/keyvalue_parser.py
141 142 143 144 145 146 147 148 149 150 151 |
|
handleErrors(text)
handle my error with respect to the given text to pars
Source code in slides/keyvalue_parser.py
133 134 135 136 137 138 139 |
|
setKeydefs(keydefs)
set my key definitions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keydefs(List[Keydef]) |
a list of keyword definitions |
required |
Source code in slides/keyvalue_parser.py
113 114 115 116 117 118 119 120 |
|
KeyValueParser
Bases: BaseKeyValueParser
Key Value Parser (which won't handle all details properly) see https://stackoverflow.com/a/75270267/1497139
Source code in slides/keyvalue_parser.py
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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
|
__init__(config)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config(KeyValueParserConfig) |
the configuration to use |
required |
Source code in slides/keyvalue_parser.py
219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
getKeyValues(text)
get key/value pairs from the given text using the configured keys definition
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text(str) |
the text to parser |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
the resulting key-value pairs |
Source code in slides/keyvalue_parser.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
|
setKeydefs(keydefs)
overwrite how to set my key definitions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keydefs(List[Keydef]) |
a list of keyword definitions |
required |
Source code in slides/keyvalue_parser.py
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 |
|
KeyValueParserConfig
dataclass
a configuration for a key/value Parser
Source code in slides/keyvalue_parser.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
KeyValueSplitParser
Bases: BaseKeyValueParser
Key / Value Parser
see https://stackoverflow.com/questions/75266188/pyparsing-syntax-tree-from-named-value-list/75270267#75270267
Source code in slides/keyvalue_parser.py
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 |
|
getKeyValues(text)
get key/value pairs from the given text using the configured keys definition
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text(str) |
the text to parser |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
the resulting key-value pairs |
Source code in slides/keyvalue_parser.py
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 |
|
Keydef
dataclass
a key definition
Source code in slides/keyvalue_parser.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
as_dict(keydefs)
classmethod
convert the given list of keydefs to a dict by keyword
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keydefs(list) |
the list of key defs |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
Dict[str, Keydef]
|
a dict keyword -> Keydef |
Source code in slides/keyvalue_parser.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
SimpleKeyValueParser
Bases: BaseKeyValueParser
a simple key value parser (which won't handle quote properly)
Source code in slides/keyvalue_parser.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
|
getKeyValues(text)
get key/value pairs from the given text using the configured keys definition
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text(str) |
the text to parser |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
the resulting key-value pairs |
Source code in slides/keyvalue_parser.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
|
Split
quoted string splitter
Source code in slides/keyvalue_parser.py
52 53 54 55 56 57 58 59 60 61 62 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 91 92 93 94 95 |
|
__init__(delim=',', quote="'", unicode_chars='•→–', keep_quotes=True)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
delim(str) |
the delimiter char, default comma |
required | |
quote(str) |
the quote char, default single quote |
required | |
unicode_chars(str) |
unicode characters to allow |
required | |
keep_quotes(str) |
if True keep the quoted strings if False remove quotes |
required |
Source code in slides/keyvalue_parser.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
split(text)
split the given text with my delim acknowleding my quote char for quoted strings
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text(str) |
the text to split |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
a list of strings |
Source code in slides/keyvalue_parser.py
83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
semslides
Created on 2023-02-23
@author: wf
SemSlides
a semantic mediawiki for slides
Source code in slides/semslides.py
14 15 16 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 |
|
__init__(args)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args(Args) |
my command line arguments |
required |
Source code in slides/semslides.py
19 20 21 22 23 24 25 26 |
|
getArgParser(version_msg)
classmethod
Setup command line argument parser
Parameters:
Name | Type | Description | Default |
---|---|---|---|
description(str) |
the description |
required | |
version_msg(str) |
the version message |
required |
Returns:
Name | Type | Description |
---|---|---|
ArgumentParser |
ArgumentParser
|
the argument parser |
Source code in slides/semslides.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
main(argv=None)
main routine
Source code in slides/semslides.py
48 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 74 75 76 |
|
slidewalker
Created on 2022-04-07
@author: wf
PPT
Bases: object
PowerPoint Presentation with lecture
Source code in slides/slidewalker.py
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 |
|
__init__(filepath, pageHeight=297)
Constructor
Source code in slides/slidewalker.py
163 164 165 166 167 168 169 170 171 172 173 174 |
|
asDict()
convert me to a dict
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
summary |
Source code in slides/slidewalker.py
189 190 191 192 193 194 195 196 197 198 199 200 |
|
getSlides(excludeHiddenSlides=False, runDelim=None)
get my slides
Parameters:
Name | Type | Description | Default |
---|---|---|---|
excludeHiddenSlides(bool) |
if True exclude hidden Slides |
required |
Source code in slides/slidewalker.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
open()
open my presentation
Source code in slides/slidewalker.py
202 203 204 205 206 207 208 209 210 211 212 |
|
summary()
show a summary of the given lecture
Source code in slides/slidewalker.py
176 177 178 179 180 181 182 183 184 185 186 187 |
|
Slide
Bases: object
a single slide
Source code in slides/slidewalker.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 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 74 75 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 114 115 116 117 118 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 |
|
__init__(ppt, slide, page, pdf_page, runDelim=None)
constructor
Source code in slides/slidewalker.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
getLayoutName()
get the layoutName of this slide
Source code in slides/slidewalker.py
150 151 152 153 154 155 |
|
getNotes(yRange=None, useShapes=False)
get the notes
Return
str: the notes for this slide
Source code in slides/slidewalker.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
getText(yRange=None)
get the text in the given yRange
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yRange |
|
None
|
Return
str: the notes for this slide
Source code in slides/slidewalker.py
121 122 123 124 125 126 127 128 129 130 131 132 |
|
getText4Shapes(shapes, yRange, runDelim=None)
get the text for the given shapes in the given yRange using the given run delimiter
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shapes |
|
required | |
yRange |
|
required | |
runDelim(str) |
the delimiter for text runs |
required |
Source code in slides/slidewalker.py
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 114 115 116 117 118 119 |
|
SlideWalker
Bases: object
get meta information for all powerpoint presentations in a certain folder
Source code in slides/slidewalker.py
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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
__init__(rootFolder, debug=False)
Constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rootFolder(str) |
the path to the root folder of the analysis |
required | |
debug(bool) |
if True switch on debugging |
required |
Source code in slides/slidewalker.py
244 245 246 247 248 249 250 251 252 253 |
|
asCsv(listOfDicts, fieldNames=None)
convert the given list of dicts to CSV see https://stackoverflow.com/a/9157370/1497139
Parameters:
Name | Type | Description | Default |
---|---|---|---|
listOfDicts(list) |
the table to convert |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the CSV formated result |
Source code in slides/slidewalker.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
|
dumpInfo(outputFormat, excludeHiddenSlides=False, runDelim=None, slideDetails=False)
dump information about the lecture in the given format
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outputFormat(str) |
csv, json or txt |
required | |
excludeHiddenSlides(bool) |
If True hidden lecture will be excluded and also ignored in the page counting |
required | |
runDelim(str) |
the delimiter to use for powerpoint slide text |
required |
Source code in slides/slidewalker.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
|
dumpInfoToString(outputFormat, excludeHiddenSlides=True)
dump information about the presentations in the given format
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outputFormat(str) |
csv, json or txt |
required | |
excludeHiddenSlides(bool) |
If True hidden lecture will be excluded and also ignored in the page counting |
required |
Source code in slides/slidewalker.py
354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
findFiles(path, ext)
find Files with the given extension in the given path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path(str) |
the path to start with |
required | |
ext(str) |
the extension to search for |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
a list of files found |
Source code in slides/slidewalker.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
yieldPowerPointFiles(verbose=False)
generate my power point files
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verbose(bool) |
if True show information about the processing |
required |
Source code in slides/slidewalker.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
|
yieldSlides(ppt, verbose, excludeHiddenSlides=False, runDelim=None, slideDetails=False)
yield all slides
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verbose(bool) |
if True print details on stdout |
required | |
excludeHiddenSlides(bool) |
If True hidden lecture will be excluded and also ignored in the page counting |
required | |
runDelim(str) |
the delimiter to use for powerpoint slide text |
required |
Source code in slides/slidewalker.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
|
YRange
an Y Range
Source code in slides/slidewalker.py
22 23 24 25 26 27 28 29 30 31 32 33 |
|
main(argv=None)
main routine
Source code in slides/slidewalker.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|
version
Created on 2022-04-01
@author: wf
Version
Bases: object
Version handling for pysotsog
Source code in slides/version.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|