A Python library for the National Vulnerability Database (NVD) CPE/CVE API. Provides easy search and retrieval of CVEs, CPEs, and CPE match strings with support for pagination and generators. Current version 0.8.3, requires Python >=3.11.0. Maintained actively with monthly releases.
pip install nvdlibVerified import paths — ran on the pinned version, not inferred.
Basic usage to search for CVEs by keyword and print ID, score, and title.
Always pass a 'delay' parameter (e.g., delay=0.6) and consider using an API key via 'key' parameter.
Upgrade code to not depend on URL parameter presence for boolean flags; they are now handled internally.
Use timezone-aware datetime objects (e.g., from datetime import timezone, datetime; dt = datetime.now(timezone.utc)).
For reliable iteration, collect into list (list(searchCVE_V2(...))) or implement custom retry logic.
Use 'import nvdlib' then call nvdlib.searchCVE(...)
Provide a valid API key via the 'key' parameter or set NVD_API_KEY environment variable.
Check for None before accessing nested attributes (e.g., if cve.description: ...)