Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
achapkowski committed Jul 7, 2015
1 parent 045be3a commit 1b56036
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# hermes
Collection of Utilities to Read/Write a Dataset's Metadata
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?
Why not, metadata is the way users describe their data. It good to have tools to manage these datasets.
Why not, metadata is the way users describe their data. It good to have tools to manage these datasets.

# Requirements
- ArcGIS Desktop 10.3.x+
Expand All @@ -20,38 +24,38 @@ Why not, metadata is the way users describe their data. It good to have tools t

Usage Reader Example:

>>> fc =r"c:\temp\scratch.gdb\states"
>>> pw = Paperwork(dataset=fc)
>>> print pw.convert()
>>> 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)
>>> 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:
<someelement myValue=1>i heart paperwork</someelement>
Results in:
{'someelement': { '@myValue' : 1,
'#text' : 'i heart paperwork'
}
}
<someelement myValue=1>i heart paperwork</someelement>
Results in:
{'someelement': { '@myValue' : 1,
'#text' : 'i heart paperwork'
}
}
Example 2:
<someelement myValue=1>
<subelement tags="fish">my value</subelement>
</someelement>
<someelement myValue=1>
<subelement tags="fish">my value</subelement>
</someelement>
Results in:
{'someelement': { '@myValue' : 1,
"subelement" : {'@tags' : "fish",
'#text' : 'my value'
}
}
}
{'someelement': { '@myValue' : 1,
"subelement" : {'@tags' : "fish",
'#text' : 'my value'
}
}
}

0 comments on commit 1b56036

Please sign in to comment.