-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
1310 lines (1159 loc) · 60.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
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
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
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>README.md</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<style>
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
body {
font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif);
font-size: var(--vscode-markdown-font-size, 14px);
padding: 0 26px;
line-height: var(--vscode-markdown-line-height, 22px);
word-wrap: break-word;
}
#code-csp-warning {
position: fixed;
top: 0;
right: 0;
color: white;
margin: 16px;
text-align: center;
font-size: 12px;
font-family: sans-serif;
background-color:#444444;
cursor: pointer;
padding: 6px;
box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}
#code-csp-warning:hover {
text-decoration: none;
background-color:#007acc;
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}
body.scrollBeyondLastLine {
margin-bottom: calc(100vh - 22px);
}
body.showEditorSelection .code-line {
position: relative;
}
body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
content: "";
display: block;
position: absolute;
top: 0;
left: -12px;
height: 100%;
}
body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
left: -30px;
}
.vscode-light.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(0, 0, 0, 0.15);
}
.vscode-light.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(0, 0, 0, 0.40);
}
.vscode-light.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
.vscode-dark.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 255, 255, 0.4);
}
.vscode-dark.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 255, 255, 0.60);
}
.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
.vscode-high-contrast.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 160, 0, 0.7);
}
.vscode-high-contrast.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 160, 0, 1);
}
.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
img {
max-width: 100%;
max-height: 100%;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:focus,
input:focus,
select:focus,
textarea:focus {
outline: 1px solid -webkit-focus-ring-color;
outline-offset: -1px;
}
hr {
border: 0;
height: 2px;
border-bottom: 2px solid;
}
h1 {
padding-bottom: 0.3em;
line-height: 1.2;
border-bottom-width: 1px;
border-bottom-style: solid;
}
h1, h2, h3 {
font-weight: normal;
}
table {
border-collapse: collapse;
}
table > thead > tr > th {
text-align: left;
border-bottom: 1px solid;
}
table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td {
padding: 5px 10px;
}
table > tbody > tr + tr > td {
border-top: 1px solid;
}
blockquote {
margin: 0 7px 0 5px;
padding: 0 16px 0 10px;
border-left-width: 5px;
border-left-style: solid;
}
code {
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
font-size: 1em;
line-height: 1.357em;
}
body.wordWrap pre {
white-space: pre-wrap;
}
pre:not(.hljs),
pre.hljs code > div {
padding: 16px;
border-radius: 3px;
overflow: auto;
}
pre code {
color: var(--vscode-editor-foreground);
tab-size: 4;
}
/** Theming */
.vscode-light pre {
background-color: rgba(220, 220, 220, 0.4);
}
.vscode-dark pre {
background-color: rgba(10, 10, 10, 0.4);
}
.vscode-high-contrast pre {
background-color: rgb(0, 0, 0);
}
.vscode-high-contrast h1 {
border-color: rgb(0, 0, 0);
}
.vscode-light table > thead > tr > th {
border-color: rgba(0, 0, 0, 0.69);
}
.vscode-dark table > thead > tr > th {
border-color: rgba(255, 255, 255, 0.69);
}
.vscode-light h1,
.vscode-light hr,
.vscode-light table > tbody > tr + tr > td {
border-color: rgba(0, 0, 0, 0.18);
}
.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table > tbody > tr + tr > td {
border-color: rgba(255, 255, 255, 0.18);
}
</style>
<style>
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
color: #8e908c;
}
/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
color: #c82829;
}
/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
color: #f5871f;
}
/* Tomorrow Yellow */
.hljs-attribute {
color: #eab700;
}
/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
color: #718c00;
}
/* Tomorrow Blue */
.hljs-title,
.hljs-section {
color: #4271ae;
}
/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #8959a8;
}
.hljs {
display: block;
overflow-x: auto;
color: #4d4d4c;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style>
<style>
/*
* Markdown PDF CSS
*/
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "Meiryo";
padding: 0 12px;
}
pre {
background-color: #f8f8f8;
border: 1px solid #cccccc;
border-radius: 3px;
overflow-x: auto;
white-space: pre-wrap;
overflow-wrap: break-word;
}
pre:not(.hljs) {
padding: 23px;
line-height: 19px;
}
blockquote {
background: rgba(127, 127, 127, 0.1);
border-color: rgba(0, 122, 204, 0.5);
}
.emoji {
height: 1.4em;
}
code {
font-size: 14px;
line-height: 19px;
}
/* for inline code */
:not(pre):not(.hljs) > code {
color: #C9AE75; /* Change the old color so it seems less like an error */
font-size: inherit;
}
/* Page Break : use <div class="page"/> to insert page break
-------------------------------------------------------- */
.page {
page-break-after: always;
}
</style>
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
</head>
<body>
<script>
mermaid.initialize({
startOnLoad: true,
theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
? 'dark'
: 'default'
});
</script>
<p>Development Status :: 2 - Pre-Alpha <br>
<em>Copyright (c) 2023 MinWoo Park, South Korea</em><br>
Before QA<br></p>
<p><img src="https://exceptnotifier.readthedocs.io/en/latest/_images/logo.png" alt=""></p>
<h5 align="center">Integrates AI-assisted debugging notifications into Python try-except statements for various messaging applications. </h5>
<p align="center">
<a><img alt="PyPI package" src="https://img.shields.io/badge/pypi-ExceptNotifier-orange"></a>
<a href="https://pypi.org/project/exceptnotifier/"><img alt="PyPI" src="https://img.shields.io/pypi/v/exceptnotifier"></a>
<a href="https://pepy.tech/project/exceptnotifier"><img alt="Downloads" src="https://pepy.tech/badge/exceptnotifier"></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
</p>
<p><img src="./assets/imgs/main3.png" alt=""></p>
<h5 id="provides-a-notification-from-the-application-shown-in-the-captured-screen">Provides a notification from the application shown in the captured screen.</h5>
<h1 id="python-package-exceptnotifier">Python Package: ExceptNotifier</h1>
<p><a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/dsdanielpark/ExceptNotifier&count_bg=#79C83D&title_bg=#555555&icon=python.svg&icon_color=#E7E7E7&title=ExceptNotifier&edge_flat=false" alt="Hits"></a><br>
The <code>ExceptNotifier</code> Python package offers a flexible approach to receiving notifications by enhancing Python's try-except statement. This package enables you to receive alerts through various messaging applications or emails.
<Br><br>
With <code>ExceptNotifier</code>, you can obtain detailed compilation errors, including debug information, sent directly to your preferred messaging platform or email. By integrating OpenAI's ChatGPT, you can receive additional error code information as long as you provide the required API model name and key. This feature ensures that error handling and notifications are more informative and accessible, streamlining your debugging process.</p>
<p><img src="./assets/imgs/core02.png" alt=""></p>
<Br>
<h1 id="supporting-applications">Supporting Applications</h1>
<p>Applicable to both <a href="https://ipython.org/">IPython</a> and <a href="https://www.python.org/">Python</a>, but needs to be ported differently only in <code>ExceptNotifier</code>. Please refer to the detailed example. (<code>SuccessNotifier</code> and <code>SendNotifier</code> have the same syntax.)</p>
<ul>
<li><a href="https://telegram.org/">Telegram</a></li>
<li><a href="https://discord.com/">Discord</a></li>
<li><a href="https://slack.com/">Slack</a></li>
<li><a href="https://mail.google.com/">Google Mail</a></li>
<li><a href="https://line.me/en/">Line</a></li>
<li><a href="https://aws.amazon.com/ko/chime/download-chime/">AWS Chime</a></li>
<li><a href="https://www.microsoft.com/en/microsoft-teams/download-app">Microsoft Teams</a></li>
<li><a href="https://www.kakaocorp.com/page/service/service/KakaoTalk?lang=en">Kakao Talk</a></li>
<li><a href="https://www.wechat.com/">Wecaht</a></li>
<li>SMS Sending using <a href="https://www.twilio.com/en-us">Twilio</a></li>
<li>Desktop Notification using <a href="https://github.com/kivy/plyer">Plyer</a></li>
<li>Beep Sound from <a href="https://docs.python.org/3/library/winsound.html">system</a></li>
<li><a href="https://openai.com/blog/openai-api">Opea AI API</a>
- If you have OpenAI API Key and model name, you can get information and code examples for debugging in any application.</li>
</ul>
<br>
<h1 id="quick-start">Quick Start</h1>
<pre class="hljs"><code><div>$ pip install ExceptNotifier
</div></code></pre>
<pre class="hljs"><code><div>$ pip install exceptnotifier
</div></code></pre>
<p><br><br><br></p>
<h1 id="contents">Contents</h1>
<ul>
<li>
<p><a href="#app-setup-overview">App Setup Overview</a></p>
</li>
<li>
<p><a href="#tutorial">Tutorial</a>
<Br></p>
</li>
<li>
<p><a href="#python-core">Python Core</a></p>
<ul>
<li><a href="#exceptnotifier">Except<code>Notifier</code></a>
<ul>
<li><a href="#ai-debbugging-infomation-notification">AI Debbugging Infomation Notification</a></li>
</ul>
</li>
<li><a href="#successnotifier">Success<code>Notifier</code></a></li>
<li><a href="#sendnotifier">Send<code>Notifier</code></a></li>
<li><a href="#sender">Sender</a>
<br></li>
</ul>
</li>
<li>
<p><a href="#ipython-core">IPython Core</a></p>
<ul>
<li><a href="#exceptnotifier-in-ipython">Except<code>Notifier</code> in Ipython</a></li>
<li><a href="#successnotifier-in-ipython">Success<code>Notifier</code> in Ipython</a></li>
<li><a href="#sendnotifier-in-ipython">Send<code>Notifier</code> in Ipython</a></li>
<li><a href="#sender-in-ipython">Sender in Ipython</a>
<br></li>
</ul>
</li>
<li>
<p><a href="#applied-in-each-application">Applied in each application</a></p>
<ul>
<li><a href="#telegram"><em>Telegram</em></a>
<ul>
<li><a href="#a-notifier-without-openai-api">a. Notifier without OpenAI API</a></li>
<li><a href="#b-notifier-with-openai-api">b. Notifier with OpenAI API</a></li>
</ul>
</li>
<li><a href="#mail"><em>Mail</em></a></li>
<li><a href="#discord"><em>Discord</em></a></li>
<li><a href="#chime"><em>Chime</em></a></li>
<li><a href="#slack"><em>Slack</em></a></li>
<li><a href="#line"><em>Line</em></a></li>
<li><a href="#sms"><em>SMS</em></a></li>
<li><a href="#teams"><em>Teams</em></a></li>
<li><a href="#kakaotalk"><em>Kakaotalk</em></a></li>
<li><a href="#wechat"><em>Wechat</em></a></li>
<li><a href="#beep"><em>Beep</em></a></li>
<li><a href="#desktop"><em>Desktop</em></a></li>
</ul>
</li>
<li>
<p><a href="#contributing-guide">Contributing Guide</a></p>
</li>
<li>
<p><a href="#license">License</a></p>
</li>
<li>
<p><a href="#code-of-conduct">Code of Conduct</a></p>
</li>
<li>
<p><a href="#contacts">Contacts</a></p>
</li>
</ul>
<p><br><br><br></p>
<br>
<h1 id="app-setup-overview">App Setup Overview</h1>
<ul>
<li>The variables in the following table must not be contaminated.</li>
<li>Depending on the situation, consider designating them as global variables for use.</li>
<li>As you already know, API Keys or security tokens must be secured. Note that the key values which exposured in github will be expired after insecured.</li>
<li>We are trying to maintain the current architecture as much as possible by considering various methods such as inheriting decorators and Excepthook. We set it as an environment variable as follows, and we are refactoring and testing for a better method.</li>
</ul>
<table>
<thead>
<tr>
<th style="text-align:center">App</th>
<th style="text-align:left">Required Enviroment Variables</th>
<th style="text-align:center">Free or Paid</th>
<th style="text-align:center">Ease of Setup</th>
<th style="text-align:center">Time Required for Setup</th>
<th style="text-align:center">Guide Tutorial Link</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Beep</td>
<td style="text-align:left">N/A</td>
<td style="text-align:center">Free</td>
<td style="text-align:center">N/A</td>
<td style="text-align:center">0min</td>
<td style="text-align:center"><a href="./tutorials/ExceptBeep/GUIDE.md">ExceptBeep</a></td>
</tr>
<tr>
<td style="text-align:center">Desktop</td>
<td style="text-align:left">N/A</td>
<td style="text-align:center">Free</td>
<td style="text-align:center">N/A</td>
<td style="text-align:center">0min</td>
<td style="text-align:center"><a href="./tutorials/ExceptDesktop/GUIDE.md">ExceptDesktop</a></td>
</tr>
<tr>
<td style="text-align:center">Telegram</td>
<td style="text-align:left"><code>_TELEGRAM_TOKEN</code></td>
<td style="text-align:center">Freemium</td>
<td style="text-align:center">Easy</td>
<td style="text-align:center">2min</td>
<td style="text-align:center"><a href="./tutorials/ExceptTelegram/GUIDE.md">ExceptTelegram</a> <a href="https://colab.research.google.com/drive/1jwWGs7eCUJQvj_g7SEMqm3a4Kdrp9ZQP?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></td>
</tr>
<tr>
<td style="text-align:center">Discord</td>
<td style="text-align:left"><code>_DISCORD_WEBHOOK_URL</code></td>
<td style="text-align:center">Freemium</td>
<td style="text-align:center">Easy</td>
<td style="text-align:center">1min</td>
<td style="text-align:center"><a href="./tutorials/ExceptTelegram/GUIDE.md">ExceptDiscord</a> <a href="https://colab.research.google.com/drive/1lwsIBpql_1zgEdIWRw6O_jBOZKJdHqBh?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></td>
</tr>
<tr>
<td style="text-align:center">AWS Chime</td>
<td style="text-align:left"><code>_CHIME_WEBHOOK_URL</code></td>
<td style="text-align:center">Freemium</td>
<td style="text-align:center">Easy</td>
<td style="text-align:center">1min</td>
<td style="text-align:center"><a href="./tutorials/ExceptChime/GUIDE.md">ExceptChime</a> <a href="https://colab.research.google.com/drive/1hUMMQ6He9M4MlspZ88J9kO8juxvC5b3a?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></td>
</tr>
<tr>
<td style="text-align:center">Slack</td>
<td style="text-align:left"><code>_SLACK_WEBHOOK_URL</code></td>
<td style="text-align:center">Freemium</td>
<td style="text-align:center">Easy</td>
<td style="text-align:center">3min</td>
<td style="text-align:center"><a href="./tutorials/ExceptSlack/GUIDE.md">ExceptSlack</a> <a href="https://colab.research.google.com/drive/1-dAaKl_gwX481FxH424aCVFqsq-thGXK?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></td>
</tr>
<tr>
<td style="text-align:center">G-Mail</td>
<td style="text-align:left"><code>_GAMIL_RECIPIENT_ADDR</code>, <code>_GMAIL_SENDER_ADDR</code>, <code>_GMAIL_APP_PASSWORD_OF_SENDER</code></td>
<td style="text-align:center">Restricted free</td>
<td style="text-align:center">Medium</td>
<td style="text-align:center">3min</td>
<td style="text-align:center"><a href="./tutorials/ExceptMail/GUIDE.md">ExceptMail</a></td>
</tr>
<tr>
<td style="text-align:center">Line</td>
<td style="text-align:left"><code>_LINE_NOTIFY_API_TOKEN</code></td>
<td style="text-align:center">Freemium</td>
<td style="text-align:center">Medium</td>
<td style="text-align:center">4min</td>
<td style="text-align:center"><a href="./tutorials/ExceptLine/GUIDE.md">ExceptLine</a> <a href="https://colab.research.google.com/drive/1PDrJqxDq4NE6BRUrRkFvDBiMHQz0WbZh?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></td>
</tr>
<tr>
<td style="text-align:center">SMS</td>
<td style="text-align:left"><code>_TWILIO_SID</code>, <code>_TWILIO_TOKEN</code>, <code>_RECIPIENT_PHONE_NUMBER</code>, <code>_SENDER_PHONE_NUMBER</code></td>
<td style="text-align:center">Not free</td>
<td style="text-align:center">Medium</td>
<td style="text-align:center">5min</td>
<td style="text-align:center"><a href="./tutorials/ExceptSMS/GUIDE.md">ExceptSMS</a></td>
</tr>
<tr>
<td style="text-align:center">Microsoft Teams</td>
<td style="text-align:left"><code>_TEAMS_WEBHOOK_URL</code></td>
<td style="text-align:center">Not Free</td>
<td style="text-align:center">Medium</td>
<td style="text-align:center">5min</td>
<td style="text-align:center"><a href="./tutorials/ExceptTeams/GUIDE.md">ExceptTeams</a></td>
</tr>
<tr>
<td style="text-align:center">KakaoTalk</td>
<td style="text-align:left"><code>_KAKAO_TOKEN_PATH</code></td>
<td style="text-align:center">Freemium</td>
<td style="text-align:center">Hell</td>
<td style="text-align:center">>=10min(Token refreshes daily)</td>
<td style="text-align:center"><a href="./tutorials/ExceptKakao/GUIDE.md">ExceptKakao</a></td>
</tr>
</tbody>
</table>
<p>If you add the following two variables to the required variables for each application in the table above, you can receive error location and explanation, as well as examples, from OpenAI's model</p>
<table>
<thead>
<tr>
<th style="text-align:center">API</th>
<th style="text-align:left">Required Variables</th>
<th style="text-align:center">Free or Paid</th>
<th style="text-align:center">Ease of Setup</th>
<th style="text-align:center">Time Required for Setup</th>
<th style="text-align:center">Guide Tutorial Link</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">OpenAI API</td>
<td style="text-align:left"><code>Required variables for each application</code>+ <code>_OPEN_AI_MODEL</code>,<code>_OPEN_AI_API</code></td>
<td style="text-align:center">Not free</td>
<td style="text-align:center">Easy</td>
<td style="text-align:center">2min</td>
<td style="text-align:center"><a href="./documents/APIOpenAI/GUIDE.md">APIOpenAI</a></td>
</tr>
</tbody>
</table>
<br>
<h1 id="tutorial">Tutorial</h1>
<p>I will update tutorial ASAP. <code>README.md</code> is sufficient, but read the application's official documentation if necessary. However, we are preparing a more detailed and friendly tutorial.</p>
<ol>
<li>Main-tutorials: <a href="https://github.com/DSDanielPark/ExceptNotifier/blob/main/tutorial/ExceptNotifier.ipynb">Notebook</a></li>
<li>Sub-tutorial-folder: Tutorials for each function can be found in this <a href="https://github.com/DSDanielPark/ExceptNotifier/tree/main/tutorial">folder</a>. The tutorial is synchronized with the Python file name provided by ExceptNotifier.</li>
</ol>
<p><strong>In this example, some API keys were exposed by creating and removing a test application, but for security reasons, your API key should not be exposed to the outside world.</strong></p>
<Br>
<h1 id="python-core">Python Core</h1>
<p>To use the desired application, you must define the necessary variables. Ensure that the variable names remain unchanged, and you can use either local or global variables. If you are using <code>Telegram</code>, an example is attached as an image.</p>
<h2 id="exceptnotifier">Except<code>Notifier</code></h2>
<p><img src="./assets/imgs/ex01.png" alt="">
If you use Python's try except statement as it is, but change except as follows, you can receive notifications through your application.</p>
<ul>
<li>Format: Except<code>[appName]</code> <Br></li>
<li>Type: class
<em>ExampleClass</em></li>
</ul>
<pre class="hljs"><code><div>ExceptChime, ExceptTelegram, ExceptDiscord, ExceptSMS, ExceptMail, ExceptKakao, ExceptLine, ExceptSlack, ExceptTeams, ExceptDesktope, ExceptBeep
</div></code></pre>
<p><em>Example</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptTelegram
sys.excepthook = ExceptTelegram.__call__
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">0</span>)
<span class="hljs-keyword">except</span> ExceptTelegram: <span class="hljs-comment"># sending except message to telegram</span>
sys.exit()
</div></code></pre>
<h3 id="ai-debbugging-infomation-notification">AI Debbugging Infomation Notification</h3>
<p><img src="./assets/imgs/ex02.png" alt=""></p>
<p>You can receive debugging information from ChatGPT via OpenAI's API when using the Except statement. The syntax remains the same, but you'll need to configure these two variables:
<code>_OPEN_AI_MODEL</code>,<code>_OPEN_AI_API</code></p>
<p><em>Example</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptTelegram
sys.excepthook = ExceptTelegram.__call__
os.envirion[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxx"</span>
os.envirion[<span class="hljs-string">'_OPEN_AI_MODEL'</span>]=<span class="hljs-string">"gpt-3.5-turbo"</span>
os.envirion[<span class="hljs-string">'_OPEN_AI_API'</span>]=<span class="hljs-string">"sk-xxxxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">0</span>)
<span class="hljs-keyword">except</span> ExceptTelegram: <span class="hljs-comment"># sending msg WITH AI DEBUGGING to telegram</span>
sys.exit()
</div></code></pre>
<h2 id="successnotifier">Success<code>Notifier</code></h2>
<p><img src="./assets/imgs/ex03.png" alt=""></p>
<ul>
<li>Format: Success<code>[appName]</code></li>
<li>Type: Class <br>
<em>ExampleClass</em> <br>
By placing the try except in python at the end of the try statement, applications can be notified that the try statement worked normally.</li>
</ul>
<pre class="hljs"><code><div>SuccessChime, SuccessTelegram, SuccessDiscord, SuccessSMS, SuccessMail, SuccessKakao, SuccessLine, SuccessSlack, SuccessTeams, SuccessDesktope, SuccessBeep
</div></code></pre>
<p><em>Example</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> SuccessTelgeram
sys.excepthook = ExceptTelegram.__call__
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">20</span>)
SuccessTelgeram().__call__() <span class="hljs-comment"># sending success message to telegram</span>
<span class="hljs-keyword">except</span>:
sys.exit()
</div></code></pre>
<h2 id="sendnotifier">Send<code>Notifier</code></h2>
<p><img src="./assets/imgs/ex04.png" alt=""></p>
<ul>
<li>Format: Send<code>[appName]</code></li>
<li>Type: class <br>
<em>ExampleClass</em> <br>
Place it anywhere on the line of code you want, and you'll be notified when that line of code is reached.</li>
</ul>
<pre class="hljs"><code><div>SendChime, SendTelegram, SendDiscord, SendSMS, SendMail, SendKakao, SendLine, SendSlack, SendTeams, SendDesktope, SendBeep
</div></code></pre>
<p><em>Example</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> SendTelegram
sys.excepthook = ExceptTelegram.__call__
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxx"</span>
SendTelegram().__call__() <span class="hljs-comment"># sending message to telegram</span>
noti = SendTelegram()
noti() <span class="hljs-comment"># sending message to telegram</span>
</div></code></pre>
<h2 id="sender">Sender</h2>
<p><img src="./assets/imgs/ex05.png" alt="">
It is recommended to conduct a simple message sending test through the <code>sender</code>. Assuming that you can communicate with REST API or WEBHOOK normally, <code>ExceptNotifier</code> can work normally.</p>
<ul>
<li>Every application's ExceptNotifier uses the sender method.</li>
<li>Format: send_<code>[appName]</code>_msg</li>
<li>Type: Function <br>
<em>Example</em> <br></li>
</ul>
<pre class="hljs"><code><div>send_chime_msg, send_telegram_msg, send_discord_msg, send_sms_msg, send_gmail_msg, send_kakao_msg, send_line_msg, send_slack_msg, send_teams_msg, send_desktop_msg, beep
</div></code></pre>
<p><em>Example</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> send_telegram_msg
send_telegram_msg(_TELEGRAM_TOKEN, <span class="hljs-string">"Any Test Message"</span>)
</div></code></pre>
<p><br><br></p>
<h1 id="ipython-core">IPython Core</h1>
<p>You can use all the same except for the python code and <code>ExceptNotifier</code> mentioned above. In other words, the <code>SuccesNotifier</code>, <code>SendNotifier</code>, and <code>Sender</code> functions can all be used same in IPython without any special processing. Only <code>ExceptNotifier</code> is need to be defined.</p>
<ul>
<li>Example in Telegram <a href="https://colab.research.google.com/drive/1jwWGs7eCUJQvj_g7SEMqm3a4Kdrp9ZQP?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></li>
</ul>
<h2 id="exceptnotifier-in-ipython">Except<code>Notifier</code> in Ipython</h2>
<p>You have to use <code>raise</code> in Ipython ExceptNotifier.</p>
<ul>
<li>Format: Except[appName]</li>
<li>Type: function <br></li>
</ul>
<p><em>Example code without Open AI API</em></p>
<p><img src="./assets/imgs/ex06.png" alt=""></p>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptTelegramIpython
<span class="hljs-keyword">import</span> os
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxxx"</span>
get_ipython().set_custom_exc((Exception,), ExceptTelegramIpython)
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">0</span>)
<span class="hljs-keyword">except</span>:
<span class="hljs-keyword">raise</span>
</div></code></pre>
<p><em>Example code With Open AI API</em></p>
<p><img src="./assets/imgs/ex07.png" alt=""></p>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptTelegramIpython
<span class="hljs-keyword">import</span> os
get_ipython().set_custom_exc((Exception,), ExceptTelegramIpython)
os.environ[<span class="hljs-string">'_OPEN_AI_MODEL'</span>] = <span class="hljs-string">"gpt-3.5-turbo"</span>
os.environ[<span class="hljs-string">'_OPEN_AI_API'</span>] = <span class="hljs-string">"sk-xxxxx"</span>
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">0</span>)
<span class="hljs-keyword">except</span>:
<span class="hljs-keyword">raise</span>
</div></code></pre>
<h2 id="successnotifier-in-ipython">Success<code>Notifier</code> in Ipython</h2>
<p><img src="./assets/imgs/ex08.png" alt=""></p>
<ul>
<li>Same syntax in Python. See Python Core above.</li>
</ul>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys
<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> SuccessTelegram
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">20</span>) <span class="hljs-comment"># Your Code Here</span>
SuccessTelegram().__call__() <span class="hljs-comment"># Sending Success message</span>
<span class="hljs-keyword">except</span>:
<span class="hljs-keyword">raise</span>
</div></code></pre>
<h2 id="sendnotifier-in-ipython">Send<code>Notifier</code> in Ipython</h2>
<p><img src="./assets/imgs/ex09.png" alt=""></p>
<ul>
<li>Same syntax in Python. See Python Core above.</li>
</ul>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys
<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> SendTelegram
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxxx"</span>
SendTelegram().__call__() <span class="hljs-comment"># Sending telegram message</span>
</div></code></pre>
<h2 id="sender-in-ipython">Sender in Ipython</h2>
<p><img src="./assets/imgs/ex10.png" alt=""></p>
<ul>
<li>Same syntax in Python. See Python Core above.</li>
</ul>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> send_telegram_msg
_TELEGRAM_TOKEN = <span class="hljs-string">"xxxxx"</span>
send_telegram_msg(_TELEGRAM_TOKEN, <span class="hljs-string">"This is test message"</span>)
</div></code></pre>
<br>
<h1 id="applied-in-each-application">Applied in each application</h1>
<p>You can receive debugging information from ChatGPT via OpenAI's API when using the Except statement. The syntax remains the same, but you'll need to configure these two variables:
<code>_OPEN_AI_MODEL</code>,<code>_OPEN_AI_API</code></p>
<br>
<h2 id="telegram"><em>Telegram</em></h2>
<p><a href="https://colab.research.google.com/drive/1jwWGs7eCUJQvj_g7SEMqm3a4Kdrp9ZQP?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
As all classes function the same, the example will only use one image, like in Telegram.
<img src="./assets/imgs/fig44.png" alt=""></p>
<ul>
<li>a. Open your telegram app and search for BotFather. (A built-in Telegram bot that helps users create custom Telegram bots) <br></li>
<li>b. Type /newbot to create a new bot <br></li>
<li>c. Give your bot a name & a username <br></li>
<li>d. Copy your new Telegram bot’s token <br></li>
<li>e. You have to click <code>Start_bot</code> and must enter anything to your bot.
<ul>
<li>Before use Notifier, Please use this to check if you follow guide. The Telegram bot may have a slight delay and it responded within 2-3 minutes.
<em>API TEST</em></li>
</ul>
</li>
</ul>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> send_telegram_msg
_TELEGRAM_TOKEN = <span class="hljs-string">"xxxxx:xxxxx-xxxx"</span>
send_telegram_msg(_TELEGRAM_TOKEN, <span class="hljs-string">'msg'</span>)
</div></code></pre>
<p>For more infomation, visit <a href="https://core.telegram.org/bots/api">Telegram Bot Father API</a>
<br><br></p>
<h3 id="a-notifier-without-openai-api">a. Notifier without OpenAI API</h3>
<p><em>Notifier</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptTelegram, SuccessTelegram, SendTelegram
<span class="hljs-keyword">import</span> sys, os
sys.excepthook = ExceptTelegram.__call__
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">0</span>)
SuccessTelegram().__call__() <span class="hljs-comment">#1. success sender </span>
<span class="hljs-keyword">except</span> ExceptTelegram <span class="hljs-keyword">as</span> e: <span class="hljs-comment">#2. except sender </span>
sys.exit()
SendTelegram().__call__() <span class="hljs-comment">#3. customized sender </span>
</div></code></pre>
<h3 id="b-notifier-with-openai-api">b. Notifier with OpenAI API</h3>
<ul>
<li>If you just set <code>_OPEN_AI_API</code> and <code>_OPEN_AI_MODEL</code> environment variables in all application use case, AI MODEL will automatically send debugging information as a message. Currently, it is mainly based on the <code>GPT-3.5-TURBO</code> model, but we plan to update it so that other models can be used later.
<em>Notifier</em></li>
</ul>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptTelegram, SuccessTelegram, SendTelegram
<span class="hljs-keyword">import</span> sys, os
sys.excepthook = ExceptTelegram.__call__
os.environ[<span class="hljs-string">'_TELEGRAM_TOKEN'</span>] = <span class="hljs-string">"xxxx"</span>
os.envirion[<span class="hljs-string">'_OPEN_AI_MODEL'</span>]=<span class="hljs-string">"gpt-3.5-turbo"</span>
os.envirion[<span class="hljs-string">'_OPEN_AI_API'</span>]=<span class="hljs-string">"sk-xxxxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">0</span>)
SuccessTelegram().__call__() <span class="hljs-comment">#1. success sender </span>
<span class="hljs-keyword">except</span> ExceptTelegram <span class="hljs-keyword">as</span> e: <span class="hljs-comment">#2. except sender </span>
sys.exit()
SendTelegram().__call__() <span class="hljs-comment">#3. customized sender </span>
</div></code></pre>
<br>
<h2 id="mail"><em>Mail</em></h2>
<p>In the except statement, an email is sent along with the error message. Additionally, you can send emails from any desired line. <br></p>
<ul>
<li>a. Log in with the sender's email ID. <br></li>
<li>b. Obtain an app password for sending Google Mail at the following <a href="https://myaccount.google.com/u/3/apppasswords?utm_source=google-account&utm_medium=myaccountsecurity&utm_campaign=tsv-settings&rapt=AEjHL4N2bMRWO46VaMp_jP06zQK14BWNPv66l2o59iJ99CkO8BjYnmoRUe9dtSchkkbubHZMUhevkAnwVJRHb9ygO3afispNlw">link</a> or <a href="https://support.google.com/accounts/answer/185833?hl=en">google document</a>.</li>
</ul>
<p><em>API TEST</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> send_gmail_msg
_GMAIL_SENDER_ADDR = <span class="hljs-string">'xxxx@gmail.com'</span>
_GAMIL_RECIPIENT_ADDR = <span class="hljs-string">'xxxx@gmail.com'</span>
_GMAIL_APP_PASSWORD_OF_SENDER = <span class="hljs-string">'xxxx'</span>
subject_msg = <span class="hljs-string">"Test Title"</span>
body_msg = <span class="hljs-string">"Test Body"</span>
send_gmail_msg(
_GMAIL_SENDER_ADDR,
_GAMIL_RECIPIENT_ADDR,
_GMAIL_APP_PASSWORD_OF_SENDER,
subject_msg,
body_msg)
</div></code></pre>
<p><em>Notifier</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptMail, SuccessMail, SendMail
sys.excepthook = ExceptMail.__call__
<span class="hljs-comment"># Define the next two variables optionally when using OpenAI's API.</span>
<span class="hljs-comment"># os.environ['_OPEN_AI_MODEL']="gpt-3.5-turbo" </span>
<span class="hljs-comment"># os.environ['_OPEN_AI_API']="sk-xxxxxx"</span>
os.environ[<span class="hljs-string">'_GAMIL_RECIPIENT_ADDR'</span>] = <span class="hljs-string">'xxxxxxx@gmail.com'</span>
os.environ[<span class="hljs-string">'_GMAIL_SENDER_ADDR'</span>] = <span class="hljs-string">'yyyyyy@gmail.com'</span>
os.environ[<span class="hljs-string">'_GMAIL_APP_PASSWORD_OF_SENDER'</span>] = <span class="hljs-string">'zzzzzz'</span>
<span class="hljs-keyword">try</span>:
main() <span class="hljs-comment"># Your Code Here</span>
SuccessMail().__call__() <span class="hljs-comment"># No Exception -> Send Success mail.</span>
<span class="hljs-keyword">except</span> ExceptMail: <span class="hljs-comment"># Exception -> Send Fail mail.</span>
<span class="hljs-keyword">pass</span>
SendMail().__call__() <span class="hljs-comment"># When Process Ended -> Any Line mail.</span>
</div></code></pre>
<details>
<summary> See Example...</summary>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptMail, SuccessMail, SendMail
<span class="hljs-comment"># Define the next two variables optionally when using OpenAI's API.</span>
<span class="hljs-comment"># os.environ['_OPEN_AI_MODEL']="gpt-3.5-turbo" </span>
<span class="hljs-comment"># os.environ['_OPEN_AI_API']="sk-xxxxxx"</span>
os.environ[<span class="hljs-string">'_GAMIL_RECIPIENT_ADDR'</span>] = <span class="hljs-string">'xxxxxxx@gmail.com'</span>
os.environ[<span class="hljs-string">'_GMAIL_SENDER_ADDR'</span>] = <span class="hljs-string">'yyyyyy@gmail.com'</span>
os.environ[<span class="hljs-string">'_GMAIL_APP_PASSWORD_OF_SENDER'</span>] = <span class="hljs-string">'zzzzzz'</span>
sys.excepthook = ExceptMail.__call__
<span class="hljs-keyword">try</span>:
<span class="hljs-comment"># 02.Locate your code</span>
print(<span class="hljs-number">1</span>/<span class="hljs-number">0</span>)
SuccessMail().__call__() <span class="hljs-comment"># Success Mail</span>
<span class="hljs-keyword">except</span> ExceptMail <span class="hljs-keyword">as</span> e: <span class="hljs-comment"># Exception Mail </span>
sys.exit()
print(e)
SendMail().__call__() <span class="hljs-comment"># Put Any Line: Sending mail</span>
</div></code></pre>
</details>
<details>
<summary> Snippet for Python developers...</summary>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptMail, SuccessMail, SendMail
sys.excepthook = ExceptMail.__call__
<span class="hljs-comment"># Define the next two variables optionally when using OpenAI's API.</span>
<span class="hljs-comment"># os.environ['_OPEN_AI_MODEL']="gpt-3.5-turbo" </span>
<span class="hljs-comment"># os.environ['_OPEN_AI_API']="sk-xxxxxx"</span>
os.environ[<span class="hljs-string">'_GAMIL_RECIPIENT_ADDR'</span>] = <span class="hljs-string">'xxxxxxx@gmail.com'</span>
os.environ[<span class="hljs-string">'_GMAIL_SENDER_ADDR'</span>] = <span class="hljs-string">'yyyyyy@gmail.com'</span>
os.environ[<span class="hljs-string">'_GMAIL_APP_PASSWORD_OF_SENDER'</span>] = <span class="hljs-string">'zzzzzz'</span>
<span class="hljs-keyword">try</span>:
<span class="hljs-string">'your code'</span>
SuccessMail().__call__()
<span class="hljs-keyword">except</span> ExceptMail:
<span class="hljs-keyword">pass</span>
SendMail().__call__()
</div></code></pre>
</details>
<br>
<h2 id="discord"><em>Discord</em></h2>
<p><a href="https://colab.research.google.com/drive/1lwsIBpql_1zgEdIWRw6O_jBOZKJdHqBh?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></p>
<ul>
<li>a. Select the channel to receive notifications.</li>
<li>b. Click <code>Edit Channel</code> in the upper right corner of the chat window.</li>
<li>c. Click <code>Integrations</code> - <code>Webhook</code> - <code>New Webhook</code>.</li>
<li>d. Then click <code>Copy Webhook</code>.
<em>API TEST</em></li>
</ul>
<pre class="hljs"><code><div><span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> send_discord_msg
send_discord_msg(_DISCORD_WEBHOOK_URL, <span class="hljs-string">"Any Test Message"</span>)
</div></code></pre>
<p><em>Notifier</em></p>
<pre class="hljs"><code><div><span class="hljs-keyword">import</span> sys, os
<span class="hljs-keyword">from</span> ExceptNotifier <span class="hljs-keyword">import</span> ExceptDiscord, SuccessDiscord, SendDiscord
sys.excepthook = ExceptDiscord.__call__
<span class="hljs-comment"># Define the next two variables optionally when using OpenAI's API.</span>
<span class="hljs-comment"># os.environ['_OPEN_AI_MODEL']="gpt-3.5-turbo" </span>
<span class="hljs-comment"># os.environ['_OPEN_AI_API']="sk-xxxxxx"</span>
os.environ[<span class="hljs-string">'_DISCORD_WEBHOOK_URL'</span>] = <span class="hljs-string">"xxxxxxxxxxxxxxxxx"</span>
<span class="hljs-keyword">try</span>:
print(<span class="hljs-number">1</span>/<span class="hljs-number">20</span>)
SuccessDiscord().__call__() <span class="hljs-comment">#1 success sender </span>
<span class="hljs-keyword">except</span> ExceptDiscord <span class="hljs-keyword">as</span> e: <span class="hljs-comment">#2 except sender </span>
sys.exit()
SendDiscord().__call__() <span class="hljs-comment">#3 customized sender </span>
</div></code></pre>
<br>
<h2 id="chime"><em>Chime</em></h2>
<p><a href="https://colab.research.google.com/drive/1hUMMQ6He9M4MlspZ88J9kO8juxvC5b3a?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a></p>
<ul>
<li>a. Select the Chat room to receive notifications.</li>
<li>b. Click <code>Room Setting</code> in the upper right corner.</li>
<li>c. Click <code>Manage Webhook and bot</code></li>