Install & Compatibility
Where this runs
tested against v4.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 42.8MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 4.3s · import 0.000s · 44MB
47MB installed
● package 47MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Event
✓ from pycadf import Event
✗ from pycadf import Event
This quickstart demonstrates how to create a basic CADF audit event by defining an initiator (user), a target (VM instance), and then constructing an Event object. The event is then serialized to a JSON string for auditing purposes.
import json
from pycadf.events import Event
from pycadf.resource import Resource
from pycadf.cadftype import CADF_VERSION_1_0_0
# Define initiator resource
initiator = Resource(
typeURI=CADF_VERSION_1_0_0 + 'security/account/user',
id='example-user-id',
name='example_auditor',
domainId='example-domain'
)
# Define target resource
target = Resource(
typeURI=CADF_VERSION_1_0_0 + 'compute/instance',
id='example-instance-id',
name='my_vm',
host=Resource(
typeURI=CADF_VERSION_1_0_0 + 'compute/host',
id='example-host-id',
name='compute-host-1'
)
)
# Create a CADF event
event = Event(
eventType='activity',
outcome='success',
action='create',
initiator=initiator,
target=target,
eventTime='2026-04-16T15:00:00.000Z', # ISO 8601 format
id='example-event-id'
)
# Serialize the event to a dictionary and print as JSON
print(json.dumps(event.as_dict(), indent=2))
Upgrade
Version history
4.0.1latest on PyPI · released Jan 29, 2025
Audit
Dependencies
oslo.configrequiredConfiguration management for OpenStack projects.
oslo.serializationrequiredSerialization utilities for OpenStack projects.
pbrrequiredPBR (Python Build Reasonableness) is an OpenStack project that provides a common build system.