Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit dd88deb

Browse files
authored
πŸ”€ Merge dev into master to 0.3.0
πŸ”€ 0.3.0: Merge master with dev
2 parents 1f5faa2 + 265853f commit dd88deb

27 files changed

Lines changed: 834 additions & 283 deletions

β€Ž.vscode/settings.jsonβ€Ž

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
11
{
22
"cSpell.words": [
3+
"ansichten",
4+
"colour",
5+
"Cryptodome",
6+
"cryptor",
7+
"Cryptor",
8+
"empf",
9+
"entrys",
10+
"exporteur",
11+
"furo",
312
"hessen",
413
"httpx",
14+
"inhalt",
15+
"intersphinx",
16+
"kalender",
17+
"kategorie",
18+
"kuerzel",
519
"kurwjan",
620
"Lanis",
21+
"lanisapi",
722
"levelname",
23+
"meinunterricht",
24+
"nachrichten",
25+
"PKCS",
26+
"protokoll",
27+
"publickey",
828
"schoolid",
9-
"selectolax"
29+
"selectolax",
30+
"uniqid",
31+
"Uniquid",
32+
"unpad",
33+
"Unpad",
34+
"unpadded",
35+
"yxxx"
1036
],
1137
"esbonio.sphinx.confDir": ""
1238
}

β€ŽREADME-DE.mdβ€Ž

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Eine inoffizielle Python-Bibliothek fΓΌr das Schulportal Hessen. Auch auf [PyPi]
1616
+ Kalenderereignisse bekommen.
1717
+ Unterhaltungen bekommen.
1818
+ Alle Schulen die Lanis haben bekommen.
19+
+ Alle Online-Apps mit ihren Links bekommen.
1920

2021
**Übersicht von zukünftigen Features, Probleme und anderes [hier](https://github.com/users/kurwjan/projects/2)**
2122

@@ -25,7 +26,7 @@ Eine inoffizielle Python-Bibliothek fΓΌr das Schulportal Hessen. Auch auf [PyPi]
2526
pip install lanisapi
2627
```
2728

28-
Vorausgesetzt wird Python 3.11. *(Γ€ltere Versionen gehen bestimmt auch, habe es nicht getestet)*
29+
Vorausgesetzt wird Python 3.11. *(Γ€ltere Versionen gehen wahrscheinlich nicht, habe es nicht getestet)*
2930

3031
## Beispiel
3132

@@ -35,9 +36,9 @@ Dieses Beispiel gibt dir den Vertretungsplan.
3536
from lanisapi import LanisClient
3637

3738
def main():
38-
client = LanisClient("schulid", "name.nachname", "passwort")
39-
or: client = LanisClient(School("school", "city"), "password")
40-
client.authenticate()
39+
client = LanisClient(LanisAccount("school id", "name.lastname", "password"))
40+
or: client = LanisClient(LanisAccount(School("school", "city"), "name.lastname", "password"))
41+
or: client = LanisClient(LanisCookie("school id", "session id"))
4142
print(client.get_substitution_plan())
4243
client.close()
4344

β€ŽREADME.mdβ€Ž

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ It's an unofficial Python library for the Schulportal Hessen. Also available on
1616
+ Fetch calendar events.
1717
+ Fetch conversations.
1818
+ Fetch all schools that have Lanis.
19+
+ Fetch all web applets with their links.
1920

2021
**Overview of future Features, Problems and other things [here](https://github.com/users/kurwjan/projects/2).**
2122

@@ -25,18 +26,19 @@ It's an unofficial Python library for the Schulportal Hessen. Also available on
2526
pip install lanisapi
2627
```
2728

28-
Required is Python 3.11. *(older versions should definitely work too but I didn't tested it.)*
29+
Required is Python 3.11. *(older versions are probably not working, I didn't tested it.)*
2930

3031
## Example
3132

3233
This example gives the substitution plan.
3334

3435
```python
35-
from lanisapi import LanisClient, School
36+
from lanisapi import LanisClient, LanisAccount, LanisCookies, School
3637

3738
def main():
38-
client = LanisClient("schoolid", "name.lastname", "password")
39-
or: client = LanisClient(School("school", "city"), "password")
39+
client = LanisClient(LanisAccount("school id", "name.lastname", "password"))
40+
or: client = LanisClient(LanisAccount(School("school", "city"), "name.lastname", "password"))
41+
or: client = LanisClient(LanisCookie("school id", "session id"))
4042
client.authenticate()
4143
print(client.get_substitution_plan())
4244
client.close()

β€Ždocs/source/api/exceptions.rstβ€Ž

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@
55
Exceptions reference
66
====================
77

8-
.. currentmodule:: lanisapi.exceptions
9-
.. autoclass:: PageNotFoundError
10-
11-
.. autoclass:: NotAuthenticatedError
8+
.. automodule:: lanisapi.exceptions
9+
:members:

β€Ždocs/source/api/main.rstβ€Ž

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,31 @@ LanisClient
1010

1111
.. autoclass:: lanisapi.LanisClient
1212

13+
Properties
14+
~~~~~~~~~~~~~~~~~
15+
16+
.. autoproperty:: lanisapi.LanisClient.authentication_cookies
17+
1318
General functions
1419
~~~~~~~~~~~~~~~~~
1520

1621
.. currentmodule:: lanisapi.LanisClient
17-
1822
.. autofunction:: authenticate
1923

2024
.. autofunction:: logout
2125

2226
.. autofunction:: close
2327

28+
Authentication types
29+
~~~~~~~~~~~~~~~~~~~~
30+
31+
.. currentmodule:: lanisapi.functions.authentication_types
32+
.. autoclass:: School
33+
34+
.. autoclass:: LanisAccount
35+
36+
.. autoclass:: LanisCookie
37+
2438
Get all schools
2539
~~~~~~~~~~~~~~~
2640

@@ -30,12 +44,6 @@ Functions
3044
.. currentmodule:: lanisapi.LanisClient
3145
.. autofunction:: get_schools
3246

33-
Types
34-
^^^^^
35-
36-
.. currentmodule:: lanisapi.functions.schools
37-
.. autoclass:: School
38-
3947
Getting the Substitution plan
4048
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4149

@@ -98,4 +106,21 @@ Types
98106
^^^^^
99107

100108
.. currentmodule:: lanisapi.functions.conversations
101-
.. autoclass:: Conversation
109+
.. autoclass:: Conversation
110+
111+
Getting all web applets
112+
~~~~~~~~~~~~~~~~~~~~~~~
113+
114+
Functions
115+
^^^^^^^^^
116+
117+
.. currentmodule:: lanisapi.LanisClient
118+
.. autofunction:: get_apps
119+
120+
.. autofunction:: get_available_apps
121+
122+
Types
123+
^^^^^
124+
125+
.. currentmodule:: lanisapi.functions.apps
126+
.. autoclass:: App

β€Ždocs/source/conf.pyβ€Ž

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
# -- Project information
44

5-
project = 'LanisAPI'
6-
copyright = '2023, kurwjan'
7-
author = 'kurwjan'
5+
project = "LanisAPI"
6+
copyright = "2023, kurwjan"
7+
author = "kurwjan"
88

9-
release = '0.2.0'
10-
version = '0.2.0'
9+
release = "0.3.0"
10+
version = "0.3.0"
1111

1212
# -- General configuration
1313

1414
extensions = [
15-
'sphinx.ext.duration',
16-
'sphinx.ext.doctest',
17-
'sphinx.ext.autodoc',
18-
'sphinx.ext.autosummary',
19-
'sphinx.ext.intersphinx',
20-
'sphinx.ext.napoleon'
15+
"sphinx.ext.duration",
16+
"sphinx.ext.doctest",
17+
"sphinx.ext.autodoc",
18+
"sphinx.ext.autosummary",
19+
"sphinx.ext.intersphinx",
20+
"sphinx.ext.napoleon"
2121
]
2222

2323
intersphinx_mapping = {
24-
'python': ('https://docs.python.org/3/', None),
25-
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
24+
"python": ("https://docs.python.org/3/", None),
25+
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
2626
}
27-
intersphinx_disabled_domains = ['std']
27+
intersphinx_disabled_domains = ["std"]
2828

29-
templates_path = ['_templates']
29+
templates_path = ["_templates"]
3030

3131
# -- Options for HTML output
3232

@@ -35,4 +35,4 @@
3535

3636
# -- don't show lanisapi.LanisClient at the beginning
3737

38-
add_module_names = False
38+
add_module_names = False

β€Ždocs/source/first_steps.rstβ€Ž

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,22 @@ Example code
3636

3737
.. code-block:: python
3838
39-
from lanisapi import LanisClient, School
39+
from lanisapi import LanisClient, LanisAccount, LanisCookie, School
4040
4141
def main():
42-
client = LanisClient("schoolid", "name.lastname", "password")
43-
or: client = LanisClient(School("Testschule MH", "Testhausen City"), "password")
42+
client = LanisClient(LanisAccount("school id", "name.lastname", "password"))
43+
or: client = LanisClient(LanisAccount(School("school", "city"), "name.lastname", "password"))
44+
or: client = LanisClient(LanisCookie("school id", "session id")) # Use client.authentication_cookies in the previous session
4445
client.authenticate()
4546
print(client.get_substitution_plan())
4647
client.close()
4748
4849
if __name__ == "__main__":
4950
main()
5051
51-
1. First you initialise the ``LanisClient`` class with the ``schoolid`` you can find it in the url at ``?=i`` in https://start.schulportal.hessen.de/?i=SCHOOLID.
52+
1. First you initialise the ``LanisClient`` class with the LanisAccount dataclass. You can find the school id in the url at ``?=i`` in https://start.schulportal.hessen.de/?i=SCHOOLID.
5253
2. Or you initalise it with School(``school``, ``city``).
53-
3. Then you log in with ``authenticate()``.
54-
4. Then we print the current substitution plan.
55-
5. Then we close the client. **You need to do this.**
54+
3. Or if you already initialised before you can use the previous session and provide ``LanisCookie`` with ``LanisClient.authentication_cookies``.
55+
4. Then you log in with ``authenticate()``.
56+
5. Then we print the current substitution plan.
57+
6. Then we close the client. **You need to do this.**

β€Ždocs/source/index.rstβ€Ž

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@ Features
3434
* Fetch calendar events.
3535
* Fetch conversations.
3636
* Fetch all schools that have Lanis.
37+
* Fetch all web applets with their links.
3738

3839
Overview of future features, problems and other things `here <https://github.com/users/kurwjan/projects/2>`__.
3940

4041
Example
4142
-------
4243
.. code-block:: python
4344
44-
from lanisapi import LanisClient, School
45+
from lanisapi import LanisClient, LanisAccount, LanisCookie, School
4546
4647
def main():
47-
client = LanisClient("schoolid", "name.lastname", "password")
48-
or: client = LanisClient(School("school", "city"), "password")
48+
client = LanisClient(LanisAccount("school id", "name.lastname", "password"))
49+
or: client = LanisClient(LanisAccount(School("school", "city"), "name.lastname", "password"))
50+
or: client = LanisClient(LanisCookie("school id", "session id"))
4951
client.authenticate()
5052
print(client.get_substitution_plan())
5153
client.close()

β€Žpyproject.tomlβ€Ž

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "lanisapi"
7-
version = "0.2.0"
7+
version = "0.3.0"
88
authors = [
99
{ name = "kurwjan" }
1010
]
@@ -40,7 +40,7 @@ dependencies = [
4040
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
4141
# McCabe complexity (`C901`) by default.
4242
select = ["F","E","W","C901","I","N","D","DTZ","RET","SIM","RSE","Q","ICN","EM","PIE","LOG","ANN","B"]
43-
ignore = ["DTZ007","DTZ011","ANN101","D416","D404","F405"]
43+
ignore = ["DTZ007","DTZ011","ANN101","ANN102","D416","D404","F405"]
4444

4545
# Allow fix for all enabled rules (when `--fix`) is provided.
4646
fixable = ["ALL"]
@@ -73,10 +73,13 @@ exclude = [
7373
per-file-ignores = {}
7474

7575
# Same as Black.
76-
line-length = 88
76+
line-length = 300
7777

7878
# Allow unused variables when underscore-prefixed.
7979
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
8080

8181
# Assume Python 3.11
8282
target-version = "py311"
83+
84+
[tool.ruff.lint.pycodestyle]
85+
ignore-overlong-task-comments = true

β€Žsrc/lanisapi/__init__.pyβ€Ž

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
"""A lib to interact with the Schulportal Hessen. Use LanisClient to interact."""
22

33
from .client import LanisClient
4+
from .functions.apps import App
5+
from .functions.authentication_types import LanisAccount, LanisCookie, School
46
from .functions.calendar import Calendar
57
from .functions.conversations import Conversation
6-
from .functions.schools import School
78
from .functions.substitution import SubstitutionPlan
89
from .functions.tasks import Task
910

10-
__all__ = ["LanisClient", "Task", "SubstitutionPlan", "Calendar", "Conversation", "School"]
11+
__all__ = [
12+
"LanisClient",
13+
"Task",
14+
"SubstitutionPlan",
15+
"Calendar",
16+
"Conversation",
17+
"App",
18+
"LanisAccount",
19+
"LanisCookie",
20+
"School",
21+
]

0 commit comments

Comments
Β (0)