Skip to main content

Loafer

PyPI latest PyPI Version PyPI License Docs

CI Build Status Coverage Status Requirements Status Scrutinizer Code Quality Code Climate


Loafer is an asynchronous message dispatcher for concurrent tasks processing.

Currently, only AWS SQS is supported

Features:

  • Encourages decoupling from message providers and consumers

  • Easy to extend and customize

  • Easy error handling, including integration with sentry

  • Easy to create one or multiple services

  • Generic Handlers

  • Amazon SQS integration

It requires Python 3.6+ and is very experimental at the moment, expect a lot of changes until the first major version.

Example

A simple message forwader, from source-queue to destination-queue:

from loafer.ext.aws.handlers import SQSHandler
from loafer.ext.aws.routes import SQSRoute
from loafer.managers import LoaferManager


routes = [
    SQSRoute('source-queue', handler=SQSHandler('destination-queue')),
]


if __name__ == '__main__':
    manager = LoaferManager(routes)
    manager.run()

Documentation

Check out the latest Loafer full documentation at Read the Docs website.

Changelog:

2.0.1 (2020-07-28)

  • Fix setry integration (# by @hartungstenio)

  • Minor improvements

2.0.0 (2020-05-16)

  • Dropped support for Python 3.5

  • Added support for Python 3.8

  • Update aiobotocore dependency version (#61 by @GuilhermeVBeira)

  • Improvements due to changes in asyncio (#48, #52 by @lamenezes)

  • Sentry wrapper/helper updated to support new sdk (wip)

  • Minor documentation improvements

1.3.2 (2019-04-27)

  • Improve message processing (#48 by @lamenezes)

  • Improve error logging (#39 by @wiliamsouza)

  • Refactor in message dispatcher and event-loop shutdown

  • Minor fixes and improvements

1.3.1 (2017-10-22)

  • Improve performance (#35 by @allisson)

  • Fix requirement versions resolution

  • Minor fixes and improvements

1.3.0 (2017-09-26)

  • Refactor tasks dispatching, it should improve performance

  • Refactor SQSProvider to ignore HTTP 404 errors when deleting messages

  • Minor fixes and improvements

1.2.1 (2017-09-11)

  • Bump boto3 version (by @daneoshiga)

1.2.0 (2017-08-15)

  • Enable provider parameters (boto client options)

1.1.1 (2017-06-14)

  • Bugfix: fix SNS prefix value in use for topic name wildcard (by @lamenezes)

1.1.0 (2017-05-01)

  • Added initial contracsts for class-based handlers

  • Added generic handlers: SQSHandler/SNSHander

  • Improve internal error handling

  • Improve docs

1.0.2 (2017-04-13)

  • Fix sentry error handler integration

1.0.1 (2017-04-09)

  • Add tox and execute tests for py36

  • Update aiohttp/aiobotocore versions

  • Minor fixes and enhancements

1.0.0 (2017-03-27)

  • Major code rewrite

  • Remove CLI

  • Add better support for error handlers, including sentry/raven

  • Refactor exceptions

  • Add message metadata information

  • Update message lifecycle with handler/error handler return value

  • Enable execution of one service iteration (by default, it still runs “forever”)

0.0.3 (2016-04-24)

  • Improve documentation

  • Improve package metadata and dependencies

  • Add loafer.aws.message_translator.SNSMessageTranslator class

  • Fix ImportError exceptions for configuration that uses loafer.utils.import_callable

0.0.2 (2016-04-18)

  • Fix build hardcoding tests dependencies

0.0.1 (2016-04-18)

  • Initial release

Metadata

Release files for loafer 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loafer 2.0.1
File Size Uploaded Provenance Actions
loafer-2.0.1.tar.gz 13.1 kB Without provenance Details for loafer-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for loafer 2.0.1
File Interpreter ABI Platform Actions
loafer-2.0.1-py3-none-any.whl Python 3 none any Details for loafer-2.0.1-py3-none-any.whl

Total release size: 27.1 kB

Release files / loafer-2.0.1.tar.gz

Download URL loafer-2.0.1.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
41162e68c24d926f9fe9b6dd914eb3e708712282983320d6d1a6f3de5193f65e
BLAKE2b-256 checksum
How to use checksums
a5d168e08d5ce09b3763af09a5478bffcffc5fae27be053d17761c76dd848c45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Release files / loafer-2.0.1-py3-none-any.whl

Download URL loafer-2.0.1-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
717a2cbfe26a8636d2aee202ead761396ac08da89c538a27b729c890fca29e97
BLAKE2b-256 checksum
How to use checksums
fa669a8c854b8fc0faed451a7fcd13fa55c025452abd8c3a6079df96e1f42de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Security for loafer 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page