Name | xsoar-dependency-graph JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | Creates and plots a dependency graph for XSOAR content packs. |
upload_time | 2025-08-18 10:19:58 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | MIT License
Copyright (c) 2025 Torbjørn Lium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
keywords |
graph
utilities
xsoar
|
VCS |
 |
bugtrack_url |
|
requirements |
networkx
matplotlib
numpy
scipy
pyyaml
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# XSOAR Dependency Graph
[](https://github.com/tlium/xsoar-dependency-graph/actions/workflows/python-package.yml)
XSOAR Dependency Graph is a Python utility to create a dependency graph of either an entire content repository
or a single content pack.
## Requirements
In order to create a dependency graph for you content, you need the content to be in [Content Packs Structure](https://xsoar.pan.dev/docs/packs/packs-format).
It is highly recommended to use a content repository similar to [content-ci-cd-template](https://github.com/demisto/content-ci-cd-template) as you probably want
to use [demisto-sdk](https://github.com/demisto/demisto-sdk) to interact with or create content at some point.
## Usage
### Installation
#### PyPI
- `pip install xsoar-dependency-graph`
#### Directly from GitHub
Bleeding edge versions can be installed using pip:
- `pip install git+https://github.com/tlium/xsoar-dependency-graph.git`
### Code examples
Please see [plot_all_packs.py](examples/plot_all_packs.py) or [plot_single_pack.py](examples/plot_single_pack.py) for detailed invocation and code examples.
These two examples uses mock data in the [tests/data/mock_content_repo](tests/data/mock_content_repo) directory, but it should be easy to use your own content repo instead.
## How is the content graph constructed
The content repository path given as a constructor argument is analyzed. For each content pack, the following items are evaluated (in order):
1. The Content Pack itself is added as a graph node
2. Playbooks are added as nodes. Playbooks are parsed and nodes and edges are added for any script or playbook reference found.
3. Layouts are added as nodes. Layouts are parsed and nodes and edges are added when they are found for e.g dynamic sections or buttons.
4. Incident Types are added as nodes. Layouts are parsed and nodes and edges are added for script or playbook references.
5. Integrations are added as nodes. The integrations are parsed and every command defined in the integration is added as graph nodes. Integration code as such is not yet parsed.
6. Scripts are added as nodes. If there is no path between Content Pack (1) and script then an edge is created from Content Pack node to script node. The scripts themselves are parsed as an Abstract Syntax Tree. When calls to `execute_command` or `demisto.executeCommand` are found, the scripts being called are added as graph nodesth an edge back to the calling script.
### I can create a content graph with demisto-sdk, so how does this differ?
I have a slightly different opinion on how the content graph should be constructed. One example is I don't want all content items in a content pack to have an edge back to the
content graph as such. I also want edges between scripts so that I can easily see exactly which other scripts a script is dependent upon and not only a dependency back to the content pack.
Furthermore, demisto-sdk will do all sorts of validation of content which I don't care about. If you have weird docker image definitions in your content that's your business.
I also prefer to plot my graphs with matplotlib initially. Unlike demisto-sdk, I don't care about visualizing the graphs in Neo4j. I would much rather export (this feature is not yet implemented) the finished graph to a format
Neo4j can read, so that people can decide for themselves how they would like the graphs to be used.
Raw data
{
"_id": null,
"home_page": null,
"name": "xsoar-dependency-graph",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "graph, utilities, xsoar",
"author": null,
"author_email": "Torbj\u00f8rn Lium <torben@lium.org>",
"download_url": "https://files.pythonhosted.org/packages/3f/87/5ea70a64161f1d4b6716e80e7074ed35b9a1f20473e2727c22e643b4e826/xsoar_dependency_graph-0.2.0.tar.gz",
"platform": null,
"description": "# XSOAR Dependency Graph\n[](https://github.com/tlium/xsoar-dependency-graph/actions/workflows/python-package.yml)\n\n\nXSOAR Dependency Graph is a Python utility to create a dependency graph of either an entire content repository\nor a single content pack.\n\n## Requirements\nIn order to create a dependency graph for you content, you need the content to be in [Content Packs Structure](https://xsoar.pan.dev/docs/packs/packs-format).\nIt is highly recommended to use a content repository similar to [content-ci-cd-template](https://github.com/demisto/content-ci-cd-template) as you probably want\nto use [demisto-sdk](https://github.com/demisto/demisto-sdk) to interact with or create content at some point.\n\n## Usage\n\n### Installation\n\n#### PyPI\n- `pip install xsoar-dependency-graph`\n\n#### Directly from GitHub\nBleeding edge versions can be installed using pip:\n- `pip install git+https://github.com/tlium/xsoar-dependency-graph.git`\n\n### Code examples\nPlease see [plot_all_packs.py](examples/plot_all_packs.py) or [plot_single_pack.py](examples/plot_single_pack.py) for detailed invocation and code examples.\nThese two examples uses mock data in the [tests/data/mock_content_repo](tests/data/mock_content_repo) directory, but it should be easy to use your own content repo instead.\n\n\n## How is the content graph constructed\nThe content repository path given as a constructor argument is analyzed. For each content pack, the following items are evaluated (in order):\n1. The Content Pack itself is added as a graph node\n2. Playbooks are added as nodes. Playbooks are parsed and nodes and edges are added for any script or playbook reference found.\n3. Layouts are added as nodes. Layouts are parsed and nodes and edges are added when they are found for e.g dynamic sections or buttons.\n4. Incident Types are added as nodes. Layouts are parsed and nodes and edges are added for script or playbook references.\n5. Integrations are added as nodes. The integrations are parsed and every command defined in the integration is added as graph nodes. Integration code as such is not yet parsed.\n6. Scripts are added as nodes. If there is no path between Content Pack (1) and script then an edge is created from Content Pack node to script node. The scripts themselves are parsed as an Abstract Syntax Tree. When calls to `execute_command` or `demisto.executeCommand` are found, the scripts being called are added as graph nodesth an edge back to the calling script.\n\n### I can create a content graph with demisto-sdk, so how does this differ?\nI have a slightly different opinion on how the content graph should be constructed. One example is I don't want all content items in a content pack to have an edge back to the\ncontent graph as such. I also want edges between scripts so that I can easily see exactly which other scripts a script is dependent upon and not only a dependency back to the content pack.\nFurthermore, demisto-sdk will do all sorts of validation of content which I don't care about. If you have weird docker image definitions in your content that's your business.\nI also prefer to plot my graphs with matplotlib initially. Unlike demisto-sdk, I don't care about visualizing the graphs in Neo4j. I would much rather export (this feature is not yet implemented) the finished graph to a format\nNeo4j can read, so that people can decide for themselves how they would like the graphs to be used.\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Torbj\u00f8rn Lium\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Creates and plots a dependency graph for XSOAR content packs.",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/tlium/xsoar-dependency-graph",
"Issues": "https://github.com/tlium/xsoar-dependency-graph/issues"
},
"split_keywords": [
"graph",
" utilities",
" xsoar"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "73a0a16cb80ca473c042c9daffcb97c97fb294366a82c6ff46f9c86e238c8c67",
"md5": "33edef6d3d906c49c8eaf72e213ecbe2",
"sha256": "785b4aaf1493954e802ef9a53da65072094629e8e52d36d304f0d8bf313ec7f1"
},
"downloads": -1,
"filename": "xsoar_dependency_graph-0.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "33edef6d3d906c49c8eaf72e213ecbe2",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 15285,
"upload_time": "2025-08-18T10:19:57",
"upload_time_iso_8601": "2025-08-18T10:19:57.676000Z",
"url": "https://files.pythonhosted.org/packages/73/a0/a16cb80ca473c042c9daffcb97c97fb294366a82c6ff46f9c86e238c8c67/xsoar_dependency_graph-0.2.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3f875ea70a64161f1d4b6716e80e7074ed35b9a1f20473e2727c22e643b4e826",
"md5": "f41c5c4c8e285fe0959e9e3c5ae09a19",
"sha256": "0840ec6f748b9222f139dceefa653a5649fc1d8745d3c0ea528fdb0ee30da7b6"
},
"downloads": -1,
"filename": "xsoar_dependency_graph-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "f41c5c4c8e285fe0959e9e3c5ae09a19",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 36531,
"upload_time": "2025-08-18T10:19:58",
"upload_time_iso_8601": "2025-08-18T10:19:58.685575Z",
"url": "https://files.pythonhosted.org/packages/3f/87/5ea70a64161f1d4b6716e80e7074ed35b9a1f20473e2727c22e643b4e826/xsoar_dependency_graph-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-18 10:19:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tlium",
"github_project": "xsoar-dependency-graph",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "networkx",
"specs": [
[
"==",
"3.4.2"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.10.0"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "scipy",
"specs": [
[
"==",
"1.15.1"
]
]
},
{
"name": "pyyaml",
"specs": [
[
"==",
"6.0.2"
]
]
}
],
"lcname": "xsoar-dependency-graph"
}