Skip to main content

Event SDK for creating Events in the helix architecture

Project description

helix.events.sdk

The helix.events.sdk package facilitates sending strongly typed events within the helix architecure. Currently one type of event, AuditEvent, is supported.

How to set up

  • make devsetup - to build the dev setup
  • make tests - to run all tests under /tests/ directory

Examples

  • The following code snippet shows how to instantiate and send and audit event:
# create the AuditEvent
event = AuditEvent(Source.BWELLBACKEND, Audit(patient_id="1",
                                              user_id="1",
                                              user_role="Patient",
                                              ip_address="192.168.1.1",
                                              action=AuditAction.READ,
                                              action_type=AuditActionType.VIEW,
                                              accessed_resource=ResourceType.DIAGNOSES))

kafka_brokers = [
    "kafkabroker1:9092",
    "kafkabroker1:9092"
]
with KafkaEventWriter(
    get_logger(), kafka_brokers=kafka_brokers, use_ssl=True
) as kafka_event_writer:
    kafka_event_writer.write_event(event=event)

The above code shows how to write an event to Kafka assuming the kafka cluster has two brokers and uses TLS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helix.events.sdk-0.1.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

helix.events.sdk-0.1.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file helix.events.sdk-0.1.1.tar.gz.

File metadata

  • Download URL: helix.events.sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for helix.events.sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 adae34fc948a03efb8df516d5e6bde8eed4fe84b6dfe9b2eb566fa1d884c5918
MD5 663b8b1a01662a9a8f3ae6cd573ac697
BLAKE2b-256 539ce1897c6616971821704ef947b0e3f3c84a8a88b1b56c7479b759fdec8459

See more details on using hashes here.

File details

Details for the file helix.events.sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for helix.events.sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db87745375761a019ebef9bec6ceb7ac44d5ab057edf33a336fbd48c00d8cdaf
MD5 e6b339c11295821dabc447fe30829f1c
BLAKE2b-256 b0960dc6d9eb60cb143292f71cd7db85c9c5b7cd1ecc7f69de8e4f07d6cb07ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page