A repository for managing Metakgp issues.
Want to talk? We hang out on Slack: Here is an invite for you.
Get Your Freaking Timetable
License: MIT License
A repository for managing Metakgp issues.
Want to talk? We hang out on Slack: Here is an invite for you.
Instead of just printing to use generate_ics.py
in the end of gyft.py
, prompt the user for confirmation whether they want ics file or not and if yes we can just directly execute the generate_ics.py
script.
Same goes for add_events.py
And integrate del_events.py
via a cli argument what they want to do. Basically one should only use gyft.py
for whatever their need be
Note I am not clear about the role of
del_events.py
so let's first of al complete the first two tasks and if you know what the other file does please tell me.
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
after adding to Google calendar, its default setting it to repeat till 2018
can be repeated till the week end
gyft.py
into
Note Time table extractor will be imported in both - obviously.
Svelte
- @rohan-b-84We currently take roll number as an argument and do not check if it is provided or not.
It would be good to have a check if the argument ("user") is not None and if it is None, ask the user to enter it and then proceed.
Reference: https://stackoverflow.com/questions/30487767/check-if-argparse-optional-argument-is-set-or-not
This issue is not about a specific post. I'd rather like to discuss a few things that increase the scope of the project.
naarad
, we can scrape events from most of the society pages periodically and create calender events - no need to do anything manually. This, too, can be offered as an exported calender.I do not know what are the specific issues in implementing these, but I think that the above combined with a resolution of existing issues will really pack a punch.
Ideas?
Implement optional CLI arguments --output
and --input
using which the user can supply the path to the output ICS file and the input data file
Work begun at: https://github.com/icyflame/gyft/tree/generate-ics-file
LIke currently it shows N241 and likewise.
If we add the proper lat-lng, it can be shown in Google Maps.
TODO:
After running del_events.py only current month's events are removed from calendar.
Network.py has various things which are already handled by the package itself, like:
Thus the functions of interest are:
refresh_cookies
-> Not neededpost
-> Remove usage of cookieslogin
-> Update accordinglyOn typing
python3 gyft.py
we get
Traceback (most recent call last):
File "C:\Users\Anindita\OneDrive\Desktop\gyft\gyft.py", line 2, in
from timetable import delete_calendar, create_calendar, build_courses, generate_ics
File "C:\Users\Anindita\OneDrive\Desktop\gyft\timetable_init_.py", line 1, in
from timetable.extractor import *
File "C:\Users\Anindita\OneDrive\Desktop\gyft\timetable\extractor.py", line 4, in
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
Get vacation list and exam times from academic calendar and hack it into add_events.py
.
Improvisation in selecting date periods :
(1) The Sync should be made to the Google Calendar, only till beginning of end-semester exams. Currently, the sync is made for all weeks after the current week.
(2) The week of mid-semester / end-semester exams should be left vacant at least, or even better - be filled with the user's mid-semester / end-semester timetable.
If there are no events on a given day, the program throws the following error:
Traceback (most recent call last):
File "gyft.py", line 114, in <module>
txt = tds[a].find('b').text.strip()
AttributeError: 'NoneType' object has no attribute 'text'
Currently, line 77 of add_events.py
throws socket error due to insti proxy.
Modification required is :
http = credentials.authorize(httplib2.Http(proxy_info = httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_HTTP_NO_TUNNEL, '10.3.100.207', 8080)))
The idea is pretty simple, we don't have to maintain a subjects.json
for fetching the name of the course. We can directly fetch it from erp itslef.
Possible solutions:
Just because some classes are not included in subjects.json
, the class is being classified as a lab. Instead, how about checking the number of hours of the class on that day?
if number_of_hours < 3 => class
else => lab
Currently, we do not check for the validation of roll numbers entered.
In practicality it is not feasible to verify if the roll number is correct but
we can surely filter wrong formatted rolls numbers using REGEX check.
Labs are not included in current subjects.json
The generated ics file includes institute holidays for the whole year. Due to this, some holidays may be repeated if gyft is used for both semesters. Adding holidays only relevant to the semester will be better.
Additionally, having an option to add holiday events or not would be nice.
There is a vulnerability in the urllib3 version we currently use.
Update it to urllib3>=1.23
if ("Class of " in event['summary'] or "Lab of " in event['summary']):
KeyError: 'summary'
It might be useful back then but not now.
If required to create something other than just timetable.ics
(Like - time table pdf or timetable CLI representation) we can directly use timetable_dict
.
This is just an overhead at this point
Current request library comes with a security threat. We need to use: requests>=2.20.0.
Update it in the requirements.txt file.
If internet connection doesn't exist, store the event to be added to calendar in some json file. And later when there's internet connection, sync it to Google calendar.
Internet connection can be determined by posting a request to Google.com or something (neglecting the probability of Google's server being down) & checking it's response...
Also, is a terminal version of this possible for offline cases? I mean, can ALL the events be stored into json and be accessed with bash commands with tab auto_complete feature?
Current web app is based on the password model which will be replaced with the OCR model and hence we require a new web app.
Under this web app, the user will be able to submit an image and download the ICS file after all the backend work is done.
@ghostwriternr assign me please.
AttributeError: module 'oauth2client' has no attribute 'file'
while running add_event.py.
Modify add_events.py and del_events.py accordingly
Currently the timeline only includes endsems and midsems. We can extend that to:
Python standard package manager is Pipenv now, and the gyft requirements should shift to it.
$ python gyft.py --help
Enter your ERP password:
Asking for the password in such scenario is totally irrelevant.
Currently we ask the user to input password and, for obvious reasons, it's a bad practice.
A better way to do this would be using OCR and identifying elements by reading the image of time table taken using any device, or in the very least, just the actual timetable.
@ghostwriternr Any other spec you'd like to see? Assign to me :)
Add a user preference file which contains the semantics of the message to be added onto the Google Calendar. This will preferably be a yaml
/ json
/ md
file - which will be gitignore
-d.
class: "Class of "
lab: "Lab of "
On the web portal of gyft
, this can be taken as input (rather than a file) from the user before syncing.
The error is:
$ python3 add_events.py
Traceback (most recent call last):
File "add_events.py", line 6, in <module>
from apiclient import discovery
ImportError: cannot import name 'discovery'
apiclient
is not listed in the present requirements.txt
file. I added the line apiclient==1.0.3
and then ran pip3 install -r requirements.txt
I tried to import "discovery" inside a Python 3 shell, but it didn't work there either. I think they have dropped this submodule (?)
This issue has been faced before: shazow/apiclient#9 (comment)
Also, the author says
Possibly? Though I don't recall there ever being a discovery submodule.
Honestly this library is not very maintained anymore. It's very simple in what it does, so I haven't touched > it in years.
So, maybe you can use another library or fix this.
The script will begin with the following list of lists:
[ [ BEGIN_1, END_1 ], [ BEGIN_2, END_2 ], [ BEGIN_3, END_3 ], ...]
The events that are created will be created only in between these dates. i.e. timetable events won't be created for the time between END_1
and BEGIN_2
etc.
Once implemented, this can be easily improved to include both vacations (Durga Puja), mid-term, end-term, holidays (from the holiday list).
Do this in both the available flows:
As is obvious by the name of the issue the repo needs to be updated with the dates of the 2020 spring semester.
The academic calendar for 19-20 can be found at http://www.iitkgp.ac.in/files/acad_cal1920.pdf
Previously, we searched for regex Class of
or Lab of
in del_events.py
to choose only events added by gyft
and then delete them. But after merging of PR #15 , this regex will no longer be valid. We need some other way to delete gyft
events from Google Calendar.
I'm not sure what the problem is, but I think there is some API restriction or something, due to which the program ended (by Nov 11) , whereas it should have deleted all events till Nov 20.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.