CLI Module

This module contains some functions for processing TVDs from the command line.

Example

The following provides the tvd command that comes when you install TVD2RDF.

1# tvd2rdf.__main__.py
2
3from .cli import parse_arguments
4
5def main():
6    args = parse_arguments()
7    args.func(args)
tvd2rdf.cli.config(args)

Action to be taken when the config argument is used.

Reads the default configuration file and outputs it as YAML to a file or the terminal.

Parameters:

config_fn (str) – Optional path / filename to which to write config information.

tvd2rdf.cli.convert(args)

Action to be taken when the convert argument is used.

Invokes Converter to read TVD and convert it into a RDF which is output to file or terminal.

Parameters:
  • args.config_fn (str) – Optional path / filename for YAML configuration file.

  • args.namespace (str) – Optional csv file of namespace prefixes and URIs.

  • args.tvd_fn (str) – Path / filename for TVD

  • args.output_fn (str) – Optional path / filename of writing RDF vocab definition.

  • args.output_fmt (str) – Optional format in which to serialize RDF vocab definition.

tvd2rdf.cli.parse_arguments()

Parses the arguments passed through the command line.