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
presetsubcommand of yadg.This function requires the
args.presetandargs.folderarguments. Ifargs.folderis an existing folder andargs.preseta valid schema file (with appropriately formated"import"and"calfile"entries), this function will prepend the specifiedargs.folderto all paths in theargs.preset, convert them to absolute paths, and save the resulting schema in the suppliedargs.outfile.Alternatively, if
args.processis 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
processsubcommand of yadg.This function first checks that the supplied
args.infileexists, 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
updatesubcommand of yadg.This function requires the
args.typeargument, 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.infileexists, 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.infilewith a “.new.json” suffix by default).- Return type
None