-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinfoCalGOut.txt
763 lines (633 loc) · 38.2 KB
/
infoCalGOut.txt
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
infoCalGOut.txt
Overview
Calendar Google Out to Quick Books, Quicken, OpenERP, Odoo or some other invoicing program.
Keep your scheduled events in Google Calendar, perform the events, then bill for the time.
get and install google gdata.
DEV; in pyCharm run main.py.
python27\scripts\pip install --upgrade google-api-python-client
https://code.google.com/p/google-api-python-client/downloads/list
How do I implement code?
Find google_calendar_API_v3_1.pyc and copy to production?
Copy to smb://192.168.1.2/c$/Shares/Shared/Access/InvoiceExports
Backup google_calendar_API_v3_1.py and .pyc to C:\Users\dalem\PycharmProjects\calGOut\old
Then move to C:\Users\dalem\PycharmProjects\calGOut
Try it.
TODOs
I got dates out of the selection range.
On Wed 11 Jul 2018 I ran against 2018-06-16 through 2018-07-10 and got this data:
(datetime.datetime(2018, 6, 16, 0, 0), datetime.datetime(2018, 7, 11, 0, 0), u'Bill ', 'calGOut.csv')
"Dale E. Moore","2017-07-06","15:00:00",2:00:00,"Bill Virginia and Charles Bowden, backups+"
...
Try it in PyCharm.
Verify that the calGOut.csv contains all the records displayed. 42 records/rows all the ones displayed.
Why do records outside the date range get included?
At DaleHome.QnD as dalem failing on authorization.
Traceback (most recent call last):
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 2593, in get_events
BowChickaWowWow()
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 2411, in BowChickaWowWow
gcal.AgendaQuery(startText=str(start_date), endText=str(end_date))
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 1736, in AgendaQuery
eventList = self._SearchForCalEvents(start, end, None)
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 1649, in _SearchForCalEvents
events = work.execute()
File "/home/dalem/.virtualenvs/calGOut/local/lib/python2.7/site-packages/oauth2client/util.py", line 137, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/dalem/.virtualenvs/calGOut/local/lib/python2.7/site-packages/googleapiclient/http.py", line 842, in execute
raise HttpError(resp, content, uri=self.uri)
HttpError: <HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars/jq6pbp8iau4bbii47ri5lk6ue8%40group.calendar.google.com/events?timeMax=2017-12-19T00%3A00%3A00-06%3A00&alt=json&singleEvents=true&timeMin=2017-12-12T00%3A00%3A00-06%3A00 returned "Not Found">
Process finished with exit code 0
At MW.Mercury as guest1 /home/guest1/bin/calGOut/calGOut.sh in gnome-shell menu, running GREAT.
I can't see any logging.
Implement a logging option or always output to calGOut.log in CWD?
Getting error running on DaleHome.QnD:
Status: Waiting for entry...
Traceback (most recent call last):
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 2593, in get_events
BowChickaWowWow()
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 2411, in BowChickaWowWow
gcal.AgendaQuery(startText=str(start_date), endText=str(end_date))
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 1736, in AgendaQuery
eventList = self._SearchForCalEvents(start, end, None)
File "/home/dalem/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line 1649, in _SearchForCalEvents
events = work.execute()
File "/home/dalem/.virtualenvs/calGOut/local/lib/python2.7/site-packages/oauth2client/util.py", line 137, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/dalem/.virtualenvs/calGOut/local/lib/python2.7/site-packages/googleapiclient/http.py", line 842, in execute
raise HttpError(resp, content, uri=self.uri)
HttpError: <HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars/jq6pbp8iau4bbii47ri5lk6ue8%40group.calendar.google.com/events?timeMax=2017-12-17T00%3A00%3A00-06%3A00&alt=json&singleEvents=true&timeMin=2017-12-10T00%3A00%3A00-06%3A00 returned "Not Found">
https://www.googleapis.com/calendar/v3/calendars/jq6pbp8iau4bbii47ri5lk6ue8%40group.calendar.google.com/events?timeMax=2017-12-17T00%3A00%3A00-06%3A00&alt=json&singleEvents=true&timeMin=2017-12-10T00%3A00%3A00-06%3A00
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
https://console.developers.google.com/cloud-resource-manager
Doesn't help.
https://stackoverflow.com/questions/19335503/keep-getting-a-daily-limit-for-unauthenticated-use-exceeded-continued-use-requ
I too ran into the same error - "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup".
I went and checked my google developer console under APIs for the project associated with the API key/ auth key, eg, https://console.developers.google.com/project/<your app id>/apiui/api. The status for Google+API was set to OFF. I turned it ON.
I then got another access token, and then tried with the new one. It worked, ie, the error was gone and I got the profile details. To cross-check if that was indeed the cause of the error, I went back to console and disabled Google+ API. But now, I get the error:
"Access Not Configured. Please use Google Developers Console to activate the API for your project."
So, I am not 100% sure that it was the turning on/off of the Google+ API in my developer console, but do ensure that this is turned on. Also, wait a few minutes after turning on, and ensure that you get a fresh token each time before trying it.
https://console.developers.google.com/project/<your app id>/apiui/api
https://console.developers.google.com/project/daleemoore/apiui/api
https://console.developers.google.com/apis/dashboard?project=daleemoore&duration=PT1H
Enable apis and Services
Google Calendar API
It's already "API Enabled"
https://developers.google.com/apis-explorer/?hl=en_US#p/calendar/v3/
Looking for project... how do I tell my code "API Project" or dlaeemoore?
https://programtalk.com/python-examples/oauth2client.tools.run_flow/
https://programtalk.com/vs2/python/10371/fitbit-googlefit/auth/auth_google.py/
https://developers.google.com/api-client-library/python/guide/aaa_client_secrets
https://console.developers.google.com/cloud-resource-manager
Writing ./t1.csv when it should be calGOut.csv, shouldn't it?
I'm a bit perplexed by this. I think this means I had an
old version on MW.Mercury and merged it.
# google_calendar_API_v3_1.py
ents['Search String'].insert(0, "Bill ")
#ents['Search String'].insert(0, "Bill")
ents['Destination File'].delete(0,END)
ents['Destination File'].insert(0, "calGOut.csv")
#ents['Destination File'].insert(0, "t1.csv")
Fixed; but still errors in processing code.
I'm thinking the problem was not the MW.Mercury version (which had been working except for the
Google authorization issue.) I'm thinking the problem was the old version on DaleHome.QnD!
Save this code.
Restore from before any pushes today or from QnD in recent days.
Hmmmm... it seems to be merged OK now.
Tkinter missing
DaleHome.QnD had pyenv and old versions confusion.
mv ~/.pyenv ~/pyenvOld
reboot
Fix Pycharm project still has pyenv virtual environment.
It seems to be working OK now
oauth2client==1.4.12 # later versions don't have ".run".:w
Needed in requirements.txt because Google authorization changed.
I wonder what I will do in the future?
DaleHome.QnD fails to run because of TK installation failure.
pip install Tkinter
InsecurePlatformWarning
Could not find a version that satisfies the requirement Tkinter (from versions: )
No matching distribution found for Tkinter
https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning
https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2
pip install urllib3[secure]
Nothing on QnD.
QnD VM Ubuntu1710 "sudo apt install python-tk" did the trick.
Incorporate icon in desktop
/usr/share/icons/oxygen/64x64/mimetypes/text-calendar.png
Create auto-updater but don't auto-update if change is in major or minor version.
major.minor.miniscule version identifier.
Auto miniscule incrementor in PyCharm?
Export to QuickBooks import, or MS Access import file.
I need it in MS Access.
In the long run in need it direct to QuickBooks (IIF?)
Make Linux .desktop file.
calGOut.desktop
126 dalem@QnD:~/PycharmProjects/calGOut⟫ python main.py
Traceback (most recent call last):
File "main.py", line 14, in <module>
from Tkinter import * # Python2
File "/home/dalem/.pyenv/versions/2.7.5/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
Writing ./t1.csv when it should be calGOut.csv, shouldn't it?
I'm a bit perplexed by this. I think this means I had an
old version on MW.Mercury and merged it.
# google_calendar_API_v3_1.py
ents['Search String'].insert(0, "Bill ")
#ents['Search String'].insert(0, "Bill")
ents['Destination File'].delete(0,END)
ents['Destination File'].insert(0, "calGOut.csv")
#ents['Destination File'].insert(0, "t1.csv")
Fixed; but still errors in processing code.
I'm thinking the problem was not the MW.Mercury version (which had been working except for the
Google authorization issue.) I'm thinking the problem was the old version on DaleHome.QnD!
Save this code.
Restore from before any pushes today or from QnD in recent days.
Restored from git branch WorkedAt-MW.Mercury (12/10/17) and all seems well.
I've replaced the missing stuff from infoCalGOut.txt.
Now I just have the Google Authorization problem to permanently fix.
Tkinter missing
DaleHome.QnD had pyenv and old versions confusion.
mv ~/.pyenv ~/pyenvOld
reboot
Fix Pycharm project still has pyenv virtual environment.
It seems to be working OK now
oauth2client==1.4.12 # later versions don't have ".run".:w
Needed in requirements.txt because Google authorization changed.
I wonder what I will do in the future?
DaleHome.QnD fails to run because of TK installation failure.
pip install Tkinter
InsecurePlatformWarning
Could not find a version that satisfies the requirement Tkinter (from versions: )
No matching distribution found for Tkinter
https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning
https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2
pip install urllib3[secure]
Nothing on QnD.
QnD VM Ubuntu1710 "sudo apt install python-tk" did the trick.
Installed new development environment and now get:
ERROR: Missing module - cannot import name run
https://github.com/insanum/gcalcli/issues/204
Looks like I need to anchor
oauth2client==1.4.12
in requirements.txt and things look better.
authentication via google chrome.
Getting lots of:
** Message: received an invalid or unencryptable secret
[16115:16472:1207/085404.284057:ERROR:native_backend_libsecret.cc(530)] Unable to load secret itemReceived invalid secret from the secret storage
Running fine now without errors. I think it MIGHT BE because of the authorization.
Implement this code, or run at Buba and see if it works?
Run at Buba from terminal
X:\Scripts\calGOut\main.py
Same error 'returned "Not Found"'.
Check Firefox, default browser, has google calendar access.
From CMD URL https://calendar.google.com it works FINE.
Thu 7 Dec 2017 9:15 AM CST
calGOut.py has problems accessing data.
Gets "Not Found" on the following:
https://www.googleapis.com/calendar/v3/calendars/jq6pbp8iau4bbii47ri5lk6ue8%40group.calendar.google.com/events?timeMax=2017-12-07T00%3A00%3A00-06%3A00&alt=json&singleEvents=true&timeMin=2017-11-30T00%3A00%3A00-06%3A00
But Firefox gives me:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
Try: https://code.google.com/apis/console
Goes to: https://console.developers.google.com/cloud-resource-manager
Which is Google APIs and has advertisement:
Like our APIs? Check out our infrastructure. Sign up to get $300 in credit and 12 months to explore Google Cloud Platform.
Learn more = https://cloud.google.com/free/?hl=en_US&_ga=2.107156363.-821334208.1478699030
Which is "Google Cloud Platform Free Tier" and has a "Try it free" button.
Where I have two "projects":
API Project api-project-936484003082
daleemoore daleemoore
Both have one member, [email protected].
See if calGOut references api-project-936484003082 or daleemoore projects.
api-project-936484003082 does not seem to be anywhere in the calGOut project.
So how does this authentication work?
Do I need to upgrade to a newer version of oauth?
What does "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." have to say for itself?
Look for googleapis.com in code... 6 matches in 5 files.
See https://stackoverflow.com/questions/19335503/keep-getting-a-daily-limit-for-unauthenticated-use-exceeded-continued-use-requ for other information.
Implement this new aaaaaaauthoriiiiiiiiiiiiization:
From MW.Buba infoDaleM.txt
Didn't do any implementation of this authorization on MW.Mercury. But it seems to have worked and I got these console
messages:
/usr/bin/python2.7 /home/dalem/PycharmProjects/calGOut/main.py
('/home/dalem/PycharmProjects/calGOut/main.py', 'csv', '2017-11-30', '2017-12-06')
Status: Starting...
Status: Waiting for entry.https://code.google.com/apis/console..
Message: Enter dates as yyyy-mm-dd!
Status: Processing...
WARNING:root:This function, oauth2client.tools.run(), and the use of the gflags library are deprecated and will be removed in a future version of the library.
(datetime.datetime(2017, 11, 30, 0, 0), datetime.datetime(2017, 12, 7, 0, 0), u'Bill ', 'calGOut.csv')
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Furlshortener&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&client_id=232867676714.apps.googleusercontent.com&access_type=offline
If your browser is on a different machine then exit and re-run
this application with the command-line parameter
--noauth_local_webserver
Authentication successful.
couldn't lock 16384 bytes of memory (secret_session): Cannot allocate memory
[23893:24177:1207/152916.154035:ERROR:get_updates_processor.cc(244)] PostClientToServerMessage() failed during GetUpdates
"Dale E. Moore","2017-11-30","08:00:00",1:30:00,"Bill Weinblatt for anti virus"
"Dale E. Moore","2017-11-30","09:30:00",1:00:00,"Plan to get chain saw from Bill and virtual box"
"Dale E. Moore","2017-11-30","13:45:00",1:30:00,"Bill Virginia for find files, maybe move Charles win 10 to win 7, poor kitten"
"Dale E. Moore","2017-12-01","09:30:00",1:00:00,"Bill ABDO for sharing violation"
"Dale E. Moore","2017-12-03","10:30:00",1:30:00,"TiVo will try to bill my Discover card on about the 15th for the next year for my Bolt. I'll have to give them the new expiration date."
"Dale E. Moore","2017-12-05","07:30:00",1:00:00,"Bill Charlie Sargent for breakfast and fix his backups; in email."
"Dale E. Moore","2017-12-05","09:00:00",1:00:00,"Bill credit ? Check in Jack George backups, rsync"
"Dale E. Moore","2017-12-05","11:30:00",0:30:00,"Help Bill Ellis with Internet server not found for IRVNET."
Status: Waiting for entry...
Process finished with exit code 0
It looks like it's re-authorizing on each workstation (QnD, Mercury, Buba.)
What is the correct or easy way to upgrade Buba to the latest code?
PyCharm upgrade?
Should I have an authorization mode for calGOut?
It looks like it's doing that automatically with the new code.
But not at Buba!
Still failing on Buba, works OK on QnD and Mercury.
Works on PC JenOvo. What's wrong with Buba?
Use Mercury until Buba fixed.
Buba failure:
Status: Processing...
(datetime.datetime(2017, 11, 29, 0, 0), datetime.datetime(2017, 12, 6, 0, 0), u'Bill ', 'calGOut.csv')
Traceback (most recent call last):
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", line 2591, in get_events
Message: <HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars/jq6pbp8iau4bbii47ri5lk6ue8%40group.calendar.google.com/events?timeMax=2017-12-06T00%3A00%3A00-06%3A00&alt=json&singleEvents=true&timeMin=2017-11-29T00%3A00%3A00-06%3A00 returned "Not Found">
BowChickaWowWow()
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", line 2409, in BowChickaWowWow
gcal.AgendaQuery(startText=str(start_date), endText=str(end_date))
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", line 1734, in AgendaQuery
eventList = self._SearchForCalEvents(start, end, None)
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", line 1648, in _SearchForCalEvents
events = work.execute()
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\googleapiclient\http.py", line 723, in execute
raise HttpError(resp, content, uri=self.uri)
HttpError: <HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars/jq6pbp8iau4bbii47ri5lk6ue8%40group.calendar.google.com/events?timeMax=2017-12-06T00%3A00%3A00-06%3A00&alt=json&singleEvents=true&timeMin=2017-11-29T00%3A00%3A00-06%3A00 returned "Not Found">
Status: Waiting for entry...
https://www.googleapis.com/calendar/v3/calendars/jq6pbp8iau4bbii47ri5lk6ue8%40group.calendar.google.com/events?timeMax=2017-12-06T00%3A00%3A00-06%3A00&alt=json&singleEvents=true&timeMin=2017-11-29T00%3A00%3A00-06%3A00
Gets:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
https://code.google.com/apis/console
Goes to https://console.developers.google.com/cloud-resource-manager
I don't underztand, it appears that it's not authenticating like QnD and Mercury did.
I think that I did not upgrade Buba which is still failing.
pycharm VCS pull
Why is the field ents undefined in the current code?
Did previous copies of the code have a valid definition for the field ents?
Though UNDEFINED, the code seems to run fine... why is that?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 67: ordinal not in range(128)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 67: ordinal not in range(128)
Bad character in some record from Google.
Display line after read so I know which line is in error.
http://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20
.encode('utf-8').strip()
Message: 'ascii' codec can't decode byte 0xc2 in position 67: ordinal not in range(128)
http://stackoverflow.com/questions/21129020/how-to-fix-unicodedecodeerror-ascii-codec-cant-decode-byte
Try except error and display which calendar description is failing.
I MIGHT have fixed the problem, but; it doesn't display that there was a data error; I think. So I've commented
out the code and expect that when I encounter the next data error I will be able to make it display.
Make the code self-updating except when (major.minor.miniscule) major or minor? changes.
Save the default values so it's customized to the installed instance.
Launch it from a Desktop ICON.
Python Launcher for Windows (Console) Python Software Foundation.
(Instead of python.exe.) It looks like it's launching idea.
C:\Users\dalem\PycharmProjects\calGOut\main.py
C:\Users\dalem\PycharmProjects\calGOut
Make the UI more obvious.
Tell me when it's done processing, or launch Excel.
Preview CSV output in form allowing EXPORT check-box for inclusion.
Export EXPORT checked items to a QuickBooks formatted file.
Like TimerMW1.IIF:
!TIMERHDR VER REL COMPANYNAME IMPORTEDBEFORE FROMTIMER COMPANYCREATETIME
TIMERHDR 6 0 Moore Works N Y 915135124
!TIMEACT DATE JOB EMP ITEM PITEM DURATION PROJ NOTE XFERTOPAYROLL BILLINGSTATUS GUID
TIMEACT 12/31/2014 Medical Reimbursement Moore, Dale E Hrs 125 1 (12/31/2014) 001 PC Michelle power supply repairs N 1 203
TIMEACT 1/1/2015 Berridge Manufacturing Company Moore, Dale E Hrs 125 6.5 (1/1/2015) 001 TEST site DNS failing on some pages, email MS Exchange research, product-picture-slider training N 1 204
TIMEACT 1/2/2015 Berridge Manufacturing Company Moore, Dale E Hrs 125 1 (1/2/2015) 001 Researching WordPress email to MS Exchange failing N 1 205
TIMEACT 1/5/2015 LF Incassable LLC Moore, Dale E Hrs 125 2 (1/5/2015) 001 User and company account access, user account RDP setup N 1 206
TIMEACT 1/5/2015 Berridge Manufacturing Company Moore, Dale E Hrs 125 1.5 (1/5/2015) 001 Product-picture-slider research N 1 207
Find out NEW QB IIF format and start using that.
Add column names in CSV output.
Make it prettier.
Make simple Linux, MAC and Windows installer.
https://www.jetbrains.com/pycharm/webhelp/creating-and-running-setup-py.html
https://docs.python.org/2/distutils/setupscript.html
Install Python for your platform.
Install setuptools and pip.
pip install -e requirements.txt
Configure calGOut with shortcut, link, or whatever to run main.py.
Created TrySetup git branch to try out PyCharm setup and installation.
Use pip uninstall to get rid of it?
What do I make, an egg? An egg seems to be a binary distribution.
What does setup make, an egg?
Tools, Create setup.py
Define license "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)"
Can install from github? [-e] git+git://git.myproject.org/MyProject#egg=MyProject
https://pip.pypa.io/en/latest/reference/pip_install.html#pip-install-examples
Create UnitTests
Right-click project, create unittests, run unittests, ...
Make it prettier.
Startup Icon?
tkinter form watermark?
Activity progression animations?
setup.py might be needed to install all the requirements in the VirtualEnvironment.
If not dateutil.tz then run setup.py to get everything?
sudo pip install python-dateutil --upgrade
sudo pip install pytz --upgrade
Logs
Thursday 14 August 2014 11:44 PM CST
Created
Monday 8 September 2014 5:05 PM CST
Capture recent time from the calendar.
Use enter2, or enter3 to capture account, password, calendar, start_date, end_date, filter.
Remember them for next run.
Access Google Calendar via API?
https://github.com/tpopela/google_calendar_fetcher
Python3, google_calendar_fetcher gets it, yea!
https://github.com/search?utf8=%E2%9C%93&q=google+calendar+python&type=Repositories&ref=searchresults
https://developers.google.com/api-client-library/python/start/get_started
https://developers.google.com/api-client-library/python/samples/samples#Calendar_API
https://developers.google.com/google-apps/calendar/v2/developers_guide_python (Deprecated but Python examples.)
https://developers.google.com/google-apps/calendar/
https://developers.google.com/google-apps/calendar/v1/developers_guide_python
https://developers.google.com/google-apps/calendar/v2/developers_guide_python
Output events to CSV
to Quick Books
to Quicken
Tuesday 25 November 2014 8:18 AM CST
gcalcli.py
# From https://raw.githubusercontent.com/insanum/gcalcli/master/gcalcli
calGOut gcalcli.py
dalem@QnD:~/PycharmProjects/calGOut⟫ python ./gcalcli.py agenda
Sat Nov 22 Blake and Kids in SA
Tue Nov 25 Robbie in sa
5:00am Moore Works Recycling pickup day
7:00am Dale's Day; do what you want.
9:00am ?Jack George at Moore works
11:30am Lunch
12:00pm Lunch
1:30pm Check on SSFCU to Wells Fargo External account
1:30pm Cover DaleHome Kitchen
6:00pm Check Investments; use Google Stocks?
6:00pm Clean toilets for Olivia
6:30pm Steve Aronstein is home from walking the neighbor's dog.
Wed Nov 26 Jo Anne Thomas's birthday
Emily Nicole Rogers's birthday
8:00am Drain hot water heater for 10 seconds
8:30am Change A/C Filter or does the CPS thermostat tell me when?; Clorox A/C drain line
9:00am All; MW billing, staff, programming
9:00am Dale; Pay DaleEMoore eMail yellow-exclamation marked
9:00am ?Jack George at Moore works
9:00am Quest Diagnostics overpaid
9:00am Change a/c filter home 14x25x1, mw 16x25x1; Change A/C Filter or does the CPS thermostat tell me when?; Clorox A/C drain line
10:00am Keep Westar billing to less than 20 hours/month, about 4 hours/week
10:00am Fix Abdo Complimentary Credit from last week!
11:30am OFOWC
6:30pm Steve Aronstein is home from walking the neighbor's dog.
Thu Nov 27 Thanksgiving day.
Thanksgiving Day (QC Holiday)
Thanksgiving Day
5:00am Bill $ $2,081.99/week = 16.66 hours (cover Moore Works expenses)
8:00am Joanie and Dale in Austin
10:00am Thanksgiving To Austin
11:00am Thanksgiving in Austin
4:00pm Mom early TDay dinner with Judy
6:30pm Steve Aronstein is home from walking the neighbor's dog.
Fri Nov 28 Day after Thanksgiving Day (QC Holiday)
Don Williams's birthday
5:00am Moore Works Garbage pickup day
9:00am ?Jack George at Moore works
6:30pm Steve Aronstein is home from walking the neighbor's dog.
8:00pm Thanksgiving To San Antonio
Sat Nov 29 Maile Kono-Wells bday
Terry Ross's birthday
8:00am To/From Austin Grandchildren
6:30pm Steve Aronstein is home from walking the neighbor's dog.
It looks like I've found the google-python-api v3 example I needed.
Thu 27 Nov 2014 10:07 PM CST
On Bonnie Purser's machine in Austin at Joey's where we've just fixed it not booting.
I installed PyCharm and calGOut and in just a few minutes had
calGOut running with tkinter and
gcalcli running.
YEAH!
Mon 1 Dec 2014 4:20 PM CST
/usr/bin/python2.7 /home/dalem/PycharmProjects/calGOut/gcalcli.py agenda 11/22/14 11/26/14
Gives me lots of what I want.
What if I want to run against a different Google account?
Can gcalcli.py do everything I need?
Evaluate gcalcli.py's gflags usage for options that give me what I want.
gcalcli.py agenda 11/22/14 11/26/14
gcalcli.py search "bill" agenda 11/22/14 11/26/14
invalid search string.
gcalcli.py search "bill"
case insensitive
remove special formatting, make CSV or TSV?
[0m[0;33m
2000-05-20[0m[0;36m 7:00pm Playful Ritual
remove multiple instances of the same event output.
--nocolor
--detail_all
dalem@QnD:~/PycharmProjects/calGOut⟫ python ./gcalcli.py search "bill" --nocolor --detail_all > t1.txt
dalem@QnD:~/PycharmProjects/calGOut⟫ python ./gcalcli.py search "bill" --nocolor > t1.txt
dalem@QnD:~/PycharmProjects/calGOut⟫ python ./gcalcli.py agenda 11/12/14 11/26/14 | grep -i bill
dalem@QnD:~/PycharmProjects/calGOut⟫ python ./gcalcli.py agenda 11/12/14 11/26/14 --details all | less
dalem@QnD:~/PycharmProjects/calGOut⟫ python ./gcalcli.py agenda 11/12/14 11/26/14 --details calendar --details length --nocolor | less
not on a single line, hard to parse and import.
/usr/bin/python2.7 /home/dalem/PycharmProjects/calGOut/gcalcli.py csv 11/22/14 11/26/14
Make it output what I want when I want it.
https://developers.google.com/google-apps/calendar/v1/developers_guide_dotnet
This API is a subject to the Deprecation Policy and will be shutdown on November 17, 2014. Please use APIv3 instead.
https://developers.google.com/google-apps/calendar/
Google Calendar API v3
https://developers.google.com/google-apps/calendar/v3/reference/calendars/get
Python Client Library
https://code.google.com/p/google-api-python-client/
https://developers.google.com/google-apps/calendar/migration
https://developers.google.com/google-apps/calendar/setup
https://developers.google.com/google-apps/calendar/instantiate
Thu 4 Dec 2014 9:06 AM CST
setup.py might be needed to install all the requirements in the VirtualEnvironment.
If not dateutil.tz then run setup.py to get everything?
sudo pip install python-dateutil --upgrade
sudo pip install pytz --upgrade
requirements.txt contains everything I need for PyCharm to install.
Fri 5 Dec 2014 7:23 AM CST
Shifting from command-line date strings to calculated last-2-weeks date strings is failing.
Figure out how to get last-2-weeks into command-line acceptible format.
Make main.py run it.
Change tkinter options page to have key fields.
Wed 3 Jun 2015 9:27 AM CST
Change the default ['Search String'] from "Bill" to "Bill " so I avoid stuff like "billable" and "billing".
Wed 10 August 2016 7:33 AM CST
oauth2client.client.AccessTokenRefreshError: invalid_grant
Trying to fix a bug when running as guest1@Mercury.
http://stackoverflow.com/questions/23918443/got-invalid-grant-in-oauth2-signedjwtassertioncredentials
This MIGHT been because I'd not git pull-ed the most recent code.
Fixed buy git pull-ing the most recent code!
Wed 4 Jan 2017 11:21 AM CST
Got a failure on We 4 Jan 2017 but new versions seems to have fixed things...
('C:\\Users\\dalem\\PycharmProjects\\calGOut\\main.py', 'csv', '2016-12-28', '20
17-01-03')
Status: Starting...
Status: Waiting for entry...
Message: Enter dates as yyyy-mm-dd!
Status: Processing...
(datetime.datetime(2016, 12, 28, 0, 0), datetime.datetime(2017, 1, 4, 0, 0), u'B
ill ', 'calGOut.csv')
Message: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol
Traceback (most recent call last):
File "/home/guest1/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line
2569, in get_events
File "/home/guest1/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line
2387, in BowChickaWowWow
File "/home/guest1/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line
1712, in AgendaQuery
File "/home/guest1/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line
1616, in _SearchForCalEvents
File "/home/guest1/PycharmProjects/calGOut/google_calendar_API_v3_1.py", line
536, in _CalService
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positi
onal_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\googleapiclient\discovery.py", line 198, i
n build
resp, content = http.request(requested_url)
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positi
onal_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 538, in new_
request
redirections, connection_type)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1593, in reque
st
(response, content) = self._request(conn, authority, uri, request_uri, metho
d, body, headers, redirections, cachekey)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1335, in _requ
est
(response, content) = self._conn_request(conn, request_uri, method, body, he
aders)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1257, in _conn
_request
conn.connect()
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1021, in conne
ct
self.disable_ssl_certificate_validation, self.ca_certs)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 80, in _ssl_wr
ap_socket
cert_reqs=cert_reqs, ca_certs=ca_certs)
File "C:\Python27\lib\ssl.py", line 387, in wrap_socket
ciphers=ciphers)
File "C:\Python27\lib\ssl.py", line 143, in __init__
self.do_handshake()
File "C:\Python27\lib\ssl.py", line 305, in do_handshake
self._sslobj.do_handshake()
SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol
Status: Waiting for entry...
Ran DEV on Windows, ran fine, without error.
Then ran LIVE on Windows, still no problem. I'm assuming that the DEV installation improved the package support on Windows perhaps with new versions.
We 8 Mar 2017 8:05 AM CST
calGOut failing with "Message: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol":
('C:\\Users\\dalem\\PycharmProjects\\calGOut\\main.py', 'csv', '2017-03-01', '20
17-03-07')
Status: Starting...
Status: Waiting for entry...
Message: Enter dates as yyyy-mm-dd!
Status: Processing...
(datetime.datetime(2017, 3, 1, 0, 0), datetime.datetime(2017, 3, 8, 0, 0), u'Bil
l ', 'calGOut.csv')
Message: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol
Traceback (most recent call last):
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", lin
e 2591, in get_events
BowChickaWowWow()
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", lin
e 2409, in BowChickaWowWow
gcal.AgendaQuery(startText=str(start_date), endText=str(end_date))
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", lin
e 1734, in AgendaQuery
eventList = self._SearchForCalEvents(start, end, None)
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", lin
e 1638, in _SearchForCalEvents
work = self._CalService().events().\
File "C:\Users\dalem\PycharmProjects\calGOut\google_calendar_API_v3_1.py", lin
e 536, in _CalService
http=self._GoogleAuth())
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positi
onal_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\googleapiclient\discovery.py", line 198, i
n build
resp, content = http.request(requested_url)
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 132, in positi
onal_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 538, in new_
request
redirections, connection_type)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1593, in reque
st
(response, content) = self._request(conn, authority, uri, request_uri, metho
d, body, headers, redirections, cachekey)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1335, in _requ
est
(response, content) = self._conn_request(conn, request_uri, method, body, he
aders)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1257, in _conn
_request
conn.connect()
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1021, in conne
ct
self.disable_ssl_certificate_validation, self.ca_certs)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 80, in _ssl_wr
ap_socket
cert_reqs=cert_reqs, ca_certs=ca_certs)
File "C:\Python27\lib\ssl.py", line 387, in wrap_socket
ciphers=ciphers)
File "C:\Python27\lib\ssl.py", line 143, in __init__
self.do_handshake()
File "C:\Python27\lib\ssl.py", line 305, in do_handshake
self._sslobj.do_handshake()
SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol
Status: Waiting for entry...
Try it again... No error this time. Something at Google or on Buba during programs startup?
# .vimrc needs ":set modeline" in Ubuntu to turn on modeline processing.
# Make the following line the last line of the file, always.
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: