tributary.streaming.input package

Submodules

class tributary.streaming.input.file.File(filename, json=True)[source]

Bases: tributary.streaming.input.input.Foo

Open up a file and yield back lines in the file

Parameters:
  • filename (str) – filename to read
  • json (bool) – load file line as json
class tributary.streaming.input.http.HTTP(url, interval=1, repeat=1, json=False, wrap=False, field=None, proxies=None, cookies=None)[source]

Bases: tributary.streaming.input.input.Foo

Connect to url and yield results

Parameters:
  • url (str) – url to connect to
  • interval (int) – interval to re-query
  • repeat (int) – number of times to request
  • json (bool) – load http content data as json
  • wrap (bool) – wrap result in a list
  • field (str) – field to index result by
  • proxies (list) – list of URL proxies to pass to requests.get
  • cookies (list) – list of cookies to pass to requests.get
class tributary.streaming.input.input.Console(message='', json=False, **kwargs)[source]

Bases: tributary.streaming.input.input.Foo

Yield a random dictionary of data

Parameters:
  • message (str) –
  • json (bool) –
class tributary.streaming.input.input.Const(value, count=0, **kwargs)[source]

Bases: tributary.streaming.input.input.Timer

Streaming wrapper to return a scalar value

Parameters:
  • value (any) – value to return
  • count (int) – number of times to call, 0 means infinite
class tributary.streaming.input.input.Curve(value, **kwargs)[source]

Bases: tributary.streaming.input.input.Timer

Streaming wrapper to output a series of values

Parameters:value (any) – value to unroll and return
class tributary.streaming.input.input.Foo(foo, foo_kwargs=None, count=0, interval=0, **kwargs)[source]

Bases: tributary.streaming.input.input.Timer

Streaming wrapper to periodically call a function count times
with a delay of interval in between
Parameters:
  • foo (callable) – callable to call
  • foo_kwargs (dict) – kwargs for callable
  • count (int) – number of times to call, 0 means infinite (or until generator is complete)
  • interval (int/float) – minimum delay between calls (can be more due to async scheduling)
class tributary.streaming.input.input.Random(count=10, interval=0.1, **kwargs)[source]

Bases: tributary.streaming.input.input.Foo

Yield a random dictionary of data

Parameters:
  • count (int) – number of elements to yield
  • interval (float) – interval to wait between yields
class tributary.streaming.input.input.Timer(foo, foo_kwargs=None, count=1, interval=0, **kwargs)[source]

Bases: tributary.streaming.node.Node

Streaming wrapper to periodically call a callable count times
with a delay of interval in between
Parameters:
  • foo (callable) – callable to call
  • foo_kwargs (dict) – kwargs for callable
  • count (int) – number of times to call, 0 means infinite (or until generator is complete)
  • interval (int/float) – minimum delay between calls (can be more due to async scheduling)
class tributary.streaming.input.kafka.Kafka(servers, group, topics, json=False, wrap=False, interval=1, **consumer_kwargs)[source]

Bases: tributary.streaming.input.input.Foo

Connect to kafka server and yield back results

Parameters:
  • servers (list) – kafka bootstrap servers
  • group (str) – kafka group id
  • topics (list) – list of kafka topics to connect to
  • json (bool) – load input data as json
  • wrap (bool) – wrap result in a list
  • interval (int) – kafka poll interval
class tributary.streaming.input.postgres.Postgres(user, password, database, host, queries, repeat=1, interval=1)[source]

Bases: tributary.streaming.input.input.Foo

Connects to Postgres and yields result of query

Parameters:
  • user (str) – postgres user
  • password (str) – postgres password
  • database (str) – postgres database
  • host (str) – postgres host
  • queries (str) – list of queries to execute
  • interval (int) – seconds to wait before executing queries
  • repeat (int) – times to repeat
class tributary.streaming.input.socketio.SocketIO(url, channel='', field='', sendinit=None, json=False, wrap=False, interval=1)[source]

Bases: tributary.streaming.input.input.Foo

Connect to socketIO server and yield back results

Parameters:
  • url (str) – url to connect to
  • channel (str) – socketio channel to connect through
  • field (str) – field to index result by
  • sendinit (list) – data to send on socketio connection open
  • json (bool) – load websocket data as json
  • wrap (bool) – wrap result in a list
  • interval (int) – socketio wai interval
class tributary.streaming.input.ws.WebSocket(url, json=False, wrap=False)[source]

Bases: tributary.streaming.input.input.Foo

Connect to websocket and yield back results

Parameters:
  • url (str) – websocket url to connect to
  • json (bool) – load websocket data as json
  • wrap (bool) – wrap result in a list