Skip to main content

The python's api for epitech's intra

Project description

logo

Documentation

Documentation

Autologin

Install:

pip install --upgrade epytech

Import

from epytech import session, user, login, notif

Example:

from epytech import user, session, login, notif

class content:
    # Initialisation of the classes
    user = user.init()
    login = login.init()
    notif = notif.init()

    key = session.create("https://intra.epitech.eu/******************")

def loader():
    # Load the content into the classes
    content.user.load(content.key)
    content.login.load(content.key)
    content.notif.load(content.key)

def test():
    i = 0
    loader()

    if content.login.search('message') == "Success":
        print("Login Success")
        print("Welcome %s" % content.user.search('login'))

        if content.notif.data:
            if content.notif.len() > 1:
                print("Your Notifications:\n")
                while i < content.notif.len():
                    print(content.notif.search(i))
                    i += 1
            else:
                print("Your notification: %s" % content.notif.search(0))
    else:
        print("Login Failed")

test()

Result:

Login Success
Welcome *********@epitech.eu
You have a notification: Your login time is insufficient (0).

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

epytech-0.9.tar.gz (2.3 kB view hashes)

Uploaded Source

Supported by

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