# DKVP I/O examples

## DKVP I/O in Python

Here are the I/O routines:

GENMD-INCLUDE-ESCAPED(polyglot-dkvp-io/dkvp_io.py)

And here is an example using them:

GENMD-RUN-COMMAND
cat polyglot-dkvp-io/example.py
GENMD-EOF

Run as-is:

GENMD-RUN-COMMAND
python polyglot-dkvp-io/example.py < data/small
GENMD-EOF

Run as-is, then pipe to Miller for pretty-printing:

GENMD-RUN-COMMAND
python polyglot-dkvp-io/example.py < data/small | mlr --opprint cat
GENMD-EOF

## DKVP I/O in Ruby

Here are the I/O routines:

GENMD-INCLUDE-ESCAPED(polyglot-dkvp-io/dkvp_io.rb)

And here is an example using them:

GENMD-RUN-COMMAND
cat polyglot-dkvp-io/example.rb
GENMD-EOF

Run as-is:

GENMD-RUN-COMMAND
ruby -I./polyglot-dkvp-io polyglot-dkvp-io/example.rb data/small
GENMD-EOF

Run as-is, then pipe to Miller for pretty-printing:

GENMD-RUN-COMMAND
ruby -I./polyglot-dkvp-io polyglot-dkvp-io/example.rb data/small | mlr --opprint cat
GENMD-EOF
