<commit_before># hermes
Collection of Utilities to Read/Write a Dataset's Metadata.
Allows users to easily create and modify the metadata from the feature
class.  The data will be returned as a dictionary object for easy of
use.  This means users can modify values and push them back into the
metadata by referencing the key names.

![futureramahermes](http://upload.wikimedia.org/wikipedia/en/c/cb/FuturamaHermesConrad.png "Source: wikimedia.org")

# Why use hermes?
Metadata is the way users describe their data.  XML is hard, but this tool
converts the XML to a Python dictionary.  This means metadata is easy to
modify, change and add.

#  Requirements
 - ArcGIS Desktop 10.3.x+
 - Python 2.7.x

To use, just pass in the path of a feature class or table.  The dataset
can be any support ArcGIS format that support metadata.

Usage Reader Example:

    >>> fc =r"c:\temp\scratch.gdb\states"
    >>> pw = Paperwork(dataset=fc)
    >>> print pw.convert()

Usage Update Example (add searchKeys to the metadata):

    >>> fc = r"c:\temp\scratch.gdb\states"
    >>> pw = Paperwork(dataset=fc)
    >>> val =  pw.convert()
    >>> val['metadata']['dataIdInfo']['searchKeys'] = {}
    >>> val['metadata']['dataIdInfo']['searchKeys']['keywords'] = ['states', 'USA']
    >>> pw.save(d=val)

The dictionary results explained:

All attributes begin with a '@' and will be inside the element tag.
All text values will be stated as: #text : <value>
        Example:
                '''HTML<someelement myValue=1>i heart paperwork</someelement>'''
                Results in:
                {'someelement': { '@myValue' : 1,
                                  '#text' : 'i heart paperwork'
                                }
                }
        Example 2:
                '''html<someelement myValue=1>
                  <subelement tags="fish">my value</subelement>
                </someelement>'''
        Results:
                {'someelement': { '@myValue' : 1,
                                  "subelement" : {'@tags' : "fish",
                                                  '#text' : 'my value'
                                                  }
                                }
                }<commit_msg>README.md<commit_after># hermes
Collection of Utilities to Read/Write a Dataset's Metadata.
Allows users to easily create and modify the metadata from the feature
class.  The data will be returned as a dictionary object for easy of
use.  This means users can modify values and push them back into the
metadata by referencing the key names.

![futureramahermes](http://upload.wikimedia.org/wikipedia/en/c/cb/FuturamaHermesConrad.png "Source: wikimedia.org")

# Why use hermes?
Metadata is the way users describe their data.  XML is hard, but this tool
converts the XML to a Python dictionary.  This means metadata is easy to
modify, change and add.

#  Requirements
 - ArcGIS Desktop 10.3.x+
 - Python 2.7.x

To use, just pass in the path of a feature class or table.  The dataset
can be any support ArcGIS format that support metadata.

Usage Reader Example:

    >>> fc =r"c:\temp\scratch.gdb\states"
    >>> pw = Paperwork(dataset=fc)
    >>> print pw.convert()

Usage Update Example (add searchKeys to the metadata):

    >>> fc = r"c:\temp\scratch.gdb\states"
    >>> pw = Paperwork(dataset=fc)
    >>> val =  pw.convert()
    >>> val['metadata']['dataIdInfo']['searchKeys'] = {}
    >>> val['metadata']['dataIdInfo']['searchKeys']['keywords'] = ['states', 'USA']
    >>> pw.save(d=val)

The dictionary results explained:

All attributes begin with a '@' and will be inside the element tag.
All text values will be stated as: #text : <value>
Example:
    ```xml<someelement myValue=1>i heart paperwork</someelement>```

    Results in:

    {'someelement': { '@myValue' : 1,
                      '#text' : 'i heart paperwork'
                    }
    }

Example 2:
        ```xml
        <someelement myValue=1>
          <subelement tags="fish">my value</subelement>
        </someelement>
        ```

Results:

        {'someelement': { '@myValue' : 1,
                          "subelement" : {'@tags' : "fish",
                                          '#text' : 'my value'
                                          }
                        }
        }
{'fraction_non_alphanumeric': 0.11568123393316196, 'fraction_numerical': 0.004673989249824725, 'mean_word_length': 2.2059925093632957, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4380470', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1168, 'n_words': 413}