standardtools | PyF, flow-based python programming standardtools

standardtools

package name: pyf.components.adapters.standardtools

“simple_filter” plugin

class pyf.components.adapters.standardtools.SimpleFilter(config_node, name)
Configuration available :
  • advanced(label: Advanced): Compound key (each sub key is an individual tag)
    • separate_process(label: Separate Process): boolean
  • name(label: Name): Simple key/value (text-based)

    unique name

  • expression(label: Filter expression): Simple key/value (text-based)

    filter to apply, ex: item.foo == ‘bar’

“compute_attributes” plugin

class pyf.components.adapters.standardtools.ComputeAttributes(config_node, name)
Configuration available :
  • advanced(label: Advanced): Compound key (each sub key is an individual tag)
    • separate_process(label: Separate Process): boolean
  • name(label: Name): Simple key/value (text-based)

    unique name

  • attributes(label: Attributes): Key with repeated attribute content
    Key contains repeated items “attribute”:
    • attribute(label: Attribute): Compound key (“getter” key is the text content of the node)
      • name(label: Attribute): input

        Target attribute

      • type(label: Type): select (default: “eval”)

      • getter(label: Value): input

        Value to apply. (ex. “base_item.test”)

“set_attributes” plugin

class pyf.components.adapters.standardtools.SetAttributes(config_node, name)
Configuration available :
  • advanced(label: Advanced): Compound key (each sub key is an individual tag)
    • separate_process(label: Separate Process): boolean
  • name(label: Name): Simple key/value (text-based)

    unique name

  • attributes(label: Attributes): Key with repeated attribute content
    Key contains repeated items “attribute”:
    • attribute(label: Attribute): Compound key (“value” key is the text content of the node)
      • name(label: Attribute): input

        Target attribute

      • value(label: Value): input

        Static value (ex. “foo”)

“sa_object_scrubber” plugin

class pyf.components.adapters.standardtools.SAObjectScrubber(config_node, name)
Configuration available :
  • advanced(label: Advanced): Compound key (each sub key is an individual tag)
    • separate_process(label: Separate Process): boolean
  • name(label: Name): Simple key/value (text-based)

    unique name

“packet_encoder” plugin

class pyf.components.adapters.standardtools.PacketEncoder(config_node, name)

This plugin will create packets based on objects entering it. You can set which attributes will be taken in the packet with

<attributes>
   <attribute>attribute1</attribute>
   <attribute>attribute2</attribute>
   <!-- ... -->
</attributes>
Configuration available :
  • advanced(label: Advanced): Compound key (each sub key is an individual tag)
    • separate_process(label: Separate Process): boolean
  • name(label: Name): Simple key/value (text-based)

    unique name

  • attributes(label: Attributes to insert): Key with repeated attribute content
    Key contains repeated items “attribute”:
    • attribute(label: Attribute): Simple key/value (text-based)
  • allow_missing_attributes(label: Allow missing attributes): Boolean Key (‘on’, ‘true’ and ‘yes’, case insensitive are True)

“packet_duplicator” plugin

class pyf.components.adapters.standardtools.PacketDuplicator(config_node, name)

This plugin will duplicate packets entering it the number of times specified. Moreover, you can set attribute override for specific iterations of the repeats.

For example, let’s say you want to duplicate an entering packet two times and changing the DebitCredit attribute on it on the second packet :

<node type="adapter" pluginname="packet_duplicator" name="repeater">
    <count>2</count>
    <overrides>
        <override iterations="2" attribute="DebitCredit">
            (base_item.DebitCredit == "D") and "C" or "D"
        </override>
    </overrides>
</node>
Please note two things:
  • the “iterations” attribute is a comma separated value, if you want to apply on 2, 3 and 5 just enter “2,3,5”. (it starts on 1, not 0) It is not mandatory : if you want the override applied on all iterations, just don’t specify it.
  • attribute_override are evals, you have access to base_item, item, Packet, decimal and datetime.
Configuration available :
  • advanced(label: Advanced): Compound key (each sub key is an individual tag)
    • separate_process(label: Separate Process): boolean
  • name(label: Name): Simple key/value (text-based)

    unique name

  • count(label: Count): Simple key/value (text-based)

  • overrides(label: Overrides): Key with repeated override content
    Key contains repeated items “override”:
    • override(label: Override): Compound key (“getter” key is the text content of the node)
      • attribute(label: Attribute): input

        Target attribute

      • iterations(label: Iterations): input

        Iterations to apply on. Ex: “1, 2”

      • getter(label: Value): input

        Value getter (ex. “base_item.foo”)

Other tools, used by plugins

class pyf.components.adapters.standardtools.adapter.DynamicObjectAdapter(former_object)