MagisterPy 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {magisterpy-0.1.0 → magisterpy-0.1.2}/LICENSE +21 -21
- magisterpy-0.1.2/MANIFEST.in +2 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy/error_handler.py +26 -26
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy/magister_errors.py +22 -22
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy.egg-info/PKG-INFO +57 -57
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy.egg-info/SOURCES.txt +3 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy.egg-info/not-zip-safe +1 -1
- {magisterpy-0.1.0 → magisterpy-0.1.2}/PKG-INFO +57 -57
- magisterpy-0.1.2/README.MD +37 -0
- magisterpy-0.1.2/requirements.txt +7 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/setup.cfg +4 -4
- {magisterpy-0.1.0 → magisterpy-0.1.2}/setup.py +4 -4
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy/__init__.py +0 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy/jsparser.py +0 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy/magister_session.py +0 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy/request_manager.py +0 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy.egg-info/dependency_links.txt +0 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy.egg-info/requires.txt +0 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/MagisterPy.egg-info/top_level.txt +0 -0
- {magisterpy-0.1.0 → magisterpy-0.1.2}/tests/test_jsonparser.py +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 H3LL0U
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 H3LL0U
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import requests
|
|
2
|
-
from .magister_errors import *
|
|
3
|
-
def error_handler(func):
|
|
4
|
-
'''
|
|
5
|
-
A decorator used to handle errors that can occure when when executing the functions
|
|
6
|
-
'''
|
|
7
|
-
|
|
8
|
-
def wrapper(*args, **kwargs):
|
|
9
|
-
_self = args[0]
|
|
10
|
-
try:
|
|
11
|
-
result = func(*args,**kwargs)
|
|
12
|
-
return result
|
|
13
|
-
except KeyboardInterrupt:
|
|
14
|
-
raise KeyboardInterrupt
|
|
15
|
-
|
|
16
|
-
except requests.exceptions.ConnectionError as e:
|
|
17
|
-
_self._logMessage("Could not connect to Magister")
|
|
18
|
-
if _self.automatically_handle_errors:
|
|
19
|
-
pass
|
|
20
|
-
else:
|
|
21
|
-
raise ConnectionError()
|
|
22
|
-
except BaseMagisterError as e:
|
|
23
|
-
if _self.automatically_handle_errors:
|
|
24
|
-
_self._logMessage(e.message)
|
|
25
|
-
else:
|
|
26
|
-
raise e
|
|
1
|
+
import requests
|
|
2
|
+
from .magister_errors import *
|
|
3
|
+
def error_handler(func):
|
|
4
|
+
'''
|
|
5
|
+
A decorator used to handle errors that can occure when when executing the functions
|
|
6
|
+
'''
|
|
7
|
+
|
|
8
|
+
def wrapper(*args, **kwargs):
|
|
9
|
+
_self = args[0]
|
|
10
|
+
try:
|
|
11
|
+
result = func(*args,**kwargs)
|
|
12
|
+
return result
|
|
13
|
+
except KeyboardInterrupt:
|
|
14
|
+
raise KeyboardInterrupt
|
|
15
|
+
|
|
16
|
+
except requests.exceptions.ConnectionError as e:
|
|
17
|
+
_self._logMessage("Could not connect to Magister")
|
|
18
|
+
if _self.automatically_handle_errors:
|
|
19
|
+
pass
|
|
20
|
+
else:
|
|
21
|
+
raise ConnectionError()
|
|
22
|
+
except BaseMagisterError as e:
|
|
23
|
+
if _self.automatically_handle_errors:
|
|
24
|
+
_self._logMessage(e.message)
|
|
25
|
+
else:
|
|
26
|
+
raise e
|
|
27
27
|
return wrapper
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
class BaseMagisterError(Exception):
|
|
2
|
-
|
|
3
|
-
def __init__(self, message=None):
|
|
4
|
-
super().__init__(message)
|
|
5
|
-
self.message = message
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class UnableToInputCredentials(BaseMagisterError):
|
|
9
|
-
|
|
10
|
-
def __init__(self, message="\nCouldn't input the credentials\nThis error can occure if the credentials were not Input in order\nSchool->Username->Passwords"):
|
|
11
|
-
super().__init__(message)
|
|
12
|
-
self.message = message
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class IncorrectCredentials(BaseMagisterError):
|
|
16
|
-
def __init__(self, message="\nThe credentials provided were either incorrect or Magister rejected them"):
|
|
17
|
-
super().__init__(message)
|
|
18
|
-
self.message = message
|
|
19
|
-
|
|
20
|
-
class ConnectionError(BaseMagisterError):
|
|
21
|
-
def __init__(self, message="\nCould not connect to Magister. Please check your internet connection"):
|
|
22
|
-
super().__init__(message)
|
|
1
|
+
class BaseMagisterError(Exception):
|
|
2
|
+
|
|
3
|
+
def __init__(self, message=None):
|
|
4
|
+
super().__init__(message)
|
|
5
|
+
self.message = message
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UnableToInputCredentials(BaseMagisterError):
|
|
9
|
+
|
|
10
|
+
def __init__(self, message="\nCouldn't input the credentials\nThis error can occure if the credentials were not Input in order\nSchool->Username->Passwords"):
|
|
11
|
+
super().__init__(message)
|
|
12
|
+
self.message = message
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class IncorrectCredentials(BaseMagisterError):
|
|
16
|
+
def __init__(self, message="\nThe credentials provided were either incorrect or Magister rejected them"):
|
|
17
|
+
super().__init__(message)
|
|
18
|
+
self.message = message
|
|
19
|
+
|
|
20
|
+
class ConnectionError(BaseMagisterError):
|
|
21
|
+
def __init__(self, message="\nCould not connect to Magister. Please check your internet connection"):
|
|
22
|
+
super().__init__(message)
|
|
23
23
|
self.message = message
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: MagisterPy
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: A Python package for retrieving information from magister
|
|
5
|
-
Home-page: https://github.com/H3LL0U/MagisterPy
|
|
6
|
-
Author: H3LL0U
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.9
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
Requires-Dist: beautifulsoup4==4.12.3
|
|
14
|
-
Requires-Dist: certifi==2024.8.30
|
|
15
|
-
Requires-Dist: charset-normalizer==3.4.0
|
|
16
|
-
Requires-Dist: idna==3.10
|
|
17
|
-
Requires-Dist: requests==2.32.3
|
|
18
|
-
Requires-Dist: soupsieve==2.6
|
|
19
|
-
Requires-Dist: urllib3==2.2.3
|
|
20
|
-
|
|
21
|
-
# MagisterPY
|
|
22
|
-
|
|
23
|
-
This library will help you interact with your magister account using python!
|
|
24
|
-
|
|
25
|
-
## Disclaimer:
|
|
26
|
-
Please note: Using unauthorized APIs to access Magister is against Magister
|
|
27
|
-
By using this library, you assume all responsibility and accept any risks associated with breaching these terms.
|
|
28
|
-
For more details, please refer to Magister's Terms of Service. (https://magister.nl/over-ons/juridische-zaken/)
|
|
29
|
-
|
|
30
|
-
## Installation
|
|
31
|
-
```
|
|
32
|
-
pip install git+https://github.com/H3LL0U/MagisterPy.git
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Contributing
|
|
36
|
-
Feel free to create an issue if something doesn't work. It's only been tested on a singular school so far so it is to be expected. If you want to help add a feature it would be great as well! :D
|
|
37
|
-
|
|
38
|
-
## Basic usage
|
|
39
|
-
The following code snippet demonstrates how to create a session, log in, and retrieve your schedule and recent grades:
|
|
40
|
-
```
|
|
41
|
-
from magisterpy import MagisterSession
|
|
42
|
-
|
|
43
|
-
# Create a new session and log in
|
|
44
|
-
session = MagisterSession()
|
|
45
|
-
session.login(school_name="School_name", username="your_username", password="your_password")
|
|
46
|
-
|
|
47
|
-
# Get schedule for a specific date range
|
|
48
|
-
my_schedule = session.get_schedule("2024-11-03", "2024-11-10")
|
|
49
|
-
|
|
50
|
-
# Get the most recent grade
|
|
51
|
-
my_most_recent_grade = session.get_grades(top=1)[0]["waarde"]
|
|
52
|
-
|
|
53
|
-
print("Schedule:", my_schedule)
|
|
54
|
-
print("Most Recent Grade:", my_most_recent_grade)
|
|
55
|
-
```
|
|
56
|
-
With MagisterPy, you can access and manage your Magister account directly from Python, automating repetitive tasks and integrating your school data into your projects. We hope you find it helpful!
|
|
57
|
-
More functionality to come!
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: MagisterPy
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A Python package for retrieving information from magister
|
|
5
|
+
Home-page: https://github.com/H3LL0U/MagisterPy
|
|
6
|
+
Author: H3LL0U
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: beautifulsoup4==4.12.3
|
|
14
|
+
Requires-Dist: certifi==2024.8.30
|
|
15
|
+
Requires-Dist: charset-normalizer==3.4.0
|
|
16
|
+
Requires-Dist: idna==3.10
|
|
17
|
+
Requires-Dist: requests==2.32.3
|
|
18
|
+
Requires-Dist: soupsieve==2.6
|
|
19
|
+
Requires-Dist: urllib3==2.2.3
|
|
20
|
+
|
|
21
|
+
# MagisterPY
|
|
22
|
+
|
|
23
|
+
This library will help you interact with your magister account using python!
|
|
24
|
+
|
|
25
|
+
## Disclaimer:
|
|
26
|
+
Please note: Using unauthorized APIs to access Magister is against Magister’s Terms of Service.
|
|
27
|
+
By using this library, you assume all responsibility and accept any risks associated with breaching these terms.
|
|
28
|
+
For more details, please refer to Magister's Terms of Service. (https://magister.nl/over-ons/juridische-zaken/)
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
```
|
|
32
|
+
pip install git+https://github.com/H3LL0U/MagisterPy.git
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Contributing
|
|
36
|
+
Feel free to create an issue if something doesn't work. It's only been tested on a singular school so far so it is to be expected. If you want to help add a feature it would be great as well! :D
|
|
37
|
+
|
|
38
|
+
## Basic usage
|
|
39
|
+
The following code snippet demonstrates how to create a session, log in, and retrieve your schedule and recent grades:
|
|
40
|
+
```
|
|
41
|
+
from magisterpy import MagisterSession
|
|
42
|
+
|
|
43
|
+
# Create a new session and log in
|
|
44
|
+
session = MagisterSession()
|
|
45
|
+
session.login(school_name="School_name", username="your_username", password="your_password")
|
|
46
|
+
|
|
47
|
+
# Get schedule for a specific date range
|
|
48
|
+
my_schedule = session.get_schedule("2024-11-03", "2024-11-10")
|
|
49
|
+
|
|
50
|
+
# Get the most recent grade
|
|
51
|
+
my_most_recent_grade = session.get_grades(top=1)[0]["waarde"]
|
|
52
|
+
|
|
53
|
+
print("Schedule:", my_schedule)
|
|
54
|
+
print("Most Recent Grade:", my_most_recent_grade)
|
|
55
|
+
```
|
|
56
|
+
With MagisterPy, you can access and manage your Magister account directly from Python, automating repetitive tasks and integrating your school data into your projects. We hope you find it helpful!
|
|
57
|
+
More functionality to come!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: MagisterPy
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: A Python package for retrieving information from magister
|
|
5
|
-
Home-page: https://github.com/H3LL0U/MagisterPy
|
|
6
|
-
Author: H3LL0U
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.9
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
Requires-Dist: beautifulsoup4==4.12.3
|
|
14
|
-
Requires-Dist: certifi==2024.8.30
|
|
15
|
-
Requires-Dist: charset-normalizer==3.4.0
|
|
16
|
-
Requires-Dist: idna==3.10
|
|
17
|
-
Requires-Dist: requests==2.32.3
|
|
18
|
-
Requires-Dist: soupsieve==2.6
|
|
19
|
-
Requires-Dist: urllib3==2.2.3
|
|
20
|
-
|
|
21
|
-
# MagisterPY
|
|
22
|
-
|
|
23
|
-
This library will help you interact with your magister account using python!
|
|
24
|
-
|
|
25
|
-
## Disclaimer:
|
|
26
|
-
Please note: Using unauthorized APIs to access Magister is against Magister
|
|
27
|
-
By using this library, you assume all responsibility and accept any risks associated with breaching these terms.
|
|
28
|
-
For more details, please refer to Magister's Terms of Service. (https://magister.nl/over-ons/juridische-zaken/)
|
|
29
|
-
|
|
30
|
-
## Installation
|
|
31
|
-
```
|
|
32
|
-
pip install git+https://github.com/H3LL0U/MagisterPy.git
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Contributing
|
|
36
|
-
Feel free to create an issue if something doesn't work. It's only been tested on a singular school so far so it is to be expected. If you want to help add a feature it would be great as well! :D
|
|
37
|
-
|
|
38
|
-
## Basic usage
|
|
39
|
-
The following code snippet demonstrates how to create a session, log in, and retrieve your schedule and recent grades:
|
|
40
|
-
```
|
|
41
|
-
from magisterpy import MagisterSession
|
|
42
|
-
|
|
43
|
-
# Create a new session and log in
|
|
44
|
-
session = MagisterSession()
|
|
45
|
-
session.login(school_name="School_name", username="your_username", password="your_password")
|
|
46
|
-
|
|
47
|
-
# Get schedule for a specific date range
|
|
48
|
-
my_schedule = session.get_schedule("2024-11-03", "2024-11-10")
|
|
49
|
-
|
|
50
|
-
# Get the most recent grade
|
|
51
|
-
my_most_recent_grade = session.get_grades(top=1)[0]["waarde"]
|
|
52
|
-
|
|
53
|
-
print("Schedule:", my_schedule)
|
|
54
|
-
print("Most Recent Grade:", my_most_recent_grade)
|
|
55
|
-
```
|
|
56
|
-
With MagisterPy, you can access and manage your Magister account directly from Python, automating repetitive tasks and integrating your school data into your projects. We hope you find it helpful!
|
|
57
|
-
More functionality to come!
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: MagisterPy
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A Python package for retrieving information from magister
|
|
5
|
+
Home-page: https://github.com/H3LL0U/MagisterPy
|
|
6
|
+
Author: H3LL0U
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: beautifulsoup4==4.12.3
|
|
14
|
+
Requires-Dist: certifi==2024.8.30
|
|
15
|
+
Requires-Dist: charset-normalizer==3.4.0
|
|
16
|
+
Requires-Dist: idna==3.10
|
|
17
|
+
Requires-Dist: requests==2.32.3
|
|
18
|
+
Requires-Dist: soupsieve==2.6
|
|
19
|
+
Requires-Dist: urllib3==2.2.3
|
|
20
|
+
|
|
21
|
+
# MagisterPY
|
|
22
|
+
|
|
23
|
+
This library will help you interact with your magister account using python!
|
|
24
|
+
|
|
25
|
+
## Disclaimer:
|
|
26
|
+
Please note: Using unauthorized APIs to access Magister is against Magister’s Terms of Service.
|
|
27
|
+
By using this library, you assume all responsibility and accept any risks associated with breaching these terms.
|
|
28
|
+
For more details, please refer to Magister's Terms of Service. (https://magister.nl/over-ons/juridische-zaken/)
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
```
|
|
32
|
+
pip install git+https://github.com/H3LL0U/MagisterPy.git
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Contributing
|
|
36
|
+
Feel free to create an issue if something doesn't work. It's only been tested on a singular school so far so it is to be expected. If you want to help add a feature it would be great as well! :D
|
|
37
|
+
|
|
38
|
+
## Basic usage
|
|
39
|
+
The following code snippet demonstrates how to create a session, log in, and retrieve your schedule and recent grades:
|
|
40
|
+
```
|
|
41
|
+
from magisterpy import MagisterSession
|
|
42
|
+
|
|
43
|
+
# Create a new session and log in
|
|
44
|
+
session = MagisterSession()
|
|
45
|
+
session.login(school_name="School_name", username="your_username", password="your_password")
|
|
46
|
+
|
|
47
|
+
# Get schedule for a specific date range
|
|
48
|
+
my_schedule = session.get_schedule("2024-11-03", "2024-11-10")
|
|
49
|
+
|
|
50
|
+
# Get the most recent grade
|
|
51
|
+
my_most_recent_grade = session.get_grades(top=1)[0]["waarde"]
|
|
52
|
+
|
|
53
|
+
print("Schedule:", my_schedule)
|
|
54
|
+
print("Most Recent Grade:", my_most_recent_grade)
|
|
55
|
+
```
|
|
56
|
+
With MagisterPy, you can access and manage your Magister account directly from Python, automating repetitive tasks and integrating your school data into your projects. We hope you find it helpful!
|
|
57
|
+
More functionality to come!
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# MagisterPY
|
|
2
|
+
|
|
3
|
+
This library will help you interact with your magister account using python!
|
|
4
|
+
|
|
5
|
+
## Disclaimer:
|
|
6
|
+
Please note: Using unauthorized APIs to access Magister is against Magister’s Terms of Service.
|
|
7
|
+
By using this library, you assume all responsibility and accept any risks associated with breaching these terms.
|
|
8
|
+
For more details, please refer to Magister's Terms of Service. (https://magister.nl/over-ons/juridische-zaken/)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
```
|
|
12
|
+
pip install git+https://github.com/H3LL0U/MagisterPy.git
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Contributing
|
|
16
|
+
Feel free to create an issue if something doesn't work. It's only been tested on a singular school so far so it is to be expected. If you want to help add a feature it would be great as well! :D
|
|
17
|
+
|
|
18
|
+
## Basic usage
|
|
19
|
+
The following code snippet demonstrates how to create a session, log in, and retrieve your schedule and recent grades:
|
|
20
|
+
```
|
|
21
|
+
from magisterpy import MagisterSession
|
|
22
|
+
|
|
23
|
+
# Create a new session and log in
|
|
24
|
+
session = MagisterSession()
|
|
25
|
+
session.login(school_name="School_name", username="your_username", password="your_password")
|
|
26
|
+
|
|
27
|
+
# Get schedule for a specific date range
|
|
28
|
+
my_schedule = session.get_schedule("2024-11-03", "2024-11-10")
|
|
29
|
+
|
|
30
|
+
# Get the most recent grade
|
|
31
|
+
my_most_recent_grade = session.get_grades(top=1)[0]["waarde"]
|
|
32
|
+
|
|
33
|
+
print("Schedule:", my_schedule)
|
|
34
|
+
print("Most Recent Grade:", my_most_recent_grade)
|
|
35
|
+
```
|
|
36
|
+
With MagisterPy, you can access and manage your Magister account directly from Python, automating repetitive tasks and integrating your school data into your projects. We hope you find it helpful!
|
|
37
|
+
More functionality to come!
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
|
@@ -7,9 +7,9 @@ def parse_requirements(filename):
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="MagisterPy",
|
|
10
|
-
version="0.1.
|
|
10
|
+
version="0.1.2",
|
|
11
11
|
description="A Python package for retrieving information from magister",
|
|
12
|
-
long_description=open("README.MD").read(),
|
|
12
|
+
long_description=open("./README.MD").read(),
|
|
13
13
|
long_description_content_type="text/markdown",
|
|
14
14
|
author="H3LL0U",
|
|
15
15
|
url="https://github.com/H3LL0U/MagisterPy",
|
|
@@ -22,5 +22,5 @@ setup(
|
|
|
22
22
|
python_requires=">=3.9",
|
|
23
23
|
include_package_data=True,
|
|
24
24
|
zip_safe=False,
|
|
25
|
-
install_requires=parse_requirements('requirements.txt') # Read dependencies
|
|
26
|
-
)
|
|
25
|
+
install_requires=parse_requirements('./requirements.txt') # Read dependencies
|
|
26
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|