Python Client for interacting with ContentGrid Management Platform
Project description
ContentGrid Management Client
This ContentGrid Management Client is a Python library designed to interact with the ContentGrid Management API endpoints, specifically in the HAL response type. It provides a convenient interface for performing various operations such as fetching organizations, projects, and blueprints, and managing automations and automation annotations.
Features
- Organization Handling: Fetch organizations and their associated projects.
- Project Handling: Fetch projects and their associated blueprints.
- Blueprint Handling: Manage blueprints including entity definitions and automations.
- Automation Management: Create and manage automations and their annotations.
- Error Handling: Provides basic error handling for network requests.
Installation
To install the ContentGrid Management Client, you can use pip:
pip install contentgrid-management-client
Usage
Initialization and Organization Handling
from contentgrid_client import HALFormsClient
# Initialize a HALFormsClient with service account
client = HALFormsClient(
client_endpoint="https://api.contentgrid.com/",
auth_uri="https://auth.eu-west-1.contentgrid.cloud/realms/cg-eade54da-3903-4554-aa5e-2982cd4126f1/protocol/openid-connect/token",
client_id="your_client_id",
client_secret="your_client_secret"
)
# Initialize a HALFormsClient with a token
client = HALFormsClient(
client_endpoint="https://api.contentgrid.com/",
auth_uri="https://auth.eu-west-1.contentgrid.cloud/realms/cg-eade54da-3903-4554-aa5e-2982cd4126f1/protocol/openid-connect/token",
token="your_token"
)
# Get all organizations
organization = get_organizations(hal_client=client)[0]
Project Handling
# Get the first project
project = organization.get_projects()[0]
# Get blueprints of the project
blueprints = project.get_blueprints()
Blueprint Handling
# Get a specific blueprint
blueprint = project.get_blueprint_by_name("blueprint_name")
# Create a new entity definition in the blueprint
entity_definition = blueprint.create_entity("entity_name", "entity_description")
# Get entity definitions
entity_definitions = blueprint.get_entity_definitions()
Automation Management
# Get automations in a blueprint
automations = blueprint.get_automations()
# Create a new automation in the blueprint
automation_data = {
"foo" : "bar"
}
automation = blueprint.create_automation("automation_name", "system_name", automation_data)
# Create an annotation for an automation
annotation_data = {
"key": "value"
}
annotation = automation.create_annotation_on_entity("entity_name", annotation_data)
Testing
Installing Requirements
pip install -r requirements.txt
Running Tests
python -m pytest
Running Tests with Coverage
coverage run -m pytest && coverage report -m
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contentgrid_management_client-0.0.12.tar.gz.
File metadata
- Download URL: contentgrid_management_client-0.0.12.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
289b648ac8e61b29d4cb4af838214a7dd2767bc0a2c0c8642a32736cf89b411e
|
|
| MD5 |
9c0199ed7bb730d0a3ca28f7b55d67cc
|
|
| BLAKE2b-256 |
73ff9956f2559808a3daaad9bab9b0f0bfc526e3dec081cfeefbd726a9ad2cfa
|
Provenance
The following attestation bundles were made for contentgrid_management_client-0.0.12.tar.gz:
Publisher:
publish.yml on xenit-eu/contentgrid-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contentgrid_management_client-0.0.12.tar.gz -
Subject digest:
289b648ac8e61b29d4cb4af838214a7dd2767bc0a2c0c8642a32736cf89b411e - Sigstore transparency entry: 177890846
- Sigstore integration time:
-
Permalink:
xenit-eu/contentgrid-python-client@c446ec6a8c9218897e51ada2e8a06cf9a5ecaef8 -
Branch / Tag:
refs/tags/v0.0.12 - Owner: https://github.com/xenit-eu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c446ec6a8c9218897e51ada2e8a06cf9a5ecaef8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file contentgrid_management_client-0.0.12-py3-none-any.whl.
File metadata
- Download URL: contentgrid_management_client-0.0.12-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f791882e59facc50b916e6e4318c94167df887a576692d723c4b59ccb087c6f8
|
|
| MD5 |
5307b080d67a1e461a12b87acfa85fa1
|
|
| BLAKE2b-256 |
d20ba40e4681205a21caf3e2f10e1ba5aa13940bdf6828215a4bac385df0376e
|
Provenance
The following attestation bundles were made for contentgrid_management_client-0.0.12-py3-none-any.whl:
Publisher:
publish.yml on xenit-eu/contentgrid-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contentgrid_management_client-0.0.12-py3-none-any.whl -
Subject digest:
f791882e59facc50b916e6e4318c94167df887a576692d723c4b59ccb087c6f8 - Sigstore transparency entry: 177890850
- Sigstore integration time:
-
Permalink:
xenit-eu/contentgrid-python-client@c446ec6a8c9218897e51ada2e8a06cf9a5ecaef8 -
Branch / Tag:
refs/tags/v0.0.12 - Owner: https://github.com/xenit-eu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c446ec6a8c9218897e51ada2e8a06cf9a5ecaef8 -
Trigger Event:
release
-
Statement type: