yadg package
Subpackages
- yadg.core package
- yadg.dgutils package
- yadg.parsers package
Submodules
yadg.main module
- yadg.main.run_with_arguments()
Main execution function.
This is the function executed when yadg is launched using the executable. The function has three subcommands:
process
: processes a given schema into a datagram.update
: updates a given schema or datagram to the current version.preset
: creates a schema from a preset file and a target folder.
- yadg.main.set_loglevel(delta)
yadg.subcommands module
- yadg.subcommands.preset(args)
The
preset
subcommand of yadg.This function requires the
args.preset
andargs.folder
arguments. Ifargs.folder
is an existing folder andargs.preset
a valid schema file (with appropriately formated"import"
and"calfile"
entries), this function will prepend the specifiedargs.folder
to all paths in theargs.preset
, convert them to absolute paths, and save the resulting schema in the suppliedargs.outfile
.Alternatively, if
args.process
is specified, the created schema will be directly processed into a datagram, which is then saved inargs.outfile
.- Return type
None
- yadg.subcommands.process(args)
The
process
subcommand of yadg.This function first checks that the supplied
args.infile
exists, is a valid schema, and if yes, proceeds to process the schema into a datagram. If this is successful, the datagram is checked for validity and written out intoargs.outfile
(which is “datagram.json” by default).- Return type
None
- yadg.subcommands.update(args)
The
update
subcommand of yadg.This function requires the
args.type
argument, which defines whether the object to be updated is a datagram or a schema. Generally, updating a schema and then re-processing the raw data is preferred to updating a datagram.If the supplied
args.infile
exists, and can be parsed as a json, it will be passed toyadg.dgutils.update_object()
to perform the update. If the update is successful, the object is checked for validity and written out intoargs.outfile
(which is theargs.infile
with a “.new.json” suffix by default).- Return type
None