pylinky/__main__.py
def main():
    """Main function"""
    parser = argparse.ArgumentParser()
    parser.add_argument('-u', '--username',
                        required=True, help='enedis username')
    parser.add_argument('-p', '--password',
                        required=True, help='Password')
    args = parser.parse_args()

    client = LinkyClient(args.username, args.password)

    try:
        client.login()
        client.fetch_data()
    except BaseException as exp:
        print(exp)
        return 1
    finally:
        client.close_session()
    print(json.dumps(client.get_data(), indent=2))
def main():
    """Main function"""
    parser = argparse.ArgumentParser()
    parser.add_argument('-u', '--username',
                        required=True, help='enedis username')
    parser.add_argument('-p', '--password',
                        required=True, help='Password')
    args = parser.parse_args()

    client = LinkyClient(args.username, args.password)

    try:
        client.login()
        client.fetch_data()
    except BaseException as exp:
        print(exp)
        return 1
    finally:
        client.close_session()
    print(json.dumps(client.get_data(), indent=2))
Main function