Module Expr Str Import alias ImportFrom alias Import alias Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore BinOpAdd NameLoad TupleLoad Str Str Str Str Assign NameStore BinOpAdd NameLoad TupleLoad Str Str Str Str Str Str Str Str Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad attr NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Return TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Return BinOpSub Call NameLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Call NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list If CompareEq Call AttributeLoad NameLoad attr Str body Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Return Call AttributeLoad Str attr ListComp IfExp Call AttributeLoad NameLoad attr BinOpMult Str NameLoad SubscriptLoad NameLoad Slice NameLoad NameLoad comprehension NameStore NameLoad orelse Return Call AttributeLoad Str attr ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad Str body Assign NameStore Dict For NameStore NameLoad body Assign NameStore NameLoad Assign NameStore Call NameLoad ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Str For NameStore NameLoad body If CompareIn NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore Dict Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore NameLoad Return NameLoad If Call NameLoad NameLoad NameLoad body Return NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareEq NameLoad Str body Return NameLoad If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr IfExp CompareIn Str NameLoad Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list
N/A N/A 
.. module:: metadata
   :platform: Unix, Windows
   :synopsis: Pacakge metadata parsing.

.. moduleauthor:: Christian S. Perone <christian.perone@gmail.com>

:mod:`metadata` -- package metadata parser
==================================================================
 N/A string email.parser Parser N/A pkg_resources N/A HEADER_META_1_0 N/A metadata-version name version platform supported-platform summary description keywords home-page author author-email license classifier N/A HEADER_META_1_1 N/A HEADER_META_1_0 N/A download-url requires provides obsoletes N/A HEADER_META_1_2 N/A HEADER_META_1_1 N/A maintainer maintainer-email requires-python requires-external requires-dist provides-dist obsoletes-dist project-url N/A HEADER_META N/A 1.0 1.1 1.2 HEADER_META_1_0 HEADER_META_1_1 HEADER_META_1_2 N/A METADATA_NAME PKG-INFO parse_metadata N/A N/A metadata N/A N/A N/A  Parse the package PKG-INFO metadata. Currently supports versions 1.0 (PEP-0241),
    1.1 (PEP-0314), 1.2 (PEP-0345).

    :param metadata: the raw PKG-INFO metadata text
    :type metadata: string
    :rtype: tuple
    :return: (parsed_metadata, key_known), the parsed_metadata is the rfc822.Message
             object and the key_known is the fields found in the metadata info which
             is part of the metadata version specification
     N/A parsed_metadata N/A N/A N/A Parser parsestr metadata N/A metadata_spec N/A set N/A HEADER_META N/A N/A parsed_metadata N/A metadata-version N/A key_exist N/A set N/A N/A N/A s lower N/A s N/A N/A parsed_metadata keys N/A N/A parsed_metadata N/A N/A key_exist intersection metadata_spec N/A clean_lead_ws_description N/A N/A metadata field_name N/A N/A N/A  Sometimes the metadata fields are a mess, this function is intended to remove the leading
    extra space some authors add in front of the 'description' field and to handle some other
    field cases.

    :param metadata: the metadata text
    :param field_name: the name of the field, like 'description'
    :rtype: string
    :return: the processed metadata
     calc_leading N/A N/A line N/A N/A N/A N/A N/A len line N/A len N/A N/A line lstrip N/A most_common N/A N/A lst N/A N/A N/A N/A max N/A set lst key N/A lst count N/A N/A N/A N/A N/A field_name lower description N/A N/A leading_ws_count N/A N/A calc_leading line N/A line N/A N/A metadata splitlines N/A most_common_ws_count N/A most_common leading_ws_count N/A strip_split N/A N/A N/A N/A metadata strip splitlines N/A N/A N/A join N/A N/A N/A N/A line startswith N/A most_common_ws_count N/A line N/A most_common_ws_count line N/A line strip_split N/A N/A N/A N/A join N/A N/A N/A line strip N/A line N/A N/A metadata splitlines N/A field_process N/A N/A field_name field_value N/A N/A N/A  Processes a field, it changes the 'UNKNOWN' values for None, clear leading whitespaces, etc.

    :param field_name: the field name
    :param field_value: the value of the field
    :rtype: string or list
    :return: field value processed
     N/A N/A field_name classifier N/A N/A root N/A N/A line field_value N/A N/A d root N/A path_split N/A tuple N/A N/A N/A s strip N/A s N/A N/A line split :: N/A level path_split N/A N/A N/A level d N/A N/A d N/A d N/A level N/A N/A b N/A N/A N/A d N/A level b N/A d b N/A root N/A N/A isinstance field_value list N/A N/A field_value N/A f_value N/A clean_lead_ws_description field_value field_name N/A N/A hasattr f_value decode N/A N/A f_value N/A N/A f_value decode utf-8 N/A N/A f_value UNKNOWN N/A N/A None N/A N/A field_name keywords N/A N/A f_value N/A N/A field_value split N/A N/A , field_value , N/A f_value N/A metadata_to_dict N/A N/A parsed_metadata key_known N/A N/A N/A  This is the main function used to process the parsed metadata into a structured
    and pre-processed data dictionary.

    :param parsed_metadata: the return of the function :func:`stallion.metadata.parse_metadata`.
    :rtype: dictionary
    :returns: the processed metadata dictionary
     N/A mdict N/A N/A field N/A set N/A N/A parsed_metadata keys N/A N/A all_values N/A N/A parsed_metadata get_all field N/A N/A N/A len all_values 1 N/A N/A all_values N/A all_values N/A 0 N/A fl_name N/A N/A field lower N/A fl_processed N/A field_process fl_name all_values N/A fl_processed N/A N/A N/A mdict N/A fl_name fl_processed N/A mdict N/A