Skip to main content
=================================
SHYAML: YAML for the command line
=================================


Disclaimer
==========

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.


Description
===========

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
scripts.


Installation
============

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

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


Usage
=====

``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 !!"
subvalue:
how-much: 1.1
how-many: 2
things:
- first
- second
- third
maintainer: "Valentin Lab"
description: |
Multiline description:
Line 1
Line 2
EOF

Simple query of simple attribute::

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

Query nested attributes::

$ cat test.yaml | shyaml get-value subvalue.how-much
1.1

Get type of attributes::

$ cat test.yaml | shyaml get-type name
str
$ cat test.yaml | shyaml get-value subvalue.how-much
float

Get sub YAML from a structure attribute::

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

Line 1

Line 2

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

Query a list::

$ cat test.yaml | shyaml get-value subvalue.things
- first
- second
- third
$ cat test.yaml | shyaml get-value subvalue.things.0
first
$ cat test.yaml | shyaml get-value subvalue.things.-1
third
$ cat test.yaml | shyaml get-value subvalue.things.5
Error: list index error in path 'subvalue.things.5'.

Useless fun::

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

A Quick remainder of what is available::

$ shyaml
usage:
shyaml get-value KEY
shyaml get-type KEY
shyaml keys
Changelog
=========

0.1.2 (2013-03-23)
------------------

New
~~~

- Support for list indexes (see README.rst). [Valentin Lab]

- Catch exceptions when parsing structure and output a clean error
message. [Valentin Lab]

0.1.1 (2013-02-27)
------------------

Changes
~~~~~~~

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

Metadata

Release files for shyaml 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shyaml 0.1.2
File Size Uploaded
shyaml-0.1.2.tar.gz 3.1 kB Details

Release files / shyaml-0.1.2.tar.gz

Download URL shyaml-0.1.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b0a80617303157c80bcbb48cf1ebfe5206d05de97ed2e6b1ef232fd35c46a3e3
BLAKE2b-256 checksum
How to use checksums
86bf4ae4c2679528890d28269b02f6067d1a525b573023a7eee60e632e1a6616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.0

2 release files

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.4

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.3

1 release file

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page