MagisterPy 0.1.1__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.
@@ -0,0 +1,2 @@
1
+ include requirements.txt
2
+ include README.MD
@@ -1,17 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MagisterPy
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A Python package for retrieving information from magister
5
5
  Home-page: https://github.com/H3LL0U/MagisterPy
6
6
  Author: H3LL0U
7
- License: UNKNOWN
8
- Platform: UNKNOWN
9
7
  Classifier: Programming Language :: Python :: 3
10
8
  Classifier: License :: OSI Approved :: MIT License
11
9
  Classifier: Operating System :: OS Independent
12
10
  Requires-Python: >=3.9
13
11
  Description-Content-Type: text/markdown
14
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
15
20
 
16
21
  # MagisterPY
17
22
 
@@ -50,5 +55,3 @@ print("Most Recent Grade:", my_most_recent_grade)
50
55
  ```
51
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!
52
57
  More functionality to come!
53
-
54
-
@@ -1,4 +1,7 @@
1
1
  LICENSE
2
+ MANIFEST.in
3
+ README.MD
4
+ requirements.txt
2
5
  setup.py
3
6
  MagisterPy/__init__.py
4
7
  MagisterPy/error_handler.py
@@ -11,4 +14,5 @@ MagisterPy.egg-info/SOURCES.txt
11
14
  MagisterPy.egg-info/dependency_links.txt
12
15
  MagisterPy.egg-info/not-zip-safe
13
16
  MagisterPy.egg-info/requires.txt
14
- MagisterPy.egg-info/top_level.txt
17
+ MagisterPy.egg-info/top_level.txt
18
+ tests/test_jsonparser.py
@@ -1,17 +1,22 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MagisterPy
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A Python package for retrieving information from magister
5
5
  Home-page: https://github.com/H3LL0U/MagisterPy
6
6
  Author: H3LL0U
7
- License: UNKNOWN
8
- Platform: UNKNOWN
9
7
  Classifier: Programming Language :: Python :: 3
10
8
  Classifier: License :: OSI Approved :: MIT License
11
9
  Classifier: Operating System :: OS Independent
12
10
  Requires-Python: >=3.9
13
11
  Description-Content-Type: text/markdown
14
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
15
20
 
16
21
  # MagisterPY
17
22
 
@@ -50,5 +55,3 @@ print("Most Recent Grade:", my_most_recent_grade)
50
55
  ```
51
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!
52
57
  More functionality to come!
53
-
54
-
@@ -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!
@@ -0,0 +1,7 @@
1
+ beautifulsoup4==4.12.3
2
+ certifi==2024.8.30
3
+ charset-normalizer==3.4.0
4
+ idna==3.10
5
+ requests==2.32.3
6
+ soupsieve==2.6
7
+ urllib3==2.2.3
@@ -7,9 +7,9 @@ def parse_requirements(filename):
7
7
 
8
8
  setup(
9
9
  name="MagisterPy",
10
- version="0.1.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
+ )
@@ -0,0 +1,29 @@
1
+ import sys
2
+ import os
3
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
4
+
5
+
6
+ from MagisterPy import JsParser
7
+
8
+ import unittest
9
+ import json
10
+ # Replace with the actual module name where JsParser is defined
11
+
12
+ class TestJsParser(unittest.TestCase):
13
+ def setUp(self):
14
+ """Set up a JsParser instance for testing."""
15
+ self.parser = JsParser()
16
+
17
+ def test_valid_authcode_extraction(self):
18
+ with open(r"tests\test_javascripts\account-85bb24d85718eb247b7c.js") as file:
19
+ content = file.read()
20
+ self.assertEqual(self.parser.get_authcode_from_js(content),"1ca5d248")
21
+
22
+
23
+ with open(r"tests\test_javascripts\account-e6fb87fd4f567cbd37f5.js") as file:
24
+ content = file.read()
25
+ self.assertEqual(self.parser.get_authcode_from_js(content),"b7cf076f")
26
+
27
+
28
+ if __name__ == "__main__":
29
+ unittest.main()
File without changes
File without changes