📘 Inkycal API Reference¶
Welcome to the full API reference for Inkycal.
This page contains:
- A complete list of all available modules
- API documentation for the Canvas and Display classes
- Utilities included in
inkycal.utils - Auto-generated API docs (if mkdocstrings is enabled)
🧩 Architecture Summary¶
Inkycal is composed of:
| Component | Location | Description |
|---|---|---|
| Modules | inkycal/modules/ |
Pluggable units (Calendar, Weather, Stocks, etc.) |
| Display Interface | inkycal/display/ |
Hardware drivers for supported ePaper displays |
| Canvas Engine | inkycal/utils/canvas.py |
Text / icon / drawing engine used by all modules |
| Utilities | inkycal/utils/ |
Helpers (timezone, borders, networking, line charts) |
Most modules extend:
inkycal.modules.template.InkycalModule
📦 Built-in Modules¶
Inkycal ships with the following modules, available via the Web-UI and automatically registered via:
inkycal.modules.__init__.py
Module Index¶
| Name | Class | Import Path |
|---|---|---|
| Agenda | Agenda |
inkycal.modules.inkycal_agenda.Agenda |
| Calendar | Calendar |
inkycal.modules.inkycal_calendar.Calendar |
| Feeds | Feeds |
inkycal.modules.inkycal_feeds.Feeds |
| Image | Inkyimage |
inkycal.modules.inky_image.Inkyimage |
| Jokes | Jokes |
inkycal.modules.inkycal_jokes.Jokes |
| Server Status | Inkyserver |
inkycal.modules.inkycal_server.Inkyserver |
| Slideshow | Slideshow |
inkycal.modules.inkycal_slideshow.Slideshow |
| Stocks | Stocks |
inkycal.modules.inkycal_stocks.Stocks |
| Text File Renderer | TextToDisplay |
inkycal.modules.inkycal_textfile_to_display.TextToDisplay |
| Tindie Stats | Tindie |
inkycal.modules.inkycal_tindie.Tindie |
| Todoist | Todoist |
inkycal.modules.inkycal_todoist.Todoist |
| Weather | Weather |
inkycal.modules.inkycal_weather.Weather |
| Webshot | Webshot |
inkycal.modules.inkycal_webshot.Webshot |
| XKCD | Xkcd |
inkycal.modules.inkycal_xkcd.Xkcd |
📚 Module Reference (Auto-Generated)¶
Template Module¶
::: inkycal.modules.template
Calendar¶
Inkycal Calendar Module Copyright by aceinnolab
Calendar
¶
Bases: InkycalModule
Calendar class Create monthly calendar and show events from given iCalendars
Source code in inkycal/modules/inkycal_calendar.py
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 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 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 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 386 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 423 424 425 426 427 428 429 430 431 | |
__init__(config)
¶
Initialize inkycal_calendar module
Source code in inkycal/modules/inkycal_calendar.py
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 | |
flatten(values)
staticmethod
¶
Flatten the values.
Source code in inkycal/modules/inkycal_calendar.py
91 92 93 94 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_calendar.py
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 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 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 386 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 423 424 425 426 427 428 429 430 431 | |
Weather¶
Inkycal weather module Copyright by aceinnolab
Weather
¶
Bases: InkycalModule
Weather class parses weather details from openweathermap
Source code in inkycal/modules/inkycal_weather.py
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 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 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 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 386 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 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | |
__init__(config)
¶
Initialize inkycal_weather module
Source code in inkycal/modules/inkycal_weather.py
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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_weather.py
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 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 386 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 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | |
Feeds¶
Feeds module for InkyCal Project Copyright by aceinnolab
Feeds
¶
Bases: InkycalModule
RSS class parses rss/atom feeds from given urls
Source code in inkycal/modules/inkycal_feeds.py
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 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 156 | |
__init__(config)
¶
Initialize inkycal_feeds module
Source code in inkycal/modules/inkycal_feeds.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_feeds.py
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 156 | |
Stocks¶
Stocks Module for Inkycal Project
Version 0.6: Dropped matplotlib dependency in favour of render_line_chart function Version 0.5: Added improved precision by using new priceHint parameter of yfinance Version 0.4: Added charts Version 0.3: Added support for web-UI of Inkycal 2.0.0 Version 0.2: Migration to Inkycal 2.0.0 Version 0.1: Migration to Inkycal 2.0.0b
by https://github.com/worstface
Stocks
¶
Bases: InkycalModule
Source code in inkycal/modules/inkycal_stocks.py
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 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 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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_stocks.py
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 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 | |
Image Module¶
Inkycal Image Module Copyright by aceinnolab
Inkyimage
¶
Bases: InkycalModule
Displays an image from URL or local path
Source code in inkycal/modules/inkycal_image.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 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 | |
__init__(config)
¶
Initialize module
Source code in inkycal/modules/inkycal_image.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_image.py
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 | |
Agenda¶
Inkycal Agenda Module Copyright by aceinnolab
Agenda
¶
Bases: InkycalModule
Agenda class Create agenda and show events from given icalendars
Source code in inkycal/modules/inkycal_agenda.py
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 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 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 | |
__init__(config)
¶
Initialize inkycal_agenda module
Source code in inkycal/modules/inkycal_agenda.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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_agenda.py
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 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 | |
Todoist¶
Inkycal Todoist Module Copyright by aceinnolab
Todoist
¶
Bases: InkycalModule
Todoist api class parses todos from the todoist api.
Source code in inkycal/modules/inkycal_todoist.py
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 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 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 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 386 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 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
__init__(config)
¶
Initialize inkycal_rss module
Source code in inkycal/modules/inkycal_todoist.py
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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_todoist.py
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 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 386 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 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
Webshot¶
Webshot module for Inkycal by https://github.com/worstface
Webshot
¶
Bases: InkycalModule
Source code in inkycal/modules/inkycal_webshot.py
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 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 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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_webshot.py
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 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 | |
Slideshow¶
Inkycal Slideshow Module Copyright by aceinnolab
Slideshow
¶
Bases: InkycalModule
Cycles through images in a local image folder
Source code in inkycal/modules/inkycal_slideshow.py
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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
__init__(config)
¶
Initialize module
Source code in inkycal/modules/inkycal_slideshow.py
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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_slideshow.py
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 | |
Server Module¶
Inkycal-server module for Inkycal Project by Aterju (https://inkycal.robertsirre.nl/) Copyright by aceinnolab
Inkyserver
¶
Bases: InkycalModule
Displays an image from URL or local path
Source code in inkycal/modules/inkycal_server.py
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 114 115 116 117 118 | |
__init__(config)
¶
Initialize module
Source code in inkycal/modules/inkycal_server.py
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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_server.py
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 | |
XKCD¶
Inkycal XKCD module by https://github.com/worstface
Xkcd
¶
Bases: InkycalModule
Source code in inkycal/modules/inkycal_xkcd.py
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 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 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 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_xkcd.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 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 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 | |
Jokes¶
iCanHazDadJoke module for InkyCal Project Special thanks to Erik Fredericks (@efredericks) for the template!
Copyright by aceinnolab
Jokes
¶
Bases: InkycalModule
Icanhazdad-api class parses rss/atom feeds from given urls
Source code in inkycal/modules/inkycal_jokes.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 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 | |
__init__(config)
¶
Initialize inkycal_feeds module
Source code in inkycal/modules/inkycal_jokes.py
33 34 35 36 37 38 39 40 41 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_jokes.py
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 | |
Tindie¶
Tindie module for Inkycal Project Shows unshipped orders from your Tindie store
Copyright by aceinnolab
Tindie
¶
Bases: InkycalModule
Tindie - show latest orders from your store
Source code in inkycal/modules/inkycal_tindie.py
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 114 115 116 117 118 119 120 121 122 | |
__init__(config)
¶
Initialize inkycal_feeds module
Source code in inkycal/modules/inkycal_tindie.py
27 28 29 30 31 32 33 34 35 36 37 38 39 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_tindie.py
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 | |
Text File Renderer¶
Textfile module for InkyCal Project
Reads data from a plain .txt file and renders it on the display. If the content is too long, it will be truncated from the back until it fits
Copyright by aceinnolab
TextToDisplay
¶
Bases: InkycalModule
TextToDisplay module - Display text from a local file on the display
Source code in inkycal/modules/inkycal_textfile_to_display.py
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 | |
__init__(config)
¶
Initialize inkycal_textfile_to_display module
Source code in inkycal/modules/inkycal_textfile_to_display.py
27 28 29 30 31 32 33 34 35 36 37 38 39 | |
generate_image()
¶
Generate image for this module
Source code in inkycal/modules/inkycal_textfile_to_display.py
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 | |
🖥 Display API¶
Inkycal ePaper Display Driver Abstraction
This module provides the high-level Display class used by Inkycal for rendering images on supported E-Paper displays. It dynamically loads the appropriate hardware driver based on the selected model and provides:
- Rendering black/white or black/white/colour images
- Automatic fallback checks
- Display calibration
- Utility helpers for accessing supported display models
All hardware driver implementations are expected to provide a EPD class with
methods:
init()display(buffer_black, buffer_colour=None)getbuffer(image)sleep()
Display
¶
High-level interface for rendering images on an ePaper display.
The Display class wraps the low-level hardware driver for the selected E-Paper model and offers simplified rendering and calibration routines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epaper_model
|
str
|
Name of the display model, e.g. |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
If the driver module cannot be imported or if SPI appears |
Source code in inkycal/display/display.py
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 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 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 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 | |
__init__(epaper_model)
¶
Load and initialize the driver for the given E-Paper model.
Source code in inkycal/display/display.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
calibrate(cycles=3)
¶
Calibrate the display to reduce ghosting and restore contrast.
Performs repeated full-screen refresh cycles using black/white or black/white/colour depending on the display type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cycles
|
int
|
Number of calibration cycles. More cycles produce cleaner results but take longer. |
3
|
Notes
- Black/white displays: ~10 minutes for 3 cycles.
- Colour displays: ~20 minutes for 3 cycles.
- Recommended: run calibration every ~6 updates.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If display initialization fails. |
Source code in inkycal/display/display.py
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 | |
get_display_names()
classmethod
¶
Return a list of all supported E-Paper model names.
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: All supported display identifiers. |
Example
Display.get_display_names() ['waveshare_7in5', 'waveshare_7in5_colour', ...]
Source code in inkycal/display/display.py
221 222 223 224 225 226 227 228 229 230 231 232 | |
get_display_size(model_name)
classmethod
¶
Return the pixel size of a supported display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_name
|
str
|
Display model identifier (key in |
required |
Returns:
| Type | Description |
|---|---|
Tuple[int, int]
|
Tuple[int, int]: The display resolution as |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the model is not found. |
Example
Display.get_display_size("waveshare_7in5") (800, 480)
Source code in inkycal/display/display.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
render(im_black, im_colour=None)
¶
Render one or two images on the selected E-Paper display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
im_black
|
Image
|
The image representing black pixels. Required for all supported E-Paper types. Anything non-white becomes black. |
required |
im_colour
|
Image
|
The image representing colour pixels (red/yellow). Required only when the selected display supports colour. Anything non-white becomes coloured. |
None
|
Raises:
| Type | Description |
|---|---|
Exception
|
If a colour display is used without |
Examples:
Rendering a black-white image:
>>> img = Image.open("image.png")
>>> disp = Display("waveshare_7in5")
>>> disp.render(img)
Rendering black-white on a colour display:
>>> img = Image.open("image.png")
>>> disp = Display("waveshare_7in5_colour")
>>> disp.render(img, img)
Rendering fully separated black + colour channels:
>>> bw = Image.open("bw.png")
>>> col = Image.open("col.png")
>>> disp.render(bw, col)
Source code in inkycal/display/display.py
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 | |
render_text(text, font_size=24, max_width_ratio=0.95)
¶
Render a centered, auto-wrapped text message on the display.
This is primarily used for setup messages, error reporting, or simple system notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text to display. Auto-wrapped to fit screen width. |
required |
font_size
|
int
|
Base font size used to render text. |
24
|
max_width_ratio
|
float
|
Maximum fraction of screen width allowed for text lines. |
0.95
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the display cannot be initialized or rendered. |
Example
disp = Display("waveshare_7in5") disp.render_text("Hello world!")
Source code in inkycal/display/display.py
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 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
import_driver(model)
¶
Dynamically import a driver module for the given display model.
Source code in inkycal/display/display.py
29 30 31 | |
🎨 Canvas API¶
This is one of the most important components of Inkycal.
It is used to render text, icons, shapes, and previews.
Auto-generate docs:
canvas.py
Canvas
¶
Canvas class of Inkycal. Set this up once and use to draw text on a PIL Image.
Source code in inkycal/utils/canvas.py
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 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 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 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 386 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 423 424 425 426 427 428 429 430 431 432 433 | |
auto_fontsize(max_height, sample_text='Ag', target_ratio=0.8)
¶
Automatically scale the canvas' font so its height reaches ~target_ratio of the given max_height.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_height
|
int
|
Maximum allowed pixel height. |
required |
sample_text
|
str
|
Text used to measure font height. Default "Ag". |
'Ag'
|
target_ratio
|
float
|
The portion of max_height the font should fill. |
0.8
|
Returns:
| Type | Description |
|---|---|
|
None — self.font and self._font_size are updated. |
Source code in inkycal/utils/canvas.py
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 | |
color_to_red(img)
staticmethod
¶
Convert dark pixels to red with alpha transparency. Uses optimized thresholding for more accurate previews.
Source code in inkycal/utils/canvas.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | |
get_line_height(sample_text='Ag')
¶
Return the pixel line height of the currently active font. Based on ascent + descent, with a reliable fallback if unsupported.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_text
|
str
|
A sample string used to measure font height. |
'Ag'
|
Returns:
| Type | Description |
|---|---|
int
|
int — Line height in pixels. |
Source code in inkycal/utils/canvas.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
get_preview_image()
¶
Returns a black+red preview image, optimized for readability.
Source code in inkycal/utils/canvas.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | |
get_text_width(text)
¶
Return the rendered width of a string using the current font.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to measure. |
required |
Returns:
| Type | Description |
|---|---|
int
|
int — Width in pixels. |
Source code in inkycal/utils/canvas.py
274 275 276 277 278 279 280 281 282 283 284 285 | |
set_font_size(font_size)
¶
Set the font size to use
Source code in inkycal/utils/canvas.py
29 30 31 | |
text_wrap(text, max_width)
¶
Split long text into wrapped lines using the Canvas' current font.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The full text to wrap. |
required |
max_width
|
int
|
Maximum pixel width allowed per line. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of strings, each representing one wrapped line. |
Source code in inkycal/utils/canvas.py
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 | |
write(xy, box_size, text, *, alignment='center', autofit=False, colour='black', rotation=None, fill_width=1.0, fill_height=0.8)
¶
Write (possibly multi-line) text inside a rectangle.
Supports '
' and auto-wrapping inside each line.
Source code in inkycal/utils/canvas.py
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 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
🔧 Utility Functions¶
General Utils¶
Utility Functions for Inkycal
This module contains small standalone helpers used throughout the Inkycal framework. These functions handle tasks such as timezone detection, network availability checks, simple drawing helpers, and generating lightweight charts.
These utilities are intentionally framework-agnostic and can be used inside modules, during setup, or anywhere Inkycal requires common functionality.
draw_border(image, xy, size, radius=5, thickness=1, shrinkage=(0.1, 0.1))
¶
Draw a stylized border around a rectangular region.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
The PIL image into which the border is drawn. |
required |
xy
|
Tuple[int, int]
|
Top-left corner of the border (x, y). |
required |
size
|
Tuple[int, int]
|
Width and height of the border before shrinkage is applied. |
required |
radius
|
int
|
Corner roundness. |
5
|
thickness
|
int
|
Stroke width in pixels. |
1
|
shrinkage
|
Tuple[float, float]
|
Proportional shrinkage of width and height. For example:
|
(0.1, 0.1)
|
Notes
This function is used by various modules (Calendar, Agenda, Feeds) to visually highlight areas such as days with events.
Source code in inkycal/utils/functions.py
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 156 157 158 159 160 161 162 163 164 | |
draw_border_2(im, xy, size, radius)
¶
Draw a simple rounded rectangle border using Pillow's high-level API.
Source code in inkycal/utils/functions.py
167 168 169 170 171 172 | |
get_inkycal_version()
¶
Resolve Inkycal version.
Priority: 1. Installed package metadata (preferred, matches pyproject.toml) 2. _version.txt inside the package (editable / dev fallback)
Source code in inkycal/utils/functions.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
get_system_tz()
¶
Return the system's timezone as a string.
Attempts to detect the local timezone using tzlocal. If detection fails,
the function falls back to "UTC" and logs a warning.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The detected timezone name. Examples include:
- |
Example
arrow.now(tz=get_system_tz())
Source code in inkycal/utils/functions.py
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 | |
internet_available()
¶
Check whether the internet connection is reachable.
The function attempts 3 connections to https://google.com with a short
timeout. If any request succeeds, the network is considered available.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
bool
|
|
Example
if internet_available(): ... print("Online!") ... else: ... print("Offline!")
Source code in inkycal/utils/functions.py
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 | |
render_line_chart(values, size, line_width=2, line_color='black', bg_color='white', padding=4)
¶
Render a lightweight line chart using Pillow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
Sequence[float]
|
A list/tuple of numeric values to plot. Must contain at least 2 points to draw a line. |
required |
size
|
Tuple[int, int]
|
Output image size |
required |
line_width
|
int
|
Thickness of the plotted line. |
2
|
line_color
|
str or tuple
|
Colour of the line. Accepts any Pillow colour value. |
'black'
|
bg_color
|
str or tuple
|
Background colour. |
'white'
|
padding
|
int
|
Inner padding in pixels (space to chart edges). |
4
|
Returns:
| Type | Description |
|---|---|
Image
|
PIL.Image.Image: A new image containing the rendered chart. |
Notes
- Scaling is automatically normalized between min(values) and max(values).
- Used primarily by the Stocks module.
Example
img = render_line_chart([1, 3, 2, 5], (200, 80)) img.show()
Source code in inkycal/utils/functions.py
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 | |
Enumerations (fonts, settings)¶
Supported Display Models¶
🏁 Summary¶
This API reference is meant as a central index for:
- All modules
- Rendering engine (Canvas)
- ePaper Display driver
- Utilities
If you are developing your own module, be sure to check:
template.py- Developer Guide (
dev_doc.md) - Canvas documentation (
canvas.md)