trestle.core.commands.canonicalize
trestle.core.commands.canonicalize ¤
Trestle Canonicalize Command.
Attributes¤
logger = logging.getLogger(__name__) module-attribute ¤
Classes¤
CanonicalizeCmd ¤
Bases: CommandBase
flowchart TD
trestle.core.commands.canonicalize.CanonicalizeCmd[CanonicalizeCmd]
trestle.core.commands.command_docs.CommandBase[CommandBase]
trestle.core.commands.command_docs.CommandBase --> trestle.core.commands.canonicalize.CanonicalizeCmd
click trestle.core.commands.canonicalize.CanonicalizeCmd href "" "trestle.core.commands.canonicalize.CanonicalizeCmd"
click trestle.core.commands.command_docs.CommandBase href "" "trestle.core.commands.command_docs.CommandBase"
Canonicalize a JSON document using RFC 8785.
This command reads the raw JSON input directly and writes canonical JSON bytes. It is designed for OSCAL artifacts, but it does not load the input through OSCAL models and can canonicalize any valid JSON document.
Source code in trestle/core/commands/canonicalize.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
Attributes¤
name = 'canonicalize' class-attribute instance-attribute ¤
Methods:¤
canonicalize(input_path, output_path=None) classmethod ¤
Write RFC 8785 canonical JSON bytes for input_path to output_path or stdout.
Source code in trestle/core/commands/canonicalize.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
Functions:¤
handler: python