streamsx.topology.schema module

class streamsx.topology.schema.CommonSchema

Bases: enum.Enum

Common stream schemas for interoperability within Streams applications.

Streams application can publish streams that are subscribed to by other applications. Use of common schemas allow streams connections regardless of the implementation

Python applications publish streams using publish() and subscribe using subscribe().

  • Python - Stream constains Python objects
  • Json - Stream contains JSON objects.
  • String - Stream contains strings.
  • Binary - Stream contains binary tuples.
Binary = <CommonSchema.Binary: <streamsx.topology.schema.StreamSchema object at 0x7f5bc3b13898>>

Stream where each tuple is a binary object (sequence of bytes).

Warning

Binary is not yet supported for Python applications.

Json = <CommonSchema.Json: <streamsx.topology.schema.StreamSchema object at 0x7f5bc3b13828>>

Stream where each tuple is a JSON object.

Json can be used as a natural interchange format between Streams applications implemented in different programming languages. All languages supported by Streams support publishing and subscribing to JSON streams.

Python objects are converted to JSON objects using json.dumps(obj).

Python = <CommonSchema.Python: <streamsx.topology.schema.StreamSchema object at 0x7f5bc3b137f0>>

Stream where each tuple is a Python object.

Python streams can only be used by Python applications.

String = <CommonSchema.String: <streamsx.topology.schema.StreamSchema object at 0x7f5bc3b13860>>

Stream where each tuple is a string.

String can be used as a natural interchange format between Streams applications implemented in different programming languages. All languages supported by Streams support publishing and subscribing to string streams.

Python objects are converted to strings using str(obj).

extend(schema)
schema()
spl_json()
str()
class streamsx.topology.schema.StreamSchema(schema)

Bases: object

SPL stream schema.

extend(schema)

Extend a schema by another

schema()
spl_json()
str()