pontos.nvd package#
Submodules#
- pontos.nvd.convert_camel_case(dct)#
Convert camel case keys into snake case keys
- Parameters:
dct (Dict[str, Any]) – dict to convert
- Returns:
A dict with key names converted to snake case
- Return type:
Dict[str, Any]
- pontos.nvd.format_date(date)#
Format date matching to NVD api
- Parameters:
date (datetime) – Date to format
- Returns:
Formatted date as string
- Return type:
str
- pontos.nvd.now()#
Return current datetime with UTC timezone applied
- Return type:
datetime
- class pontos.nvd.NVDApi(url, *, token=None, timeout=Timeout(timeout=180.0), rate_limit=True)#
Abstract base class for querying the NIST NVD API.
Should be used as an async context manager.
Create a new instance of the CVE API.
- Parameters:
url (str) – The API URL to use.
token (Optional[str]) – The API key to use. Using an API key allows to run more requests at the same time.
timeout (Optional[Timeout]) – Timeout settings for the HTTP requests
rate_limit (bool) – Set to False to ignore rate limits. The public rate limit (without an API key) is 5 requests in a rolling 30 second window. The rate limit with an API key is 50 requests in a rolling 30 second window. See https://nvd.nist.gov/developers/start-here#divRateLimits Default: True.