from dlubal.api import rfem

def main():
    with rfem.Application() as rfem_app:
        info= rfem_app.get_application_info()
        print(info)

        info = rfem_app.get_subscription_info()
        print(info)

        if info.api_requests_count > info.api_requests_limit:
            message = 'WARNING: Number of requests exceeds the limit.'
        elif info.api_requests_count >= info.api_requests_limit * 0.8:
            message = 'INFO: Number of requests approaching limit.'
        else:
            message = 'INFO: Number of inquiries fits the plan'
        print(f'{message}')

        # Get and set base_data
        base_data=rfem_app.get_base_data()
        base_data.addons.glass_design_active=False
        base_data.general_settings.member_representatives_active=False
        rfem_app.set_base_data(base_data=base_data)
        # print(f'base_data:\n{base_data}')

if __name__ == '__main__':
    main()