# eric7.PipInterface.piplicenses

pip-licenses

MIT License

Copyright (c) 2018 raimon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

### Global Attributes

DEFAULT_OUTPUT_FIELDS
FIELDS_TO_METADATA_KEYS
FIELD_NAMES
LICENSE_UNKNOWN
MAP_DEST_TO_ENUM
METADATA_KEYS
SUMMARY_FIELD_NAMES
SUMMARY_OUTPUT_FIELDS
SYSTEM_PACKAGES
__author__
__license__
__pkgname__
__summary__
__url__
__version__

### Classes

CompatibleArgumentParser |
CustomHelpFormatter |
CustomNamespace |
FromArg |
NoValueEnum |
OrderArg |
SelectAction |

### Functions

choices_from_enum |
create_licenses_list |
create_output_string |
create_parser |
create_summary_by_license_list |
create_summary_list |
enum_key_to_value |
filter_string |
find_license_from_classifier |
get_installed_distributions | Function to get the installed packages via pip.
get_output_fields |
get_packages |
get_pkg_included_file | Attempt to find the package's included file on disk and return the tuple (included_file_path, included_file_contents).
get_pkg_info |
main |
select_license_by_source |
value_to_enum_key |

## CompatibleArgumentParser

### Derived from

argparse.ArgumentParser

### Class Attributes

None

### Class Methods

None

### Methods

_verify_args |
parse_args |

### Static Methods

None

#### CompatibleArgumentParser._verify_args

_verify_args(args: CustomNamespace)

#### CompatibleArgumentParser.parse_args

parse_args(args: None | Sequence[str] = None, namespace: None | CustomNamespace = None, )
Up

## CustomHelpFormatter

### Derived from

argparse.HelpFormatter

### Class Attributes

None

### Class Methods

None

### Methods

CustomHelpFormatter |
_expand_help |
_format_action |
_split_lines |

### Static Methods

None

#### CustomHelpFormatter (Constructor)

CustomHelpFormatter(prog: str, indent_increment: int = 2, max_help_position: int = 24, width: Optional[int] = None, )

#### CustomHelpFormatter._expand_help

_expand_help(action: argparse.Action)

#### CustomHelpFormatter._format_action

_format_action(action: argparse.Action)

#### CustomHelpFormatter._split_lines

_split_lines(text: str, width: int)
Up

## CustomNamespace

### Derived from

argparse.Namespace

### Class Attributes

None

### Class Methods

None

### Methods

None

### Static Methods

None

Up

## FromArg

### Derived from

NoValueEnum

### Class Attributes

ALL
CLASSIFIER
META
MIXED

### Class Methods

None

### Methods

None

### Static Methods

None

Up

## NoValueEnum

### Derived from

Enum

### Class Attributes

None

### Class Methods

None

### Methods

__repr__ |

### Static Methods

None

#### NoValueEnum.__repr__

__repr__()
Up

## OrderArg

### Derived from

NoValueEnum

### Class Attributes

AUTHOR
COUNT
LICENSE
NAME
URL

### Class Methods

None

### Methods

None

### Static Methods

None

Up

## SelectAction

### Derived from

argparse.Action

### Class Attributes

None

### Class Methods

None

### Methods

__call__ |

### Static Methods

None

#### SelectAction.__call__

__call__(parser: argparse.ArgumentParser, namespace: argparse.Namespace, values: str, option_string: Optional[str] = None, )
Up

## choices_from_enum

choices_from_enum(enum_cls: Type[NoValueEnum])
Up

## create_licenses_list

create_licenses_list(args: "CustomNamespace", output_fields=DEFAULT_OUTPUT_FIELDS)
Up

## create_output_string

create_output_string(args: "CustomNamespace")
Up

## create_parser

create_parser()
Up

## create_summary_by_license_list

create_summary_by_license_list(args: "CustomNamespace")
Up

## create_summary_list

create_summary_list(args: "CustomNamespace")
Up

## enum_key_to_value

enum_key_to_value(enum_key: Enum)
Up

## filter_string

filter_string(item: str)
Up

## find_license_from_classifier

find_license_from_classifier(classifiers: list[str])
Up

## get_installed_distributions

get_installed_distributions(local_only=True, user_only=False)

Function to get the installed packages via pip.

Note: importlib_metadata.distributions() does not respect 'local_only' and 'user_only' keyword parameters.

local_only (TYPE (optional))
  DESCRIPTION (defaults to True)
user_only (TYPE (optional))
  DESCRIPTION (defaults to False)

Return:
  DESCRIPTION

Return Type:
  TYPE

Up

## get_output_fields

get_output_fields(args: CustomNamespace)
Up

## get_packages

get_packages(args: CustomNamespace, )
Up

## get_pkg_included_file

get_pkg_included_file(pkg, file_names_rgx: str)

Attempt to find the package's included file on disk and return the tuple (included_file_path, included_file_contents).

Up

## get_pkg_info

get_pkg_info(pkg)
Up

## main

main()
Up

## select_license_by_source

select_license_by_source(from_source: FromArg, license_classifier: list[str], license_meta: str)
Up

## value_to_enum_key

value_to_enum_key(value: str)
Up