Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Simple YAML accessor for shell scripts

Project description

SHYAML: YAML for the command line


This scripts was written very quickly and will not support all YAML
manipulation that you could have dreamed of. But it should support
some handy basic query of YAML file.

Please take a look at the next section to get a quick overview of
``shyaml`` capabilities.


Simple scripts that allow read access to YAML files through command line.

This can be handy, if you want to get access to YAML data in your shell


This script could be used out of the box, take the ``shyaml`` file and use it

If you want to use the distribution method I've chosen, which is ``distutils2``,
please first make sure you have ``distutils2``, in which case you could do a:

pysetup install shyaml


``shyaml`` takes it YAML input file from standard input ONLY. So there are
some sample routine.

Let's create a sample yaml file::

$ cat <<EOF > test.yaml
name: "MyName !!"
how-much: 1.1
how-many: 2
- first
- second
- third
maintainer: "Valentin Lab"
description: |
Multiline description:
Line 1
Line 2

Simple query of simple attribute::

$ cat test.yaml | shyaml get-value name
MyName !!

Query nested attributes::

$ cat test.yaml | shyaml get-value

Get type of attributes::

$ cat test.yaml | shyaml get-type name
$ cat test.yaml | shyaml get-value

Get sub YAML from a structure attribute::

$ cat test.yaml | shyaml get-type subvalue
$ cat test.yaml | shyaml get-value subvalue
description: 'Multiline description:

Line 1

Line 2

how-many: 2
how-much: 1.1
maintainer: Valentin Lab
- first
- second
- third

Useless fun::

$ cat test.yaml | shyaml get-value subvalue | shyaml get-value things
- first
- second
- third

A Quick remainder of what is available::

$ shyaml
shyaml get-value KEY
shyaml get-type KEY
shyaml keys

0.1.1 (2013-02-27)


- Doc: some minor enhancements, and an "Install" section. [Valentin Lab]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for shyaml, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size shyaml-0.1.1.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page