'Get the CategoryDescription from a package.
Parameters
package : `module` or `str`
A package containing the category.'

@classmethod
def from_package(cls, package):

    if isinstance(package, str):
        package = __import__(package, fromlist=[''])
    package_name = package.__name__
    qualified_name = package_name
    default_name = package_name.rsplit('.', 1)[(-1)]
    name = getattr(package, 'NAME', default_name)
    description = getattr(package, 'DESCRIPTION', None)
    long_description = getattr(package, 'LONG_DESCRIPTION', None)
    url = getattr(package, 'URL', None)
    help = getattr(package, 'HELP', None)
    keywords = getattr(package, 'KEYWORDS', None)
    widgets = getattr(package, 'WIDGETS', None)
    priority = getattr(package, 'PRIORITY', (sys.maxsize - 1))
    icon = getattr(package, 'ICON', None)
    background = getattr(package, 'BACKGROUND', None)
    if ((priority == (sys.maxsize - 1)) and (name.lower() == 'prototypes')):
        priority = sys.maxsize
    return CategoryDescription(name=name, qualified_name=qualified_name, description=description, long_description=long_description, help=help, url=url, keywords=keywords, widgets=widgets, priority=priority, icon=icon, background=background)
