solvebio/__init__.py
def login(**kwargs):
    """
    Sets up the auth credentials using the provided key/token,
    or checks the credentials file (if no token provided).

    Lookup order:
        1. access_token
        2. api_key
        3. local credentials

    No errors are raised if no key is found.
    """
    from .cli.auth import get_credentials
    global access_token, api_key, api_host

    # Clear any existing auth keys
    access_token, api_key = None, None
    # Update the host
    api_host = kwargs.get('api_host') or api_host

    if kwargs.get('access_token'):
        access_token = kwargs.get('access_token')
    elif kwargs.get('api_key'):
        api_key = kwargs.get('api_key')
    else:
        api_key = get_credentials()

    if not (api_key or access_token):
        print('No credentials found. Requests to SolveBio may fail.')
    else:
        from solvebio.client import client
        # Update the client host and token
        client.set_host()
        client.set_token()
def login(**kwargs):
    """
    Sets up the auth credentials using the provided key/token,
    or checks the credentials file (if no token provided).

    Lookup order:
        1. access_token
        2. api_key
        3. local credentials

    No errors are raised if no key is found.
    """
    from .cli.auth import get_credentials
    global access_token, api_key, api_host

    # Clear any existing auth keys
    access_token, api_key = None, None
    # Update the host
    api_host = kwargs.get('api_host') or api_host

    if kwargs.get('access_token'):
        access_token = kwargs.get('access_token')
    elif kwargs.get('api_key'):
        api_key = kwargs.get('api_key')
    else:
        api_key = get_credentials()

    if not (api_key or access_token):
        print('No credentials found. Requests to SolveBio may fail.')
    else:
        from solvebio.client import client
        # Update the client host and token
        client.set_host()
        client.set_token()
def login ( * * kwargs ) : from . cli . auth import get_credentials global access_token , api_key , api_host # Clear any existing auth keys access_token , api_key = None , None # Update the host api_host = kwargs . get ( 'api_host' ) or api_host if kwargs . get ( 'access_token' ) : access_token = kwargs . get ( 'access_token' ) elif kwargs . get ( 'api_key' ) : api_key = kwargs . get ( 'api_key' ) else : api_key = get_credentials ( ) if not ( api_key or access_token ) : print ( 'No credentials found. Requests to SolveBio may fail.' ) else : from solvebio . client import client # Update the client host and token client . set_host ( ) client . set_token ( )
Sets up the auth credentials using the provided key/token,
    or checks the credentials file (if no token provided).

    Lookup order:
        1. access_token
        2. api_key
        3. local credentials

    No errors are raised if no key is found.
Sets up the auth credentials using the provided key / token or checks the credentials file ( if no token provided ) .