Fsdb::F...l_to_db(3)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

✨ yaml_to_db ✨ (the manual page is Fsdb::F...l_to_db(3))

okay so bestie, this is the User Contributed Perl Documentation page for yaml_to_db, and it is lowkey iconic in a β€œtiny filter that does one thing” way. πŸ’… We’re gonna get you comfy with it, no cap.


πŸŽ€ NAME πŸŽ€

yaml_to_db β€” convert a subset of YAML into fsdb. That’s the whole vibe. πŸ¦‹

🌈 SYNOPSIS 🌈

yaml_to_db <source.yaml

🧚 DESCRIPTION 🧚

So here’s the tea: this thing converts a very limited subset of YAML into Fsdb format. It is not out here doing general YAML sorcery β€” it’s a niche little gremlin and we love her. 🫢

The input is YAML-format (not fsdb). The input is parsed as YAML, assuming the file is an array of dictionary entries. We extract the dictionary names and output this as an fsdb table. Slay. ✨

We also flatten one level of lists into comma-separated values. iykyk πŸ“

The output is tab-separated fsdb. (Someday more general field separators should be supported.) Not today, though. 😭


πŸ’– OPTIONS πŸ’–

This module also supports the standard fsdb options:

  • -d β€” enable debugging output. Spill the diagnostics, bestie. πŸ”
  • -i or --input InputSource β€” read from InputSource, typically a file name, or "-" for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. πŸ“₯
  • -o or --output OutputDestination β€” write to OutputDestination, typically a file name, or "-" for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects. πŸ“€
  • --autorun or --noautorun β€” by default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The "--(no)autorun" option controls that behavior within Perl. πŸŽ›οΈ
  • --help β€” show help. πŸ†˜
  • --man β€” show full manual. πŸ“–

🌸 SAMPLE USAGE 🌸

πŸ“₯ Input:

- name: ACM
  role: sponsor
  alttext: ACM, the Association for Computing Machinery
  image: logos/acm-small.jpg
  link:  https://www.acm.org/
  date: 2016-01-01

- name: SIGCOMM
  role: sponsor
  alttext: SIGCOMM, ACM'S Special Interest Group on Communication
  image: logos/sigcommlogo.png
  link:  http://sigcomm.org
  date: 2016-01-02

- name: SIGMETRICS
  role: sponsor
  alttext: SIGMETRICS, ACM'S Special Interest Group on Performance Evaluation
  image: logos/sigmetrics-small.png
  link:  http://www.sigmetrics.org
  date: 2016-01-03

πŸͺ„ Command:

yaml_to_db <gnupod.yaml

πŸ“€ Output:

#fsdb -F t alttext date image link name role
ACM, the Association for Computing Machinery    2016-01-01    logos/acm-small.jpg    https://www.acm.org/    ACM    sponsor
SIGCOMM, ACM'S Special Interest Group on Communication    2016-01-02    logos/sigcommlogo.png    http://sigcomm.org    SIGCOMM    sponsor
SIGMETRICS, ACM'S Special Interest Group on Performance Evaluation    2016-01-03    logos/sigmetrics-small.png    http://www.sigmetrics.org    SIGMETRICS    sponsor
#   | yaml_to_db

πŸ‘€ SEE ALSO πŸ‘€

Fsdb. Go check the mothership, bestie. πŸš€


πŸ‘‘ CLASS FUNCTIONS πŸ‘‘

🧚 new

$filter = new Fsdb::Filter::yaml_to_db(@arguments);

Create a new yaml_to_db object, taking command-line arguments. Main character constructor energy. ✨

πŸŽ€ set_defaults

$filter->set_defaults();

Internal: set up defaults. Housekeeping, but make it cute. 🧹

πŸ¦‹ parse_options

$filter->parse_options(@ARGV);

Internal: parse command-line arguments. Reading the room, aka the @ARGV. πŸ“

🌈 setup

$filter->setup();

Internal: setup, parse headers. Getting the table ready for its close-up. πŸ’…

πŸ”₯ run

$filter->run();

Internal: run over each rows. Go off, filter. πŸ”₯


Copyright (C) 2011-2018 by John Heidemann <johnh@isi.edu>

This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details. πŸ“œ


That’s the tea! This page came from perl v5.32.1, dated 2024-08-02, and it is the Fsdb::F...l_to_db(3) manual page. Stay slaying, bestie. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from