Giter Club home page Giter Club logo

get-sentral's People

Contributors

j-j-b-j avatar mend-bolt-for-github[bot] avatar superharmony910 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

get-sentral's Issues

Return Python objects instead of json dictionary.

Is your feature request related to a problem? Please describe.
No. I would like the program to return Python objects instead of a json object, so as to use heavy type hinting.

Describe the solution you'd like
I would like the program to generate Python objects as opposed to json objects.

Describe alternatives you've considered
There are no alternatives that allow heavy type hinting.

Additional context
I would like the classes to all have the str and dict methods built in where possible.

License

Describe the bug
The current licence (GNU General Public License v3.0) allows for commercial use, among other things that I don't really think are very good for an open-source project

Expected behavior
I think that:

  • You must not commercialise the repo
  • You must provide credit to the original authors
  • You must share under the same licence

Additional context
The Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) licence has all of these features. The text here can be copied into the Licence file, and the following code can be copied into README.md:

<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.

The code outputs s logo and link like this:

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

@SuperHarmony910 what do you think?

Import Errors

The program seems to have errors when importing the external modules.

To Reproduce

  1. Run anything that relies on the program.
  2. Observe error.

Expected behaviour
The program should import the modules with no errors.

Desktop (please complete the following information):

  • OS: MacOS Monterey
  • Version 12.6

Additional context
Make sure that the imports work when using the program as a standalone as well as as a library.

Fetch timetable from `portal/timetable/mytimetable/x/daily`

Is your feature request related to a problem? Please describe.
Fetch the timetable from portal/timetable/mytimetable/x/daily. This way, we can fetch multiple days at once.

Describe the solution you'd like
Completely revamp the timetable scraper code to scrape the timetable.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
In the HTML DOM structure, Sentral stores their periods horizontally; however, days are organised verticallym i.e. the first element in the DOM is Monday P1, the second element in the DOM is Tuesday P1. This makes me, as a programmer, very mildly infuriated.

Journal disabling in app when journal is not available.

Is your feature request related to a problem? Please describe.
Yeah kinda. You can still edit the journal in the app even when it isn't on Sentral.

Describe the solution you'd like
When the journal is not available, the program should return a custom error such as JournalNotAvailable. Then, the app should have a try-except for this, as well as other example programs.

Describe alternatives you've considered
Setting the variable SentralTimetable.JOURNAL_UNAVAILABLE, then the app can check if the journal matches this text. But then what happens if the user enters that exact text?

Additional context
I recommend this is left until the three current pull requests are merged.

I don't want to have all the tabs showing at once.

Is your feature request related to a problem? Please describe.
No. I want some customisation options for the position of the tabs.

Describe the solution you'd like

  • The ability to change the order of the tabs
  • The ability to change which tab opens on start
  • The ability to hide tabs in a small menu
  • The ability to hide tabs completely

Additional context
Noteflight has a good example of this. In the extremely rare case (๐Ÿ˜‰) that you don't have an account, here is a screen recording:

Screen.Recording.2022-12-16.at.8.00.10.pm.mov

Yes. I use a MacBook and Safari. Get over it.

Daily reflection thingy majiggy

Is your feature request related to a problem? Please describe.
Nope. I would like to be able to view and edit the journal thingy beneath the timetable in Sentral. I don't know anybody who uses it but it would be fun to build.

Describe the solution you'd like
There should be an addition to the objects where you can fetch your journal entry for today, and another, seperate function to set the contents.

Describe alternatives you've considered
None.

Additional context
N/A

Reload function update for app

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Should reload on start, and periodically in the background, with the period decided in the settings tab. Should also reload on button press, and show last reloaded time in settings tab.

Describe alternatives you've considered
Reloading for a set amount of time for everyone, but this may not suit everyone.

Non-existant journal

Describe the bug
ON weekends and holidays, when there is no journal, The program may throw an error

To Reproduce
Steps to reproduce the behavior:

  1. Run App.py on the weekend and watch the output

Expected behavior
Text telling you the journal is not available should show up.

Desktop (please complete the following information):

  • OS: Any

Additional context
Add to the except in scrapers.py: line 161-5. Add an IndexError except.

Scrape awards

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
I would like to be able to access awards data from Sentral. There should be a new object, Award() with attributes like date, teacher and reason.

Describe alternatives you've considered
N/A

Additional context
You can go to https://myschool.sentral.com.au/portal/wellbeing/awards/, which takes you to this year's awards, then scrape the list. You can then continue clicking the Previous Year button and scraping the list until the href of the Previous Year button is #.

Rename function and file names

The function names for the files and functions are a little ambiguous, as some of them are very similar to external libraries used. This may result in confusion and overlapping names in the future.

Dual import

When the program is run, or it is used as a library, the phrase Created by SuperHarmony910 and J-J-B-J is printed twice.
This appears to be due to a combination of two statements.

main.py, line 7:

from SentralTimetable import scrapers, webdriver, credentials as creds

__init__.py, line 2:

from .main import *

When main.py uses from SentralTimetable, it calls init.py. init.py then imports main.py, which prints the statement.
Once main.py has run it's imports, it prints out the statement again.

Proposed solution:

  1. Rename main.py to timetable.py so as to prevent confusion between example program (at the bottom of main.py) and the get_timetable() function.
  2. Create a file called Example.py and cut the example code out of timetable.py and paste it into here.
  3. Update the docs to reflect this.

File containing get-sentral logo is not included with package.

The file that the program is meant to print the contents of, get_sentral.txt, is not packages when the source is built. This means that when run from the packaged version, the program throws an error. A good way to fix this would be to place the contents of this file within the program as a multiline string.

To Reproduce

  1. Build the package using python3 -m build or python3 setup.py sdist bdist_wheel
  2. From the python3 shell, enter import SentralTimetable
  3. See error

Expected behaviour
The program outputs the following:

                          โ•ญโ”€โ”€โ•ฎ                                                             โ•ญโ”€โ”€โ•ฎ                         โ•ญโ”€โ”€โ•ฎ
 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎโ•ญโ”€โ”€โ”˜  โ•ฐโ”€โ”€โ•ฎ                   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  โ•ญโ”€โ”€โ•ฎโ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎโ•ญโ”€โ”€โ”˜  โ•ฐโ”€โ”€โ•ฎ โ•ญโ”€โ•ฎโ•ญโ”€โ”€โ”€โ”€โ•ฎ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚  โ”‚
 โ”‚  โ•ญโ”€โ”€โ•ฎ  โ”‚  โ”‚  โ•ญโ”€โ”€โ•ฎ  โ”‚โ•ฐโ”€โ”€โ•ฎ  โ•ญโ”€โ”€โ•ฏ                   โ”‚  โ•ญโ”€โ”€โ”€โ”€โ•ฏ   โ”‚  โ•ญโ”€โ”€โ•ฎ โ”‚  โ”‚  โ•ฐโ•ฏ โ•ญโ”€โ”€โ•ฎ  โ”‚โ•ฐโ”€โ”€โ•ฎ  โ•ญโ”€โ”€โ•ฏ โ”‚ โ•ฐโ•ฏโ•ญโ”€โ•ฎ โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ•ฎ  โ”‚ โ”‚  โ”‚
 โ”‚  โ•ฐโ”€โ”€โ•ฏ  โ”‚  โ”‚  โ•ฐโ”€โ”€โ•ฏ  โ”‚   โ”‚  โ”‚                      โ”‚  โ•ฐโ”€โ”€โ”€โ”€โ•ฎ   โ”‚  โ•ฐโ”€โ”€โ•ฏ โ”‚  โ”‚   โ•ญโ”€โ•ฏ  โ”‚  โ”‚   โ”‚  โ”‚    โ”‚  โ•ญโ•ฏ โ•ฐโ”€โ•ฏ โ•ญโ”€โ”€โ”€โ”€โ”€โ•ฏ  โ”‚ โ”‚  โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ•ฎ   โ”‚  โ”‚   โ•ญโ”€โ”€โ”€โ”€โ•ฏ   โ”‚  โ”‚                      โ•ฐโ”€โ”€โ”€โ”€โ•ฎ  โ”‚   โ”‚  โ•ญโ”€โ”€โ”€โ”€โ•ฏ  โ”‚   โ”‚    โ”‚  โ”‚   โ”‚  โ”‚    โ”‚  โ”‚      โ”‚ โ•ญโ”€โ”€โ”€โ”€โ•ฎ โ”‚ โ”‚  โ”‚
 โ•ญโ”€โ”€โ”€โ”€โ•ฏ   โ”‚  โ”‚   โ•ฐโ”€โ”€โ”€โ”€โ•ฎ   โ”‚  โ•ฐโ”€โ”€โ•ฎ                   โ•ญโ”€โ”€โ”€โ”€โ•ฏ  โ”‚   โ”‚  โ•ฐโ”€โ”€โ”€โ”€โ•ฎ  โ”‚   โ”‚    โ”‚  โ”‚   โ”‚  โ•ฐโ”€โ”€โ•ฎ โ”‚  โ”‚      โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ•ฏ โ”‚ โ”‚  โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ   โ•ฐโ”€โ”€โ”€โ”€โ”€โ•ฏ  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ  โ•ฐโ”€โ”€โ”€โ•ฏ    โ•ฐโ”€โ”€โ•ฏ   โ•ฐโ”€โ”€โ”€โ”€โ”€โ•ฏ โ•ฐโ”€โ”€โ•ฏ      โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ•ฐโ”€โ”€โ•ฏ
                                   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Desktop

  • OS: MacOS Monterey
  • Version 12.6

Program looking for wrong variable?

Describe the bug
environment file generates the username as the variable USERNAME whereas the program searches for USER_NAME

Expected behavior
program should look for the same variable as declared in env file otherwise it won't work

Screenshots
image
image

Desktop (please complete the following information):

  • OS: win11

Error handling when using timeout doesn't work.

The error handling for when the user enters an invalid timeout doesn't work.

To Reproduce

  1. Run the program, entering the timeout credential as an environment variable that isn't an integer or doesn't exist.
  2. Observe error

Expected behaviour
The program continues and asks for input.

404 page redirect broken

The 404 page redirects to an invalid URL.

This should be fixed by taking the user to the root URL.

When there are no events on a calendar day, AttributeError is thrown.

Upon closer inspection, this is due to Sentral, when there are no events, not creating the what is called in Srapers.py events_div.

Proposed fix:
Add an if statement to the error-causing line:

events_this_day = events_div.find_all('div')

Replace the above with:

if events_div:
    events_this_day = events_div.find_all('div')
else:
    # There are no events on this date
    events_this_day = []

Attachments for daily notices

Is your feature request related to a problem? Please describe.
Yes. When there is an attachment for a daily notice, there is no way to view it.

Describe the solution you'd like
A new class should be created, called File. This class should have attributes such as the file type, URL and local URL (after downloading the file)

Describe alternatives you've considered
N/A

Additional context
N/A

Reporting

Is your feature request related to a problem? Please describe.
Nope. I want to be able to view my reports using get-sentral.

Describe the solution you'd like

  • Add a new attribute to the User class, called .reports. This should be of type list[File] (see #24 & #15)
  • The File objects in reports should be files made from the reports.

Describe alternatives you've considered
Downloading the report. You can't do this with selenium (see #15 and the selenium docs)

Additional context
The branch for working on this issue should be created from #24.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.