Git Product home page Git Product logo

hermes's Introduction

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.

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.

What inspired hermes?

The name was inspired by Hermes Conrad from Futurama and his love of filing paperwork. It also was developed to help people deal with metadata in the Python environment.

Requirements

  • ArcGIS Desktop 10.3.x+
  • Python 2.7.x (32-bit)

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 : 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'
                                      }
                    }
    }

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

Copyright 2015 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license file.

[](Esri Tags: hermes) [](Esri Language: Python)โ€‹

hermes's People

Contributors

achapkowski avatar adamkerz avatar

Stargazers

 avatar Stephen Appel avatar Meg avatar Josh K avatar  avatar Aquabiota Solutions AB avatar Chelsea Rozek avatar  avatar Simon Norris avatar Stoyan Shopov avatar Brandon Herrington avatar jacob avatar Bruno Caimar avatar Cindy Jayakumar avatar

Watchers

James Cloos avatar  avatar Cort Daniel avatar Kevin Kelly avatar Cindy Jayakumar avatar Randy Jones avatar  avatar Jennifer Duerr avatar  avatar  avatar

hermes's Issues

Help?

#I get a bunch of errors trying to replicate you User Reader example saying:

File "hermtest.py", line 6, in <module>
    pw = Paperwork(dataset=fc)
  File "C:\pythonenv\pyodbc_hermes\venv\lib\site-packages\esri_hermes-1.1.2-py2.7.egg\hermes\paperwork.py", line 89, in __init__
    self.dataset = dataset
  File "C:\pythonenv\pyodbc_hermes\venv\lib\site-packages\esri_hermes-1.1.2-py2.7.egg\hermes\paperwork.py", line 128, in dataset
    self._setup()
  File "C:\pythonenv\pyodbc_hermes\venv\lib\site-packages\esri_hermes-1.1.2-py2.7.egg\hermes\paperwork.py", line 111, in _setup
    "arc" : str(arcpy.GetMessages(2))
hermes.common.HermesErrorHandler: {'function': '_setup', 'line': 'line 102', 'arc': '', 'synerror': 'RuntimeError: Object: Error in executing tool', 'filename': 'paperwork.py'}

What am I missing? I have imported arcpy, hermes and from hermes imported Paperwork

Conflicting package name with an already public python package

Hi guys,

I'm just about to start using hermes to update some of our metadata but have discovered that someone has released an unrelated package also called hermes:

https://pypi.python.org/pypi/hermes/

I'm going to write a setup.py script for this and will probably rename the package to esri-hermes, but will keep the package folder name as hermes, so the distinction will only be to pip. We'll put it into our internal PyPi mirror, but it would be nice for this to be published to the public PyPi but I'm not sure what further steps should be taken to avoid the package folder name conflict if someone happened to install both esri-hermes and hermes... Any thoughts?

Package not working within 64 bits python environnement

Within 64 bits python environnement the package is not working.

Especially, it is not possible to use it in a python script of an ArcGIS toolbox executed in Background (i.e. executed with python 64bits and background processing 64 bits).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.