Skip to main content

Cloud Services in Flask

Project description

Cloud Services

PIP package to provide cloud services.

Package installation

  • Installation
    $ pip3 install flask-cloud-services
    

Configuration

Define the following environment variables:

  • (str) Provider. Allowed: [aws, ]

      CLOUD_SERVICES_PROVIDER=
    

Aws Config

  • (str) Region. Example: 'us-west-2'

      CLOUD_SERVICES_AWS_REGION=
    
  • (str) Credentials: Access Key.

      CLOUD_SERVICES_AWS_ACCESS_KEY=
    
  • (str) Credentials: Secret Key.

      CLOUD_SERVICES_AWS_SECRET_KEY=
    

How to use

AWS Services

Notifications Channel

Subscribe and Listen Notifications

Define your route where you want listen the Notification Channel and you decorate it.

from flask import Blueprint
from flask_cloud_services import notifications_listener

routes_bus = Blueprint('routes_bus', __name__)

@routes_bus.route('/notification-channel', methods=['GET', 'POST', 'PUT'])
@notifications_listener
def aws_sns(data_listener):
    any_topic_arn = "arn:aws:sns:us-west-2:test:test"
    if data_listener.topic_arn == any_topic_arn:
        pass # DO SOMETHING
Publish Events

If you want publish an event to specific channel, you just must call the function publish send it topic_arn and message encoded.

from flask_cloud_services import notifications_publisher

result = notifications_publisher(
    topic_arn="arn:aws:sns:us-west-2:test:test",
    message="{\"data\": \"value\"}"
)

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

flask_cloud_services-0.0.6.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_cloud_services-0.0.6-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file flask_cloud_services-0.0.6.tar.gz.

File metadata

  • Download URL: flask_cloud_services-0.0.6.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

File hashes

Hashes for flask_cloud_services-0.0.6.tar.gz
Algorithm Hash digest
SHA256 26021e86ae00e3ad1017bc5954153e94052506d5f2cc31d29ca16246f39aafe0
MD5 dbf35667e5946f6dbf86b080a41f14c9
BLAKE2b-256 302a2389cdd4b00fba3ebdd637f2307dadf7abd01af8449bc62bcd0eacf9a9f0

See more details on using hashes here.

File details

Details for the file flask_cloud_services-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: flask_cloud_services-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9

File hashes

Hashes for flask_cloud_services-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 527b417ee6a3ecec42a6ae7152deeefad33c2ca31a569d6f00454c228e713f48
MD5 5eb51b7e75f53423ec3af5f68786e10c
BLAKE2b-256 04992630fe02b8da6c67083558835798d8819788dbd356ffd7bd072999954f9b

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