Use app engine yaml parser in scripts
I have some configuration files I want to write in yaml and read in a Python script running on Google 开发者_运维问答app engine. Given that app engine uses app.yaml, index.yaml among others it seems reasonable to assume there is a python yaml parser available.
- How can I gain access to this parser (what is the import) and where can I find its documentation.
- I'd also like to use this parser for scripts running outside of agg engine (build scripts and such) so how can I gain access to the same import from a script that will run from the command line?
The YAML library is included with the AppEngine SDK. It is located in google_appengine/lib/yaml. You should be able to use it in your AppEngine code just by having import yaml
in your code.
For non-AppEngine work, a quick Google search reveals http://pyyaml.org/ home to many and various Python implementations.
精彩评论