Library

The Library class initializes AVBlocks and manages license information.

Class

class avblocks.Library

Bases: object

Initializes AVBlocks and manages license information.

static description() → str

Returns library build description.

Returns:

String containing details about the build including full version, architecture, configuration, license and platform.

static initialize() → bool

Initializes the AVBlocks library. Must be called once before the library is used, usually when the application starts.

Returns:

True if the library is successfully initialized, otherwise False.

static is_licensed(product: str | None = None, feature: str | None = None) → bool

Checks whether a product feature is licensed.

Args:

product: The product id. If None, the AVBlocks product is implied. feature: The feature id. If None, the default AVBlocks product feature is implied.

Returns:

True if the specified product feature is licensed.

Note:

If a product is fully licensed then the function will always return True for that product regardless of the feature parameter.

If a product is licensed for a limited set of features then the function will return True for that product only if the feature parameter specifies one of the licensed features or is None.

static license_status() → LicenseStatusFlags

Returns the current license status.

Returns:

License status flags.

Note:

In the Demo build the license status is always LicenseStatusFlags.DemoBuild.

static major_version() → int

Returns library major version.

static minor_version() → int

Returns library minor version.

static patch_version() → int

Returns library patch version.

Note:

The patch version is used for bugfixes and small improvements that do not involve API changes.

static set_license(license_string: str | None) → LicenseStatusFlags

Sets a license string. The supplied license is appended to the library license state.

Args:
license_string: A string with license information. If None, the library

license state is cleared.

Returns:

The status after the license is set. The returned value is a combination of flags from the LicenseStatusFlags enum.

Note:

A Demo build of the library cannot be licensed and always returns LicenseStatusFlags.DemoBuild.

static set_license_tls(use_tls: bool) → None

Sets whether the license validation should use TLS (HTTPS) or not.

Args:
use_tls: If True the license validation will use TLS (HTTPS),

otherwise it will use HTTP. The default is False.

Note:

This setting is used when the license validation is performed against a license server. Must be called before Library.set_license().

static shutdown() → None

Closes the AVBlocks library and frees the resources that are used (if any). Should be called when the library will not be used anymore, e.g. when the application ends.