Skip to main content

A Python client for interacting with the National Vulnerability Database (NVD) API to fetch CVE data.

Project description

NVD API Client

PyPI Daily Downloads Monthly Downloads Telegram-Channel

A Python client for interacting with the National Vulnerability Database (NVD) API to fetch CVE data.

Features

  • Fetch all CVEs with pagination
  • Fetch CVE by its ID
  • Fetch CVEs by publication or modification date
  • Fetch CVEs by CPE name
  • Other features coming soon...

Installation

You can install the package using pip:

pip install nvd_client

Usage

from nvd_client import NvdApi
from datetime import datetime, timedelta

# Initialize the API client
api_key = "your_api_key_here"
nvd_api = NvdApi(api_key)

# Fetch all CVEs
cves = nvd_api.get_all_cves(per_page=100, offset=0)
print(cves)

# Fetch a CVE by ID
cve = nvd_api.get_cve_by_id(cve_id="CVE-2024-30078")
print(cve)

# Fetch CVEs by publish or modify date range
cves_by_date = nvd_api.get_cve_by_date(
    per_page=100,
    offset=0,
    publish_start_date=datetime.now() - timedelta(days=2),
    publish_end_date=datetime.now()
)
print(cves_by_date)

# Fetch CVEs by CPE name
cves_by_cpe = nvd_api.get_cve_by_cpe(
    cpe_name="cpe:2.3:o:microsoft:windows_10:1607:*:*:*:*:*:*:*",
    per_page=100,
    offset=0
)
print(cves_by_cpe)

Author

License

This project is licensed under the MIT License. See the LICENSE file for details.

Explanation:

  1. Features: Lists the main functionalities provided by the module.
  2. Installation: Provides instructions for installing the package using pip from PyPI.
  3. Usage: Gives examples of how to initialize the client and use its methods.
  4. Author: Provides your name and a link to your Telegram channel.
  5. License: States that the project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nvd_client-0.1.3.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file nvd_client-0.1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nvd_client-0.1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50537a1bb4ea0e9544e6681cf5c5a8353ae0ba2a1cc906924adf36f19c486d59
MD5 24e6de07ea59ffa0a5bacf7e1e00d6cf
BLAKE2b-256 22f02fe7b8b6fa0a039c226f11a09e3354d95651fc86df6f6c312bb7d89c4b47

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page