Name | cpelib JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | A Python package for parsing, representing, and filtering the NVD CPE Dictionary. |
upload_time | 2024-12-18 18:05:00 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
package
nvd
cpe
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# cpelib
A Python package for parsing, representing, and filtering the NVD CPE Dictionary.
## Installation
```bash
pip install cpelib
```
## Setup
Before using the package, you need to download the NVD CPE Dictionary V2.3.
You can download the latest version from the NVD website: https://nvd.nist.gov/products/cpe
After downloading the file (e.g., `official-cpe-dictionary_v2.3.xml`), you can use the `cpelib` package to parse the
file.
By default, the package looks for the file in the `~/.cpelib` directory.
```bash
mkdir ~/.cpelib
mv official-cpe-dictionary_v2.3.xml ~/.cpelib
```
Or, you can programmatically change the path by providing the path to the file in the `CPEDictionaryLoader` class.
```python
from cpelib.core.loader import CPEDictionaryLoader
loader = CPEDictionaryLoader(xml_file="path/to/official-cpe-dictionary_v2.3.xml")
```
## Usage
> [NOTE] It will take around 2 minutes to parse the entire XML file which contains over 1,341,950 CPE items.
> Also, makes sure you have enough memory to load the entire dictionary (16GB should be safe).
Use class CPEDictionaryLoader to define and initialize the loader, then call the loader to parse the XML file.
The loader will return a dictionary with the cpe-item entries.
```python
from cpelib.core.loader import CPEDictionaryLoader
loader = CPEDictionaryLoader()
cpe_dict = loader()
```
Additionally, you can explore the examples in the `examples` directory and run them using the following command:
```bash
python3 -m examples.load_cpe_dict
```
Raw data
{
"_id": null,
"home_page": null,
"name": "cpelib",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "package, nvd, cpe",
"author": null,
"author_email": "Eduard Pinconschi <eduard.pinconschi@tecnico.ulisboa.pt>",
"download_url": "https://files.pythonhosted.org/packages/3f/45/750d22b4286e277e85eb5a97226f04b7bbf020b85caff078a7fa95e62d65/cpelib-0.0.2.tar.gz",
"platform": null,
"description": "# cpelib\nA Python package for parsing, representing, and filtering the NVD CPE Dictionary.\n\n\n## Installation\n```bash\npip install cpelib\n```\n\n## Setup\nBefore using the package, you need to download the NVD CPE Dictionary V2.3.\nYou can download the latest version from the NVD website: https://nvd.nist.gov/products/cpe\n\nAfter downloading the file (e.g., `official-cpe-dictionary_v2.3.xml`), you can use the `cpelib` package to parse the \nfile.\n\nBy default, the package looks for the file in the `~/.cpelib` directory.\n\n```bash\nmkdir ~/.cpelib\nmv official-cpe-dictionary_v2.3.xml ~/.cpelib\n```\n\nOr, you can programmatically change the path by providing the path to the file in the `CPEDictionaryLoader` class.\n\n```python\nfrom cpelib.core.loader import CPEDictionaryLoader\n\nloader = CPEDictionaryLoader(xml_file=\"path/to/official-cpe-dictionary_v2.3.xml\")\n```\n\n## Usage\n \n> [NOTE] It will take around 2 minutes to parse the entire XML file which contains over 1,341,950 CPE items.\n> Also, makes sure you have enough memory to load the entire dictionary (16GB should be safe).\n\nUse class CPEDictionaryLoader to define and initialize the loader, then call the loader to parse the XML file.\nThe loader will return a dictionary with the cpe-item entries.\n\n```python\nfrom cpelib.core.loader import CPEDictionaryLoader\n\nloader = CPEDictionaryLoader()\ncpe_dict = loader()\n```\n\nAdditionally, you can explore the examples in the `examples` directory and run them using the following command:\n\n```bash\npython3 -m examples.load_cpe_dict\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package for parsing, representing, and filtering the NVD CPE Dictionary.",
"version": "0.0.2",
"project_urls": {
"homepage": "https://github.com/epicosy/cpelib",
"repository": "https://github.com/epicosy/cpelib"
},
"split_keywords": [
"package",
" nvd",
" cpe"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "750f88ad51d8d4725440f6e2606ee26bdfd50f847e01e078a13b6680a5127511",
"md5": "e3e20fc2dd442984ea7604512d9b820e",
"sha256": "a0be8c25ffb9bc00f1345990d0da061182889af7ec17d8af26d7ec50266e29d4"
},
"downloads": -1,
"filename": "cpelib-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e3e20fc2dd442984ea7604512d9b820e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8994,
"upload_time": "2024-12-18T18:04:56",
"upload_time_iso_8601": "2024-12-18T18:04:56.666762Z",
"url": "https://files.pythonhosted.org/packages/75/0f/88ad51d8d4725440f6e2606ee26bdfd50f847e01e078a13b6680a5127511/cpelib-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3f45750d22b4286e277e85eb5a97226f04b7bbf020b85caff078a7fa95e62d65",
"md5": "a811c9a064056beb88b34a67e60e2e89",
"sha256": "2b51484c1fdb8b6c50a32bc061c3e7ed63233acc608c9f2979bc91b342dfc31b"
},
"downloads": -1,
"filename": "cpelib-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "a811c9a064056beb88b34a67e60e2e89",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 9565,
"upload_time": "2024-12-18T18:05:00",
"upload_time_iso_8601": "2024-12-18T18:05:00.317055Z",
"url": "https://files.pythonhosted.org/packages/3f/45/750d22b4286e277e85eb5a97226f04b7bbf020b85caff078a7fa95e62d65/cpelib-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 18:05:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "epicosy",
"github_project": "cpelib",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "cpelib"
}