biosimulators_utils.licensing package#

Submodules#

biosimulators_utils.licensing.core module#

Tool for managing licenses through environment variables

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-09-1

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

class biosimulators_utils.licensing.core.LicenseManager[source]#

Bases: AbstractContextManager

Base singleton class for managing setting up licenses for software packages from environment variables

abstract property ENV_VAR_PREFIX[source]#

Get the prefix for environment variables

Returns:

prefix for environment variables

Return type:

str

__enter__()[source]#

Enter a context

__exit__(exc_type, exc_value, traceback)[source]#

Exit a context

Parameters:
  • exc_type

  • exc_value

  • traceback

abstract end()[source]#

Terminate usage of the software package with license keys

get_keys_from_env_vars()[source]#

Get the license keys for the software package from environment variables

Returns:

environment license variables for a software package

Return type:

dict

abstract is_package_available()[source]#

Determine whether the package is installed and available

Returns:

whether the package is installed and available

Return type:

bool

abstract start()[source]#

Initialize the usage of the software package with license keys

biosimulators_utils.licensing.gurobi module#

Tool for managing Gurobi licenses through environment variables

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-09-1

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

class biosimulators_utils.licensing.gurobi.GurobiLicenseManager[source]#

Bases: LicenseManager

Gurobi license manager

ENV_VAR_PREFIX = 'GRB'[source]#
end()[source]#

Terminate usage of the software package with license keys

get_keys_from_env_vars()[source]#

Get the license keys for the software package from environment variables

Returns:

environment license variables for a software package

Return type:

dict

is_package_available()[source]#

Determine whether the package is installed

Returns:

whether the package is installed

Return type:

bool

save_keys_to_license_file(filename='/home/runner/gurobi.lic')[source]#

Save license keys to a file

Parameters:

filename (str) – path to save license

start()[source]#

Initialize usage of the software package with license keys