OSCAL Library Overview
The OSCAL Library consists of:
Content Management Modules
There is a core OSCAL class, as well as classes for each OSCAL model (Catalog, Profile, Mapping, ComponentDefinition, SSP, AssessmentPlan, AssessmentResults and POAM). Each of the model-specific classes inherit the OSCAL class for common methods and attributes.
The modules are organized as follows:
oscal_content.py: Includes theOSCALclass and and related functions common to all OSCAL models, plus the library exception hierarchy (OSCALError,UnsupportedModelOperation).oscal_helpers.py: Model-agnostic helper functions that operate on plain OSCAL JSON dicts and markup (props/links, UUID, id lookups, depth-limited safe copies). Re-exported fromoscal_content.py.oscal_source.py: Source acquisition and reference/import resolution (OscalRef,load_content/load_source,classify_source, href resolution, and theImportState/ImportFailureCode/ImportLoadError/ImportFailuretypes). Independent of the model classes; re-exported fromoscal_content.py.oscal_controls.py: IncludesCatalog,ProfileandMappingclasses and control layer functions.oscal_implementation.py: IncludesComponentDefinitionandSSPclasses and implementation layer functions.oscal_assessment.py: IncludesAssessmentPlan,AssessmentResultsandPOAMclasses and assessment layer functions.oscal_datatypes.py: OSCAL (Metaschema) data types and their regex patterns as defined by NIST.
See Content Management for more information.
Format Conversion Modules
oscal_converters.py: Primary functions to convert in either direction between XML and JSON, and between OSCAL HTML and OSCAL markdown (markup-line/markup-multiline).oscal_resequence.py: Resequences keys in OSCAL JSON and YAML files to canonical order derived from the processed metaschema index (the same structural index that drives XML↔JSON conversion). Depends on the OSCAL support database; version is taken from the document’smetadata/oscal-version(overridable).xml_formatter.py: Restructures OSCAL XML for readability
See Converters for more information.
Support Modules
The core modules are:
oscal_support.py: Includes theOSCAL_supportclass, used to manage the NIST-published OSCAL metaschema and support files for all OSCAL versions.update_support.py: Interacts with the NIST OSCAL repository to acquire official OSCAL support files for published OSCAL versions.
See Support Module for more informaiton.