| Name | csaf-validator JSON |
| Version |
1.0.0
JSON |
| download |
| home_page | |
| Summary | This program validates CSAF JSON documents against the CSAF 2.0 schema. |
| upload_time | |
| maintainer | |
| docs_url | None |
| author | Omar Santos |
| requires_python | |
| license | |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|

# CSAF Validator
A Python-based program used to validate a Common Security Advisory Framework (CSAF) JSON file against the CSAF 2.0 schema.
## Requirements
- Python 3
- `jsonschema` library
```
pip install -r requirements.txt
```
## Usage:
```
usage: csaf_validator.py [-h] json_file
Validates a CSAF JSON file against the CSAF 2.0 Schema
positional arguments:
json_file JSON file to be validated
optional arguments:
-h, --help show this help message and exit
```
Example:
```
$ python3 csaf_validator2.py cisco-sa-iox-8whGn5dL.json
cisco.json is valid against the CSAF 2.0 Schema.
```
## How the Script Works
The script performs the following steps:
- Downloads the CSAF 2.0 JSON Schema from the URL https://docs.oasis-open.org/csaf/csaf/v2.0/os/schemas/csaf_json_schema.json and saves it to a local file named csaf_json_schema.json.
- Loads the CSAF 2.0 JSON Schema from the local file.
- Loads the JSON file to be validated.
- Validates the JSON file against the CSAF 2.0 JSON Schema using the jsonschema library.
If the validation is successful, the script prints a message indicating that the JSON file is valid against the CSAF 2.0 Schema. If the validation fails, the script prints an error message indicating that the JSON file is invalid against the CSAF 2.0 Schema, along with the validation error.
## Additional Information
The `jsonschema` library is used to perform the JSON schema validation. JSON schema is a standard for describing the structure of JSON data, and the jsonschema library provides an implementation of this standard for Python.
The script uses the `argparse` library to allow the JSON file to be passed as a command-line argument. This makes it easy to use the script in a variety of contexts, such as from the command line, from within another script, or from a scheduling tool. The argparse library also provides automatic documentation of the command-line arguments, making the script easier to use for others who may not be familiar with it.
Raw data
{
"_id": null,
"home_page": "",
"name": "csaf-validator",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Omar Santos",
"author_email": "",
"download_url": "",
"platform": null,
"description": "\n\n# CSAF Validator\nA Python-based program used to validate a Common Security Advisory Framework (CSAF) JSON file against the CSAF 2.0 schema.\n\n## Requirements\n- Python 3\n- `jsonschema` library\n\n```\npip install -r requirements.txt\n```\n\n## Usage:\n\n```\nusage: csaf_validator.py [-h] json_file\n\nValidates a CSAF JSON file against the CSAF 2.0 Schema\n\npositional arguments:\n json_file JSON file to be validated\n\noptional arguments:\n -h, --help show this help message and exit\n ```\n \n Example:\n \n ```\n $ python3 csaf_validator2.py cisco-sa-iox-8whGn5dL.json\n cisco.json is valid against the CSAF 2.0 Schema.\n ```\n\n## How the Script Works\nThe script performs the following steps:\n\n- Downloads the CSAF 2.0 JSON Schema from the URL https://docs.oasis-open.org/csaf/csaf/v2.0/os/schemas/csaf_json_schema.json and saves it to a local file named csaf_json_schema.json.\n- Loads the CSAF 2.0 JSON Schema from the local file.\n- Loads the JSON file to be validated.\n- Validates the JSON file against the CSAF 2.0 JSON Schema using the jsonschema library.\n\nIf the validation is successful, the script prints a message indicating that the JSON file is valid against the CSAF 2.0 Schema. If the validation fails, the script prints an error message indicating that the JSON file is invalid against the CSAF 2.0 Schema, along with the validation error.\n\n## Additional Information\nThe `jsonschema` library is used to perform the JSON schema validation. JSON schema is a standard for describing the structure of JSON data, and the jsonschema library provides an implementation of this standard for Python.\n\nThe script uses the `argparse` library to allow the JSON file to be passed as a command-line argument. This makes it easy to use the script in a variety of contexts, such as from the command line, from within another script, or from a scheduling tool. The argparse library also provides automatic documentation of the command-line arguments, making the script easier to use for others who may not be familiar with it.",
"bugtrack_url": null,
"license": "",
"summary": "This program validates CSAF JSON documents against the CSAF 2.0 schema.",
"version": "1.0.0",
"split_keywords": [],
"urls": [],
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "csaf-validator"
}