import os

from instauto.api.client import ApiClient
from instauto.api.actions.structs.profile import Info

if __name__ == '__main__':
    if os.path.isfile('./.instauto.save'):
        client = ApiClient.initiate_from_file('./.instauto.save')
    else:
        client = ApiClient(user_name=os.environ.get("INSTAUTO_USER") or "your_username", password=os.environ.get("INSTAUTO_PASS") or "<PASSWORD>")
        client.login()
        client.save_to_disk('./.instauto.save')

    # get user info by username
    i_uname = Info(username="")
    info_username = client.profile_info(i_uname)
    print(info_username)

    # get user info by user id
    i_id = Info(user_id="")
    info_id = client.profile_info(i_id)
    print(info_id)


import os

from instauto.api.client import ApiClient
from instauto.api.actions.structs.profile import Info

if __name__ == '__main__':
    if os.path.isfile('./.instauto.save'):
        client = ApiClient.initiate_from_file('./.instauto.save')
    else:
        client = ApiClient(user_name=os.environ.get("INSTAUTO_USER") or "your_username", password=os.environ.get("INSTAUTO_PASS") or "<PASSWORD>")
        client.login()
        client.save_to_disk('./.instauto.save')

    # get user info by username
    i_uname = Info(username="")
    info_username = client.profile_info(i_uname)
    print(info_username)

    # get user info by user id
    i_id = Info(user_id="")
    info_id = client.profile_info(i_id)
    print(info_id)


# get user info by username # get user info by user id