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: contextlib.AbstractContextManager

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

abstract property ENV_VAR_PREFIX[source]

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:

class C:

@classmethod def f(cls, arg1, arg2, …):

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.

Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.

__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: biosimulators_utils.licensing.core.LicenseManager

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

start()[source]

Initialize usage of the software package with license keys