Metered class

Metered class

Provides methods for applying Metered license.

The Metered type exposes the following members:

Constructors

Constructor Description
init

Methods

Method Description
get_consumption_credit Retrieves count of credits consumed.
get_consumption_quantity Retrieves amount of MBs processed.
set_metered_key Activates the product with Metered keys.

Example

from groupdocs.viewer import Metered

def set_metered_license():
    public_key = "******"
    private_key = "******"

    if not public_key or public_key == "******" or not private_key or private_key == "******":
        print("Please set your public and private keys")
        return

    metered = Metered()
    metered.set_metered_key(public_key, private_key)

    mb_processed = metered.get_consumption_quantity()
    print("MB processed:", mb_processed)

    credits_used = metered.get_consumption_credit()
    print("Credits used:", credits_used)

if __name__ == "__main__":
    set_metered_license()

See Also