EdupageAPI / edupage-api

A python library for accessing your Edupage account
https://edupageapi.github.io/edupage-api/
GNU General Public License v3.0
66 stars 13 forks source link

[Bug] Not being able to login #51

Closed nnefficient closed 2 years ago

nnefficient commented 2 years ago

The issue Hello, so ive been tying to run one of your code examples but i kept getting an error message.

code

from edupage_api import Edupage

edupage = Edupage()
edupage.login("i put my name here", "password here",
              "subdomain here")
grades = edupage.get_grades()

grades_by_subject = {}

for grade in grades:
    if grades_by_subject.get(grade.subject_name):
        grades_by_subject[grade.subject_name] += [grade]
    else:
        grades_by_subject[grade.subject_name] = [grade]

for subject in grades_by_subject:
    print(f"{subject}:")
    for grade in grades_by_subject[subject]:

        print(f"    {grade.title} -> ", end="")

        if grade.max_points != 100:
            print(f"{grade.grade_n}/{grade.max_points}")
        else:
            print(f"{grade.percent}%")
    print("----------------")

Error message

File "c:/Users/me/Documents/workspace/printgrades.py", line 8, in <module>
    edupage = Edupage()
TypeError: __init__() missing 3 required positional arguments: 'school', 'username', and 'password'

-

Version

BelKed commented 2 years ago

Hmm... Are you sure you are using the latest version of edupage-api, currently 0.9.985? There have been several breaking changes in logging in and much more in 0.9.9 (https://github.com/ivanhrabcak/edupage-api/pull/31).

By the way, the docs you are reading and the examples are for the latest version (0.9.985)...

nnefficient commented 2 years ago

Yes i am sure im using the latest version.

nnefficient commented 2 years ago

If the docs and the exaples are for the latest version then why it doesnt work?

ivanhrabcak commented 2 years ago

You are definetly not using the latest version. The __init__ method was changed in the updates mentioned above (by @BelKed).

pip show edupage-api, will tell you which version you are using. Try running pip install edupage-api --upgrade, to upgrade the package. If you are running the examples directly from the repository, run git pull to pull the latest changes.

If the upgrade command is not working for you, please include the output of pip show edupage-api in your next response.

BelKed commented 2 years ago

I believe you fixed your problem with logging in... There's no recent activity, so I'm closing this issue.

Mineplayerminer commented 10 months ago

image