| Name | nvdutils JSON |
| Version |
3.5.0
JSON |
| download |
| home_page | None |
| Summary | A package for parsing, representing, and filtering NVD data. |
| upload_time | 2025-11-13 22:23:25 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.9 |
| license | None |
| keywords |
package
nvd
utils
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# nvdutils
A comprehensive Python package for parsing, representing, filtering, and analyzing National Vulnerability Database (NVD)
data. This library provides tools to work with CVE records, making it easier to process and extract insights from
vulnerability data.
## Features
- **Flexible Data Loading**: Load CVE data from JSON files with support for different loading strategies
- **Rich Data Models**: Comprehensive Pydantic models for representing CVE data including descriptions, configurations, weaknesses, metrics, and references
- **Filtering Capabilities**: Filter CVEs based on various criteria using profiles
- **Data Collection**: Utilities for downloading NVD data feeds
- **Progress Tracking**: Built-in progress bars and statistics for data loading operations
- **Extensible Architecture**: Easily extend the library with custom loaders, profiles, and strategies
## Installation
```bash
pip install nvdutils
```
## Setup
Before using the package, you need to set up the data directory and download the NVD data:
```bash
# Create data directory
mkdir ~/.nvdutils
cd ~/.nvdutils
# Clone the NVD JSON data feeds repository
git clone https://github.com/fkie-cad/nvd-json-data-feeds.git
```
## Usage Examples
### Basic Usage: Loading All CVE Data
```python
from pathlib import Path
from nvdutils.loaders.json.default import JSONDefaultLoader
# Create a loader
loader = JSONDefaultLoader()
# Eagerly load all the data
cve_dictionary = loader.load(Path("~/.nvdutils/nvd-json-data-feeds"), include_subdirectories=True)
# Access CVEs by ID
cve = cve_dictionary.get("CVE-2023-1234")
```
### Loading a Specific CVE by ID
```python
from pathlib import Path
from nvdutils.loaders.json.yearly import JSONYearlyLoader
# Create a loader
loader = JSONYearlyLoader()
data_path = Path("~/.nvdutils/nvd-json-data-feeds")
# Load a specific CVE by ID
cve = loader.load_by_id("CVE-2015-5334", data_path)
# Print the CVE details
print(cve)
```
### Filtering CVEs with Profiles
```python
from pathlib import Path
from nvdutils.loaders.json.default import JSONDefaultLoader
from nvdutils.data.profiles.zero_click import ZeroClickProfile
# Create a loader with a profile
loader = JSONDefaultLoader(profile=ZeroClickProfile, verbose=True)
# Load CVEs that match the profile
cve_dict = loader.load(Path("~/.nvdutils/nvd-json-data-feeds"), include_subdirectories=True)
print(f"Loaded {len(cve_dict)} CVEs")
```
### Creating Custom Profiles
```python
from dataclasses import dataclass, field
from nvdutils.data.profiles.base import BaseProfile
from nvdutils.data.criteria.weaknesses import CWECriteria, WeaknessesCriteria
from nvdutils.common.enums.weaknesses import WeaknessType
# Define criteria for CWE-787 weaknesses
cwe_787_criteria = WeaknessesCriteria(
cwe_criteria=CWECriteria(
cwe_id='CWE-787',
is_single=True
),
weakness_type=WeaknessType.Primary
)
# Create a custom profile
@dataclass
class CWE787Profile(BaseProfile):
"""Profile for selecting CVEs with CWE-787 as the primary weakness."""
weakness_criteria: WeaknessesCriteria = field(default_factory=lambda: cwe_787_criteria)
```
## Key Components
### Loaders
- **CVEDataLoader**: Base class for loading CVE data
- **JSONDefaultLoader**: Loader for JSON data with default strategy
- **JSONYearlyLoader**: Loader for JSON data organized by year
### Models
- **CVE**: Main model representing a CVE record
- **Descriptions**: Model for vulnerability descriptions
- **Configurations**: Model for affected configurations
- **Weaknesses**: Model for weakness types (CWEs)
- **Metrics**: Model for vulnerability metrics (CVSS)
- **References**: Model for external references
### Profiles and Criteria
- **BaseProfile**: Base class for filtering profiles
- **ZeroClickProfile**: Profile for zero-click vulnerabilities
- **Criteria Classes**: Various criteria for filtering CVEs
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the terms specified in the LICENSE file.
Raw data
{
"_id": null,
"home_page": null,
"name": "nvdutils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "package, nvd, utils",
"author": null,
"author_email": "Eduard Pinconschi <eduard.pinconschi@tecnico.ulisboa.pt>",
"download_url": "https://files.pythonhosted.org/packages/a2/0c/9d201445ed888473e8bcf4ef883aa1e9f52595345da5da5a2eae5ed7987e/nvdutils-3.5.0.tar.gz",
"platform": null,
"description": "# nvdutils\n\nA comprehensive Python package for parsing, representing, filtering, and analyzing National Vulnerability Database (NVD) \ndata. This library provides tools to work with CVE records, making it easier to process and extract insights from \nvulnerability data.\n\n## Features\n\n- **Flexible Data Loading**: Load CVE data from JSON files with support for different loading strategies\n- **Rich Data Models**: Comprehensive Pydantic models for representing CVE data including descriptions, configurations, weaknesses, metrics, and references\n- **Filtering Capabilities**: Filter CVEs based on various criteria using profiles\n- **Data Collection**: Utilities for downloading NVD data feeds\n- **Progress Tracking**: Built-in progress bars and statistics for data loading operations\n- **Extensible Architecture**: Easily extend the library with custom loaders, profiles, and strategies\n\n## Installation\n\n```bash\npip install nvdutils\n```\n\n## Setup\n\nBefore using the package, you need to set up the data directory and download the NVD data:\n\n```bash\n# Create data directory\nmkdir ~/.nvdutils\ncd ~/.nvdutils\n\n# Clone the NVD JSON data feeds repository\ngit clone https://github.com/fkie-cad/nvd-json-data-feeds.git\n```\n\n## Usage Examples\n\n### Basic Usage: Loading All CVE Data\n\n```python\nfrom pathlib import Path\nfrom nvdutils.loaders.json.default import JSONDefaultLoader\n\n# Create a loader\nloader = JSONDefaultLoader()\n\n# Eagerly load all the data\ncve_dictionary = loader.load(Path(\"~/.nvdutils/nvd-json-data-feeds\"), include_subdirectories=True)\n\n# Access CVEs by ID\ncve = cve_dictionary.get(\"CVE-2023-1234\")\n```\n\n### Loading a Specific CVE by ID\n\n```python\nfrom pathlib import Path\nfrom nvdutils.loaders.json.yearly import JSONYearlyLoader\n\n# Create a loader\nloader = JSONYearlyLoader()\ndata_path = Path(\"~/.nvdutils/nvd-json-data-feeds\")\n\n# Load a specific CVE by ID\ncve = loader.load_by_id(\"CVE-2015-5334\", data_path)\n\n# Print the CVE details\nprint(cve)\n```\n\n### Filtering CVEs with Profiles\n\n```python\nfrom pathlib import Path\nfrom nvdutils.loaders.json.default import JSONDefaultLoader\nfrom nvdutils.data.profiles.zero_click import ZeroClickProfile\n\n# Create a loader with a profile\nloader = JSONDefaultLoader(profile=ZeroClickProfile, verbose=True)\n\n# Load CVEs that match the profile\ncve_dict = loader.load(Path(\"~/.nvdutils/nvd-json-data-feeds\"), include_subdirectories=True)\n\nprint(f\"Loaded {len(cve_dict)} CVEs\")\n```\n\n### Creating Custom Profiles\n\n```python\nfrom dataclasses import dataclass, field\nfrom nvdutils.data.profiles.base import BaseProfile\nfrom nvdutils.data.criteria.weaknesses import CWECriteria, WeaknessesCriteria\nfrom nvdutils.common.enums.weaknesses import WeaknessType\n\n# Define criteria for CWE-787 weaknesses\ncwe_787_criteria = WeaknessesCriteria(\n cwe_criteria=CWECriteria(\n cwe_id='CWE-787',\n is_single=True\n ),\n weakness_type=WeaknessType.Primary\n)\n\n# Create a custom profile\n@dataclass\nclass CWE787Profile(BaseProfile):\n \"\"\"Profile for selecting CVEs with CWE-787 as the primary weakness.\"\"\"\n weakness_criteria: WeaknessesCriteria = field(default_factory=lambda: cwe_787_criteria)\n```\n\n## Key Components\n\n### Loaders\n\n- **CVEDataLoader**: Base class for loading CVE data\n- **JSONDefaultLoader**: Loader for JSON data with default strategy\n- **JSONYearlyLoader**: Loader for JSON data organized by year\n\n### Models\n\n- **CVE**: Main model representing a CVE record\n- **Descriptions**: Model for vulnerability descriptions\n- **Configurations**: Model for affected configurations\n- **Weaknesses**: Model for weakness types (CWEs)\n- **Metrics**: Model for vulnerability metrics (CVSS)\n- **References**: Model for external references\n\n### Profiles and Criteria\n\n- **BaseProfile**: Base class for filtering profiles\n- **ZeroClickProfile**: Profile for zero-click vulnerabilities\n- **Criteria Classes**: Various criteria for filtering CVEs\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the terms specified in the LICENSE file.\n",
"bugtrack_url": null,
"license": null,
"summary": "A package for parsing, representing, and filtering NVD data.",
"version": "3.5.0",
"project_urls": {
"homepage": "https://github.com/epicosy/nvdutils",
"repository": "https://github.com/epicosy/nvdutils"
},
"split_keywords": [
"package",
" nvd",
" utils"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4057244461a296af3e8a5f4d9a161ab8cbcef36dabcccc445ea3e77dbdbbf2f4",
"md5": "5c2c2507d5e42412e4a488f2905dddd8",
"sha256": "bdb20c4665e0848355710f9a22cf80607f68c45618391d7a91a3fd0c401b26e0"
},
"downloads": -1,
"filename": "nvdutils-3.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5c2c2507d5e42412e4a488f2905dddd8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 41828,
"upload_time": "2025-11-13T22:23:24",
"upload_time_iso_8601": "2025-11-13T22:23:24.787872Z",
"url": "https://files.pythonhosted.org/packages/40/57/244461a296af3e8a5f4d9a161ab8cbcef36dabcccc445ea3e77dbdbbf2f4/nvdutils-3.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a20c9d201445ed888473e8bcf4ef883aa1e9f52595345da5da5a2eae5ed7987e",
"md5": "b8820b111e7d8c8e200bedee711191d7",
"sha256": "af56924d0ac2810680d747a7c88c2625a859d783b02b4c9e6db03cdd22895af1"
},
"downloads": -1,
"filename": "nvdutils-3.5.0.tar.gz",
"has_sig": false,
"md5_digest": "b8820b111e7d8c8e200bedee711191d7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 28818,
"upload_time": "2025-11-13T22:23:25",
"upload_time_iso_8601": "2025-11-13T22:23:25.958354Z",
"url": "https://files.pythonhosted.org/packages/a2/0c/9d201445ed888473e8bcf4ef883aa1e9f52595345da5da5a2eae5ed7987e/nvdutils-3.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-11-13 22:23:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "epicosy",
"github_project": "nvdutils",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nvdutils"
}