hyperstream package¶
Subpackages¶
- hyperstream.channels package
- Submodules
- hyperstream.channels.assets_channel module
- hyperstream.channels.assets_channel2 module
- hyperstream.channels.base_channel module
- hyperstream.channels.database_channel module
- hyperstream.channels.file_channel module
- hyperstream.channels.memory_channel module
- hyperstream.channels.module_channel module
- hyperstream.channels.tool_channel module
- Module contents
- hyperstream.itertools2 package
- hyperstream.models package
- hyperstream.stream package
- hyperstream.tool package
- hyperstream.utils package
- hyperstream.workflow package
Submodules¶
hyperstream.channel_manager module¶
Channel manager module. Defines the ChannelManager - a container for channels, that can load in plugins
-
class
hyperstream.channel_manager.ChannelManager(plugins, **kwargs)[source]¶ Bases:
dict,hyperstream.utils.utils.PrintableContainer for channels.
-
database_channels¶ The database channels as a list
-
get_channel(channel_id)[source]¶ Get the channel by id
Parameters: channel_id – The channel id Returns: The channel object
-
get_tool(name, parameters, version=None)[source]¶ Gets the tool object from the tool channel(s), and instantiates it using the tool parameters
Parameters: - name – The name or stream id for the tool in the tool channel
- parameters – The parameters for the tool
- version – The string representation of the version
Returns: The instantiated tool object
-
get_tool_class(tool)[source]¶ Gets the actual class which can then be instantiated with its parameters
Parameters: tool (str | unicode | StreamId) – The tool name or id Return type: Tool | MultiOutputTool Returns: The tool class
-
memory_channels¶ The memory channels as a list
-
tool_channels¶ The tool channels as a list
-
hyperstream.client module¶
The main hyperstream client connection that is used for storing runtime information. Note that this is also used by the default database channel, although other database channels (connecting to different database types) can also be used.
-
class
hyperstream.client.Client(server_config, auto_connect=True)[source]¶ Bases:
objectThe main mongo client
-
client= None¶
-
connect(server_config)[source]¶ Connect using the configuration given
Parameters: server_config – The server configuration
-
db= None¶
-
get_config_value(key, default=None)[source]¶ Get a specific value from the configuration
Parameters: - key – The of the item
- default – A default value if not found
Returns: The found value or the default
-
session= None¶
-
hyperstream.config module¶
HyperStream configuration module.
-
class
hyperstream.config.HyperStreamConfig[source]¶ Bases:
hyperstream.utils.utils.PrintableWrapper around the hyperstream configuration files (hyperstream_config.json and meta_data.json)
hyperstream.hyperstream module¶
Main HyperStream class
-
class
hyperstream.hyperstream.HyperStream(loglevel=10, file_logger=True, console_logger=True)[source]¶ Bases:
objectHyperStream class: can be instantiated simply with hyperstream = HyperStream() for default operation
-
create_workflow(workflow_id, name, owner, description, online=False)[source]¶ Create a new workflow. Simple wrapper for creating a workflow and adding it to the workflow manager.
Parameters: - workflow_id – The workflow id
- name – The workflow name
- owner – The owner/creator of the workflow
- description – A human readable description
- online – Whether this workflow should be executed by the online engine
Returns: The workflow
-
hyperstream.online_engine module¶
Online Engine module. This will be used in the online execution mode.
hyperstream.plugin_manager module¶
Plugin manager module for additional user added channels and tools.
-
class
hyperstream.plugin_manager.Plugin[source]¶ Bases:
hyperstream.plugin_manager.PluginBase,hyperstream.utils.utils.PrintablePlugin class - simple wrapper over namedtuple
hyperstream.time_interval module¶
Module for dealing with time intervals containing TimeInterval, TimeIntervals, and RelativeTimeInterval
-
class
hyperstream.time_interval.RelativeTimeInterval(start, end)[source]¶ Bases:
hyperstream.time_interval.TimeIntervalRelative time interval object. Thin wrapper around a (start, end) tuple of timedelta objects that provides some validation
-
end¶
-
start¶
-
-
class
hyperstream.time_interval.TimeInterval(start, end)[source]¶ Bases:
hyperstream.time_interval.TimeIntervalTime interval object. Thin wrapper around a (start, end) tuple of datetime objects that provides some validation
-
end¶
-
humanized¶
-
start¶
-
width¶
-
-
class
hyperstream.time_interval.TimeIntervals(intervals=None)[source]¶ Bases:
hyperstream.utils.utils.PrintableContainer class for time intervals, that manages splitting and joining Example object: (t1,t2] U (t3,t4] U ...
-
end¶
-
humanized¶
-
is_empty¶
-
span¶
-
start¶
-
-
hyperstream.time_interval.parse_time_tuple(start, end)[source]¶ - Parse a time tuple. These can be:
- relative in seconds, e.g. (-4, 0) relative in timedelta, e.g. (timedelta(seconds=-4), timedelta(0)) absolute in date/datetime, e.g. (datetime(2016, 4, 28, 20, 0, 0, 0, UTC), datetime(2016, 4, 28, 21, 0, 0, 0, UTC)) absolute in iso strings, e.g. (“2016-04-28T20:00:00.000Z”, “2016-04-28T20:01:00.000Z”) Mixtures of relative and absolute are not allowed
Parameters: - start (int | timedelta | datetime | str) – Start time
- end (int | timedelta | datetime | str) – End time
Returns: TimeInterval or RelativeTimeInterval object