Package: jk-licenses
jk_licensesIntroductionThis python module provides OS licenses.Information about this module can be found here:github.orgpypi.python.orgWhy this module?It is quite tiresome to maintain various instances of a program using all the same data. Therefore the functionality of providing a set of licenses has been factored out into this modulejk_licenses.This module is intended as a building block in module/package/application management.What licenses are supported?The following table provides an overview about the licenses available in this module as well as their identifiers and variables:Main license IDAlternative license IDsHuman readable namePlaceholders0BSDFree Public License 1.0.0AGPLv3AGPL-3.0, AGPLv3GNU Affero General Public License version 3Apache2Apache2GNU Lesser General Public License version 3BSD2BSD2The 2-Clause BSD Licenseyear, copyrightHolderBSD3BSD3The 3-Clause BSD Licenseyear, copyrightHolderGPLv3GPL-3.0, GPLv3GNU General Public License version 3LGPLv3LGPL-3.0, LGPLv3GNU Lesser General Public License version 3MITMIT Licenseyear, copyrightHolderProprietaryproprietaryPropriertary Licenseyear, copyrightHolderHow to use this moduleImport this modulePlease include this module into your application using the following code:importjk_licensesWhat this module providesThe python modulejk_licensesprovides a constant (= global variable) and three classes:constantLICENSE_MGRthat provides an instance ofLicenseMgrclassLicenseMgrthat maintaines the available licensesclassLicensethat represents a single licenseclassVariableDef: licenses may containVariableDefto represent placeholders within the license textThe classLicenseEach license is represented by an instance of classLicense.This section gives a short explanation about the structure of an instance ofLicensein pseudocode notation.This class provides the following properties:str name: The human readable name of this license.str[] licenseIDs: A list of strings that are associated with this license as identifiers. The first license ID is always the main license ID.str licenseID: The main license ID that identifies this license.str classifier: A string that contains a possible python trove classifier. Seepypi.orgfor details.VariableDef[] variableDefinitions: A list of variable definitions. These give information about placeholders to fill if you want to produce the license text.This class provides the following methods:str produceText(dict<str,str> variableAssignments): Produce the license text. If a license has placeholder, you need to provide a value for every placeholder. An exception is thrown on error.void validateVariableAssignments(dict<str,str> variableAssignments): You can check if data is provided for all placeholders as required using this method. An exception is thrown on error.You do not need to instantiate this class yourself. Instead you obtain an instance of this class through the license manager.The classLicenseMgrThe license manager is represented by an instance of classLicenseMgr.This section gives a short explanation about the structure of the license manager in pseudocode notation.This class provides the following properties:str name: The human readable name of this license.str[] licenseIDs: A list of strings that are associated with this license as identifiers. The first license ID is always the main license ID.str licenseID: The main license ID that identifies this license.str classifier: A string that contains a possible python trove classifier. Seepypi.orgfor details.VariableDef[] variableDefinitions: A list of variable definitions. These give information about placeholders to fill if you want to produce the license text.This class provides the following methods:str produceText(dict<str,str> variableAssignments): Produce the license text. If a license has placeholder, you need to provide a value for every placeholder. An exception is thrown on error.void validateVariableAssignments(dict<str,str> variableAssignments): You can check if data is provided for all placeholders as required using this method. An exception is thrown on error.You do not need to instantiate this class yourself. Instead you access a default license manger instance using the constant (= variable)LICENSE_MGRthis module provides.Access the licensesYou can display the licenses that are available via the license manager. Example:forlicenseIDinLICENSE_MGR.mainLicenseIDs:print(licenseID)If you specify the licenses available you can use the license identifiers to access a license object. Example:license=LICENSE_MGR.getLicense("0BSD")print(license.name)Producing a license textOnce you have a license object obtained from the license manager you can then produce the license text. Example:license=LICENSE_MGR.getLicense("0BSD")licenseText=license.produceText()And with arguments:license=LICENSE_MGR.getLicense("MIT")licenseText=license.produceText({"year":2020,"copyrightHolder":"Jürgen Knauth"})Contact InformationThis work is Open Source. This enables you to use this work for free.Please have in mind this also enables you to contribute. We, the subspecies of software developers, can create great things. But the more collaborate, the more fantastic these things can become. Therefore Feel free to contact the author(s) listed below, either for giving feedback, providing comments, hints, indicate possible collaborations, ideas, improvements. Or maybe for "only" reporting some bugs:Jürgen Knauth:jknauth@uni-goettingen.de,pubsrc@binary-overflow.deLicenseThis software is provided under the following license:Apache Software License 2.0