osnapi/core.py
def login(username:str, password:str) -> str:
    """ HTTP: POST

        Input:
            - username: your opensense.network username
            - password: your opensense.network username

        Output:
             - A login Token that can be used for 1 hour.
        Note: The Token is automatically added to the Settings and used whenever one is needed.
        Note: username and password are also stored in the Settings.
        Example:
            {'id': '...'}
    """
    query = build_query(target='/users/login')
    body = {'username': username, 'password': password}
    token = send_post(query, body)['id']
    Settings.username, Settings.password = username, password
    Settings.auth_token = token
    return token
 HTTP: POST

        Input:
            - username: your opensense.network username
            - password: your opensense.network username

        Output:
             - A login Token that can be used for 1 hour.
        Note: The Token is automatically added to the Settings and used whenever one is needed.
        Note: username and password are also stored in the Settings.
        Example:
            {'id': '...'}
    
POST
Input:
username: your opensense.network username
password: your opensense.network username

A login Token that can be used for 1 hour.
Note: The Token is automatically added to the Settings and used whenever one is needed.
Note: username and password are also stored in the Settings.
POST Input : username : your opensense . network username password : your opensense . network username A login Token that can be used for 1 hour . Note : The Token is automatically added to the Settings and used whenever one is needed . Note : username and password are also stored in the Settings .
def login(username:str, password:str) -> str:
    query = build_query(target='/users/login')
    body = {'username': username, 'password': password}
    token = send_post(query, body)['id']
    Settings.username, Settings.password = username, password
    Settings.auth_token = token
    return token
def login ( username : str , password : str ) -> str : query = build_query ( target = '/users/login' ) body = { 'username' : username , 'password' : password } token = send_post ( query , body ) [ 'id' ] Settings . username , Settings . password = username , password Settings . auth_token = token return token
HTTP: POST
Input:
 username: your opensense.network username
 password: your opensense.network username
HTTP : POST Input : username : your opensense . network username password : your opensense . network username
""" HTTP: POST

        Input:
            - username: your opensense.network username
            - password: your opensense.network username

        Output:
             - A login Token that can be used for 1 hour.
        Note: The Token is automatically added to the Settings and used whenever one is needed.
        Note: username and password are also stored in the Settings.
        Example:
            {'id': '...'}
    """
username
str
password
str
examples
None