Skip to main content

E-Kréta API wrapper

Project description

e-kreta-hunor-2.0

🇬🇧 English e-kreta-hunor-2.0 is an unofficial api wrapper for the e-kreta system

installation

now available on PyPI

py -m pip install e-kreta-hun0r

Usage

quick example

import os

from kreta.mobile import endpoints, models
from kreta.idp import Auth_Session

username = os.getenv("username")
pwd = os.getenv("pwd")
institiute_code = os.getenv("institute_code")

with Auth_Session.login(username, pwd, institiute_code) as session:
    response = endpoints.get_notes(session)
    print(response)

    session.refresh() # it's automatically done when needed
  
    response = endpoints.get_device_state(session)
    print(response)
  
    session.invalidate() # invalidates the refresh token so remove if login is saved

Reccomended to use with context maneger to properly close the connection.

Reccomended to use session.invalidate() if the refresh token wont be saved as it is required in the process to revoke it.

sessiion.refresh() refreshes the access token. Usually not required as it done automatically when needed.

Important is that for the institute_code parameter the first code of the school is needed. check your schools id here

login_code

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

tests would be appreaciated

License

MIT

🇭🇺 Magyar e-kreta-hunor-2.0 egy api wrapper az e-kreta rendszer kezelésére

installáció

mostmár elérhető PyPI-n is

py -m pip install e-kreta-hun0r

Használat

gyors példa

import os

from kreta.mobile import endpoints, models
from kreta.idp import Auth_Session

username = os.getenv("username")
pwd = os.getenv("pwd")
institiute_code = os.getenv("institute_code")

with Auth_Session.login(username, pwd, institiute_code) as session:
    response = endpoints.get_notes(session)
    print(response)

    session.refresh() # a frissítés automatikus ez csak példa
  
    response = endpoints.get_device_state(session)
    print(response)
  
    session.invalidate() # invalidálja a refresh_token-t ha azt elmentjük ezt el kell hagyni

Ajánlott with context kezelőt használni hogy a kapcsolat szabályosan bomonjon fel.

Ajánlott session.invalidate() használata ha a refresh_token-t nem mentjük el.

sessiion.refresh() frissíti az tokeneket. Külön kiírni szügségtelen mert automatikusan frissítjük.

Fontos hogy az institute_code paraméter az iskola első kódját hasznája. Az iskolád kódját itt keresheted meg.

login_code

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

tests would be appreaciated

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

e_kreta_hun0r-2.0.13.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

e_kreta_hun0r-2.0.13-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file e_kreta_hun0r-2.0.13.tar.gz.

File metadata

  • Download URL: e_kreta_hun0r-2.0.13.tar.gz
  • Upload date:
  • Size: 61.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for e_kreta_hun0r-2.0.13.tar.gz
Algorithm Hash digest
SHA256 4fcbf8aa2b432689a61b275da1ab97c87f72f417619d5b20b91d734e924417f7
MD5 542b0fe7096de4f302f915ba8ba0c8be
BLAKE2b-256 0e09aa21dfd61c053534fdf1ae71b5f64c479ab8195023f4a2a6b48b402cc976

See more details on using hashes here.

Provenance

The following attestation bundles were made for e_kreta_hun0r-2.0.13.tar.gz:

Publisher: Publish.yml on hun0r/e-kreta-hun0r-2.0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file e_kreta_hun0r-2.0.13-py3-none-any.whl.

File metadata

  • Download URL: e_kreta_hun0r-2.0.13-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for e_kreta_hun0r-2.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 39b4478e07bf28e791b83bc08ad08ef432c1c9b05b32783fce4fba81041063b0
MD5 97ddddc8d04b465ce83f5d9e6d7fa113
BLAKE2b-256 5305db734805e887a626d83054a3650d8a4cf4e6b994886c53ab1eb404da0e8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for e_kreta_hun0r-2.0.13-py3-none-any.whl:

Publisher: Publish.yml on hun0r/e-kreta-hun0r-2.0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page