This is a sample app that uses the Kentico Kontent Python SDK to retrieve content from Kentico Kontent. Plotly and Dash are used to generate a network graph of linked items in a Kontent project.
If you find a bug in the sample or have a feature request, please submit a GitHub issue.
We recommend running this sample application using virtual environment tooling such as virtualenv.
To run the application:
- Clone the app repository with your favorite GIT client
- Add your Kontent Project ID key to config.py in the project root - detailed instructions available below
- Install the project dependencies: pip install -r requirements.txt
- Run the application:
report.py
If you already have a Kentico Kontent account, you can connect this application to your version of the Sample project.
- In Kentico Kontent, choose Project settings from the app menu
- Under Development, choose API keys and copy the Project ID
- Open the
config.py
file - Use the values from your Kentico Kontent project as the
project_id
value - Save the changes
- Nodes can be moved by clicking and dragging.
- Move around the canvas by holding down left-mouse-click in blank space and moving your mouse.
- Hovering over an arrow (edge) between two nodes shows how they are related in the left-hand margin.
- Zooming in/out can be done with your mousewheel when your cursor is positioned over the graph.
- Clicking the "Reset" button will reset the zoom.
To leverage the Kontent Python SDK's Filtering:
- Open
network_builder.py
- Import the Kontent SDK's Filter
- Replace
response = client.get_content_items()
with your filtered query.
Example:
from kontent_delivery.builders.filter_builder import Filter
# returns all items of the "article" content type
response = client.get_content_items(
Filter("system.type", "[eq]", "article")
)
- Run the application with:
report.py
-
Konstellations uses Kentico Kontent's "items" endpoint, meaning it is limited to a 2000 item response. To change what items are returned, please see the Filtering section of this README.
-
The network graph only shows content items from linked items elements in the project. Components and inline content items within rich text editor elements are not included in the report.