Skip to main content

ds-event-stream-py-sdk

A Python package from the DS Event Stream Python SDK.

Installation

Install the package using pip:

pip install ds-event-stream-py-sdk

Or using uv (recommended):

uv pip install ds-event-stream-py-sdk

Quick Start

from ds_event_stream_py_sdk import __version__

print(f"ds-event-stream-py-sdk version: {__version__}")

Features

  • Kafka producer
  • Kafka consumer
  • Event stream model

Usage

import logging
from uuid import uuid4

from ds_common_logger_py_lib import Logger
from ds_event_stream_py_sdk.errors import ProducerError
from ds_event_stream_py_sdk.models.v1 import EventStream
from ds_event_stream_py_sdk.producer import KafkaProducer

Logger.configure(level=logging.DEBUG)
logger = Logger.get_logger(__name__)


producer = KafkaProducer(
    bootstrap_servers="b0.dev.kafka.ds.local:9095",
    sasl_username="ds.test.producer.v1",
    sasl_password="",
    timeout=5.0,
)

event = EventStream(
    session_id=uuid4(),
    tenant_id=uuid4(),
    event_type="example.event",
    event_source="examples",
    created_by="John Doe",
    payload={"hello": "world"},
)
producer.send_message(
    topic="ds.test.message.created.v1",
    message=event,
    key=str(event.session_id),
    timeout=5.0,
)

Requirements

  • Python 3.10 or higher
  • ds-common-logger-py-lib
  • ds-common-serde-py-lib
  • confluent-kafka

Documentation

Full documentation is available at:

Development

To contribute or set up a development environment:

# Clone the repository
git clone https://github.com/grasp-labs/ds-event-stream-py-sdk.git
cd ds-event-stream-py-sdk

# Install development dependencies
uv sync --all-extras --dev

# Run tests
make test

See the README for more information.

License

This package is licensed under the Apache License 2.0. See the LICENSE-APACHE file for details.

Support

Metadata

Release files for ds-event-stream-py-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ds-event-stream-py-sdk 0.1.0
File Size Uploaded Provenance Actions
ds_event_stream_py_sdk-0.1.0.tar.gz 15.4 kB Without provenance Details for ds_event_stream_py_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ds-event-stream-py-sdk 0.1.0
File Interpreter ABI Platform Actions
ds_event_stream_py_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for ds_event_stream_py_sdk-0.1.0-py3-none-any.whl

Total release size: 31.1 kB

Release files / ds_event_stream_py_sdk-0.1.0.tar.gz

Download URL ds_event_stream_py_sdk-0.1.0.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
761e5d6d8f4737de78096acb71517659aaff4594fd9ff128f7725a4f9ab37b68
BLAKE2b-256 checksum
How to use checksums
568a827accc13bfdf30ff7bd0075eceb64ce6c8dbd80c6c88c0e8fe439cfdd33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ds_event_stream_py_sdk-0.1.0-py3-none-any.whl

Download URL ds_event_stream_py_sdk-0.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ff34a6dc5951386894825e20b04732a712b3f6ae7781d993abeeb542500a06e
BLAKE2b-256 checksum
How to use checksums
cec5f927d1933b8955c41151f109063834b72ca4296ea2e77ab0bd0f268e7565
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ds-event-stream-py-sdk 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page