Lambada Reference API Documentation

Lambada package entry point

class lambada.Dancer(function, name=None, description=u'', **kwargs)[source]

Bases: object

Simple function wrapping class to add context to the function (i.e. name, description, memory.)

Creates a dancer object to let us know something has been decorated and store the function as the callable.

Parameters:
  • function (callable) – Function to wrap.
  • name (str) – Name of function.
  • description (str) – Description of function.
  • kwargs – See OPTIONAL_CONFIG for options, if not specified in dancer, the Lambada objects configuration is used, and if that is unspecified, the defaults listed there are used.
config

A dictionary of configuration variables that can be merged in with the Lambada object

class lambada.Lambada(handler=u'lambda.tune', **kwargs)[source]

Bases: object

Lambada class for managing, discovery and calling the correct lambda dancers.

Setup the data structure of dancers and do some auto configuration for us with deploying to AWS using lambda_uploader. See OPTIONAL_CONFIG for arguments and defaults.

dancer(name=None, description=u'', **kwargs)[source]

Wrapper that adds a given function to the dancers dictionary to be called.

Parameters:
  • name (str) – Optional lambda function name (default uses the name of the function decorated.
  • description (str) – Description field in AWS of the function.
  • kwargs – Key/Value overrides of either defaults or Lambada class configuration values. See OPTIONAL_CONFIG for available options.
Returns:

Object with configuration and callable that is the function

being wrapped

Return type:

Dancer

Modules

lambada.cli module

Command line interface for running, packaging, and uploading commands to AWS.

lambada.cli.create_package(path, tune, requirements, destination='lambada.zip')[source]

Creates and returns the package using lambda_uploader.

lambada.common module

Common classes, functions, etc.

class lambada.common.LambadaConfig(path, config)[source]

Bases: lambda_uploader.config.Config

Small override to load config from dictionary instead of from a configuration file.

Takes config dictionary directly instead of retrieving it from a configuration file.

class lambada.common.LambdaContext(function_name, function_version=None, invoked_function_arn=None, memory_limit_in_mb=None, aws_request_id=None, log_group_name=None, log_stream_name=None, identity=None, client_context=None, timeout=None)[source]

Bases: object

Convenient class duplication of the one passed in by Amazon as defined at:

http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html

Setup all the attributes of the class.

get_remaining_time_in_millis()[source]

If we have a timeout return the amount of time left.

lambada.common.get_lambada_class(path)[source]

Given the path, find the lambada class label by dir() ing for that type.

Parameters:path (click.Path) – Path to folder or file
lambada.common.get_time_millis()[source]

Returns the current time in milliseconds since epoch.