semvec/pypi-packages huggingface dataset:
slackevent-responder 0.1.0
ASGI adapter for Slack Events API
License: MIT
Requires Python: >=3.8,<4.0

# SlackEvent Responder

[![Test Status](https://github.com/haeena/slackevent-responder/workflows/Test/badge.svg)](https://github.com/haeena/slackevent-responder/actions)
[![codecov](https://codecov.io/gh/haeena/slackevent-responder/branch/master/graph/badge.svg)](https://codecov.io/gh/haeena/slackevent-responder)
[![GitHub license](https://img.shields.io/github/license/haeena/slackevent-responder)](https://github.com/haeena/slackevent-responder/blob/master/LICENSE)

## Introduction

The SlackEvents Responder is an ASGI adapter for [Slack’s Events API](https://api.slack.com/events-api) based on the [Starlette](https://www.starlette.io/) ASGI framework and works well with the [Responder](https://responder.readthedocs.io/en/latest/).

This library provides event subscription interface,
just like Flask based [Slack Events API adapter](https://github.com/slackapi/python-slack-events-api),
it would be easy to switch from it.

Oh, one more point, this library can handle both sync and async function for event callback :)

## Installation

```sh
pip install slackevent-responder
```

## Setup Slack App with Event Subscription

[Follow the official document](https://github.com/slackapi/python-slack-events-api/blob/master/README.rst#--development-workflow) :)

## Examples

### Hello world using responder

```python
import responder
from slackevent_responder import SlackEventApp

slack_events_app = SlackEventApp(
    path="/events", slack_signing_secret=SLACK_SIGNING_SECRET
)

@slack_events_app.on("reaction_added")
def reaction_added(event_data):
    event = event_data["event"]
    emoji = event["reaction"]
    print(emoji)

api = responder.API()
api.mount('/slack', slack_events_app)

api.run(port=3000)
```

More examples can be found [here](./example/).

## Change Logs

### v0.1.0 (2020-01-17)

- Initial Release ��
para 0.0.8
a set utilities that ake advantage of python's 'multiprocessing' module to distribute CPU-intensive tasks
License: MIT

# Para(llel) processing utilities
This library implements a simple set of parallel processing utilities that
take advantage of python's `multiprocessing` module to distribute processing
over multiple CPUs on a single machine.  The most salient feature of this
library is the **map()** function that can be used to distribute CPU-intensive
processing of a collection of items over multiple cores.

* **Installation** `pip install para`

## Basic usage

    >>> import para
    >>> import gzip
    >>>
    >>> items = ["examples/big-file1.gz", "examples/big-file2.gz",
    ...          "examples/big-file3.gz"]
    >>> def log_lines(path):
    ...     with gzip.open(path, 'rt') as f:
    ...         for lineno, line in enumerate(f):
    ...             if len(line) > 50:
    ...                 yield path, lineno, line
    ...
    >>> for path, lineno, line in para.map(log_lines, items):
    ...     print(path, lineno, repr(line))
    ...
    examples/big-file1.gz 2 'this line is going to be much longer than 80 chars -- at least I hope it will\n'
    examples/big-file3.gz 0 'again with the long lines -- this is going to show up in the output, I hope\n'

## Authors
* Aaron Halfaker -- https://github.com/halfak