Skip to main content

Library python for simplify to create lambda function (AWS lambda) and Dazzl API service.

Project description

LIB Dazzl Lambda Tools | Build Status Requirements Status

Library python for simplify to create lambda function (AWS lambda) and Dazzl API service.

The authentication is automatically executed and use a environment variable.

How to use

# Import
import dazzl_aws_lambda_tools as aws_lambda

# Initialize
# It's a bucket event
dz = aws_lambda.Tools(record)

# Send a request to backend
path = '/super/path/with/id/and/another/data'
body = { 'foo' 'bar' }
dz.send('POST', path, body)

# Get name to bucket
dz.bucket_name()

# Get key to bucket
dz.bucket_key()

Logger and environments

The logger has different level :

  • development has level DEBUG,
  • staging has level INFO,
  • production has level ERROR

if you want customize log level use variable environment LOG_LEVEL

For more information see : Logging Levels

Variables environments

Name Value example Required
LOG_LEVEL info false
URL_API__<env> https://dazzl.tv true if you want send request
USERNAME_<env> roger@dazzl.tv true if you want send request
PASSWORD_<env> hidden_password true if you want send request

<env> is a environment type :

  • development : DEVE
  • staging : STAG
  • production : PROD

Convention bucket name

The bucket name exist for three environment :

Environment Example bucket name
development suffix.name.development
staging suffix.name.staging
production suffix.name

Script test

clear; python3 -m memory_profiler ./tests/requests.py ; python3 -m memory_profiler ./tests/simple.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dazzl_aws_lambda_tools-0.4.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file dazzl_aws_lambda_tools-0.4.tar.gz.

File metadata

  • Download URL: dazzl_aws_lambda_tools-0.4.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.5.6

File hashes

Hashes for dazzl_aws_lambda_tools-0.4.tar.gz
Algorithm Hash digest
SHA256 4fc6894e9a1b0381ef9b15755b74c6f82daddd34d60dbd2cebc691401cf7f55c
MD5 b57f1a5e66526b2296ee0d3b8f501682
BLAKE2b-256 2a334c49eb0916a2c84b750e8645827008d5e3d959baf4dbf34939ad2ca3c99f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page