Saravanan666/pypi-org huggingface dataset:
Package: slackpy
slackpyA Simple and Human FriendlySlackClient for Logging.Use CaseWeb ApplicationNEW!AWS LambdaBash ScriptInstallpipinstallslackpyDependenciesrequestsSample CodeimportslackpyINCOMING_WEB_HOOK='your_web_hook_url'CHANNEL='#general'USER_NAME='Logger'ICON_URL='http://lorempixel.com/48/48'# Create a new instance.logging=slackpy.SlackLogger(INCOMING_WEB_HOOK,CHANNEL,USER_NAME,ICON_URL)# You can set a log level. The default level is INFO.logging.set_log_level(slackpy.LogLv.DEBUG)# Or logging.set_log_level(10)## Minimum Parameter## logging = slackpy.SlackLogger(INCOMING_WEB_HOOK)# Simple Usagelogging.info('INFO Message')# LogLevel's only required parameter is "message", all others are optional.# LogLevel: DEBUGlogging.debug(message='DEBUG Message',title='DEBUG Title',fields='')# LogLevel: INFOlogging.info(message='INFO Message',title='INFO Title',fields='')# LogLevel: WARNlogging.warn(message='WARN Message',title='WARN Title',fields='')# LogLevel: ERRORlogging.error(message='ERROR Message',title='ERROR Title',fields='')# LogLevel: CUSTOMlogging.message(message='CUSTOM Message',title='CUSTOM Title',color='good',fields=[{"title":"CUSTOM","value":"test","short":True}],log_level=40)# Title Link (New v2.1.0)logging.info(message='INFO Message',title='slackpy Repository here',title_link='https://github.com/iktakahiro/slackpy')MethodLogLevelColordebug()DEBUG (10)#03A9F4 (Light Blue)info()INFO (20)good (green)warn()WARNING (30)warning (orange)error()ERROR (40)danger (red)The definition of the log level is based on the standard library.
(https://docs.python.org/3.4/library/logging.html#levels)Command lineexportSLACK_INCOMING_WEB_HOOK='your_web_hook_url'# LogLevel: DEBUGslackpy-c'#your_channel'-m'DEBUG Message'-l10# LogLevel: INFOslackpy-c'#your_channel'-m'INFO Message'-l20# LogLevel: WARNslackpy-c'#your_channel'-m'WARN Message'-l30# LogLevel: ERRORslackpy-c'#your_channel'-m'ERROR Message'-l40# LogLevel: DEBUG (without specifying #channel)slackpy-m'DEBUG Message'-l10# LogLevel: INFO (with Message Title)slackpy-c'#your_channel'-t'INFO Message Title'-m'INFO Message'-l20For AWS Lamdba# First, pip install to top of project directory.pipinstallslackpy-t.# Second, archive your source code and dependency packages.zip-rsrc.ziplambda_function.pyslackpyenumrequests# Finally, upload src.zipAbout Versioningslackpy is followingSemantic Versioning 2.0.0.
Package: slack-qna
Slack Q&AAn easy plug-and-use library for developing Slack BOT that serves a Q&A-like use case.For NodeJS version, please seehttps://github.com/lokwkin/slack-qna-nodeDescriptionHigh level flow:User messages this BOT via either:Direct MessageMention in ChannelSlack CommandThe BOT shows a loading reaction to the message.The BOT relays user's message to your custom handler, and expect for a result either inText,FileorImagetype.The BOT reply the user's message in Slack Thread.The BOT also shows a success reaction to the message.Note:This BOT uses Slack's Socket Mode instead of Webhook mode for slack connection, so it does not require an exposed public endpoint. But your services need to be long running.Sample use casesUse with ChatGPT (Text Response)LoadingReplyUse with Dall-E (Image Response)LoadingReplyUsageInstallpypi install slack-qnafromslack_qna.slack_qnaimportSlackQnafromslack_qna.schemaimportIncomingMessage,CommandHook,Reactionsslack_bot_token=os.getenv("SLACK_BOT_TOKEN")slack_app_token=os.getenv("SLACK_APP_TOKEN")bot_user_id=os.getenv("SLACK_BOT_USER_ID")slackQnaBot=SlackQna(slack_bot_token,slack_app_token,bot_user_id,Reactions(loading="loading",success="white_check_mark",failed="x"))defmy_handler(message:IncomingMessage):return"Hi there"slackQnaBot.register_handler(CommandHook(is_sync=True,data_type='text',handler=my_handler))slackQnaBot.listen(direct_message=True,mention=True)Slack SetupRegister an Slack App in portalhttps://api.slack.com/"Socket Mode" -> Enable Socket Mode"OAuth & Permissions" -> "Bot Token Scopes" -> Grant these permissions:app_mentions:read,channels:history,chat:write,im:history,im:write,reactions:write,groups:history,files:write"Event Subscription" -> "Enable Event" -> "Subscribe to bot events" -> Addmessage.imandapp_mention--> "save""App Home" -> "Message Tab" -> Enable "Allow users to send Slash commands and messages from the messages tab"Install bot to your workspaceObtain your Bot Token from "OAuth & Permissions" > "Bot User OAuth Token"Obtain your App Token from "Basic Information" > "App Level Token""Install App" -> Reinstall to workspace if neccessary
Package: slackreact
SlackreactSlackreact allows you to easily automatically respond to messages on Slack.
Seeexamples.pyfor examples! Regexes are a cinch; the limit is anything that you can do with code.All you have to do to set this up is supply a token for your Slack workspace. Under the hood, Slackreact uses a combination of the Events and RTM APIs. While it's running, it will listen in on any channel that the bot user is present in and selectively respond based on the rules you give it.Requires Python 3.6 because everything is async and spiffy and type-checked and because I like f-strings.
Package: slack-react
💬 slack-react 🚀Automate your Slack reactions! This Python project allows you to automatically
add emoji reactions to Slack messages. The emojis are generated based on a
user-provided message, with each character in the message converted to a
corresponding emoji.📚 Table of ContentsInstallationUsageExamplesLicense⚙️ Installationpipxinstallslack-react🛠 UsageBefore using this project, you need to get your Slack OAUTH token.Refer tothis guideto
create and install a Slack app to get your token.Once you have your token, set it as an environment variable.exportSLACK_OAUTH_USER_TOKEN=your-slack-tokenNow you're ready to use the project! You can run the script using the following
command:pythonslack_react.py"your message"-c"your-channel"Replace"your message"with the message you want to spell out with reactions.
Replace"your-channel"with the name of the channel where you want to add the
reactions.
The script will convert each character in the message to a corresponding emoji
and add these emojis as reactions to the most recent message in the
specified channel.📖 Examplespythonslack_react.py-c"general""hello"This command will spell out "hello" in emoji reactions in the "general" channel.📜 LicenseThis project is licensed under theGPL-3.0 License.
Package: slack-read-only-bot
Slack read-only botManage your Slack community by making read-only channels. Only admins can post to read-only
channels, other users' messages get deleted and the user gets a message from the bot.SetupCreate the BotCreate a new classic Slack app for your workspace athttps://api.slack.com/apps?new_classic_app=1.ClickApp Home, click theAdd Legacy Bot Userbutton, and give your bot a username and name.ClickOAuth & Permissions. UnderScopesclickAdd an OAuth Scopeand add the following
scopes:bot- Allow users to interact with the bot (needed to message users)chat:write:bot- Allow deleting user messagesOn the same page click on theInstall App to Workspacebutton and authorize it to connect to
your workspace. Note that the account that authorizes the botmustbe able to delete the
messages of other users. This is usually just the workspace owner/admin.Back on theOAuth & Permissionspage, copy the two access tokens (one should start withxoxp-and the other withxoxb-).Invite the bot to all the channels you want to make read-only.Run the botInstall the bot usingpip(pip install git+https://github.com/pR0Ps/slack-read-only-bot)Create a config file based on the following example:app_token: xoxp-...
bot_token: xoxb-...
delete_msg: The channel you just posted to is read-only, only admins can post to it.
admins:
  - admin1
  - admin2
channels:
  - channel1
  - channel2Runslack-read-only-bot --config <path to file>to run the bot and test that it works as expected.[optional] Configure your system to runslack-read-only-botas a service using something likesystemdto ensure that it runs at startup, restarts if it crashes, etc. Seeslack-read-only-bot.servicefor an example/template.CreditsBased onhttps://github.com/rokcarl/slack-read-only-bot
Package: slack-releaser
A simple utility that posts release changelogs to a configured Slack Webhook.UsageInstallslack-releaserfrom PyPI:pip install slack-releaserAdd the following to yoursetup.cfg:[zest.releaser]prereleaser.after=slack_releaser.releaser.post_to_slack[slack.releaser]webhook=https://example.slack.com/hook/abc123repository=https://github.com/example/repositoryReplacewebhookwith the webhook URL that Slack gives you when you setup a
webhook.See theSlack Documentationfor help in setting up webhooks.LicenseMIT License
Package: slack-report
= slack-reportReport the results of executing the specified command to Slack.== UseThe basic interface of `slack-report` is the same as `sudo`, `time`, `watch`, _etc._:slack-report COMMANDAny executable command, as well as its arguments, are accepted, and executed.For example:slack-report --channel=ops --title="uptime report" time annotate ./tps-reports.shThe above would execute `time` (most likely `/usr/bin/time`), passing it the arguments `annotate ./tps-reports.sh` (such that these would be executed as well). The resulting standard output and error would be uploaded to Slack, and shared in the "ops" channel, with the title: "uptime report."For the complete interface, consult `slack-report --help`.== Installation`slack-report` is available from https://pypi.org/project/slack-report/[PyPI] and https://github.com/dssg/slack-report[GitHub].To install via `pip`:pip install slack-report== ConfigurationIn addition to its command flags, `slack-report` may be configured via the shell/process environment.A Slack API token is *required*. This may be provided either via command flag `--token` or environment variable `SLACK_API_TOKEN`.The API token requires permission:* to post the results file: `files:write`* to look up requested channels by name: `channels.read`
Package: slack-request-permission
Slack Request PermissionInstallationCompatibilityPython Version > 3.5
Django Version > 2.0Install usingpipinstallslack-request-permissionIntroductionEvery slack app that needs to interact with any server needs to be verified (verify if the sender is actually slack).This package offers you:Out-of-the-boxDjangopermission class that can be used to authenticate slack requestsFramework for creating your own permission class for any slack appA standalone method to verify slack requestOut-of-the-boxTo use out of the box permission class, all you have to do is add the class into permission classes ofDjango Rest Framework.classRandomSlackRequestView(APIView):permission_classes=(IsSlackAppRequest,)In settings.pySLACK_APP_VERSION='v0'SLACK_APP_SIGNING_SECRET={YOUR_SLACK_APP_SIGNING_SECRET}The view will verify that the incoming request is from slack before running anything.FrameworkThere might come a use case where you have different slack apps with differentsigning_secretsinteracting with your
backend. In that case, you can create your own custom permission classfromslack_request_validator.abstract_permissionimportAbstractIsSlackAppRequestclassMySlackApp1Permission(AbstractIsSlackAppRequest):SLACK_APP_VERSION='v0'SLACK_APP_SIGNING_SECRET={MySlackApp1_SIGNING_SECRET}classMySlackApp2Permission(AbstractIsSlackAppRequest):SLACK_APP_VERSION='v0'SLACK_APP_SIGNING_SECRET={MySlackApp2_SIGNING_SECRET}These permissions can be then used inside any Django Rest Framework's ViewclassMySlackApp1View(APIView):permission_classes=(MySlackApp1Permission,)classMySlackApp2View(APIView):permission_classes=(MySlackApp2Permission,)Standalone-MethodThere might be cases when you don't want to use permission classes.
You can directly use the method that verifies slack requestThis methodreturnseitherTrueorFalseTrue# If slack request is correctFalse# If slack request is incorrectfromslack_request_validator.utilsimportverify_slack_requestslack_version='v0'slack_app_signing_secret={YOUR_SLACK_APP_SIGNING_SECRET}verify_slack_request(request=request,slack_app_version=slack_version,slack_app_signing_secret=slack_app_signing_secret)
Package: slack_responder
# slack_responder
Monitors all messages for regex patterns and returns a corresponding message.
I use this for turning ticket numbers into links.## Installation:pip3 install slack_responder## Configuration:See theexample.yamlconfiguration file. Sorry, that’s not a lot of help,
but docs are on my todo list below :)## Usage:Create yourself a bot user, paste the token given to you into your config
file (just copy the example.yaml), and run.` slack_responder ./responder.yaml `Seeconfig/upstart.conffor an example of running this as a service. Pay
particular attention to the environment variablesLC_ALLandLANGwhen
running under python 3.## TODO:DocsWay more teststravis test integration
Package: slackron
slackronslackronis a Python wrapper to notify about cronjob execution toSlack.DisclaimerThis software is currently alpha, and subject to change.Installationslackron is available onpypi.org.Configurationslackron will look for the following configuration file on your home directory:~/.slackron.ymlExample:webhook_url:https://hooks.slack.com/services/T00/B00/XXXXXXXXXXXXchannel:"#cron"username:Slackronemoji:robotUsage*/1****/usr/local/bin/slackron--wget-Sshttps://example.comMessages exampleSupportFile an Issue
Package: slack-rtm-bot
slack-rtm-botSlackRTMbot.Installationpip install slack-rtm-botUsageSLACK_RTM_BOT_API_TOKEN="foobar" slack-rtm-botTo use a different settings file, copysettings_local.pyto some/path/to/settings.py, and setSLACK_RTM_BOT_SETTINGS_FILE:SLACK_RTM_BOT_SETTINGS_FILE="/path/to/settings.py" slack-rtm-botLicenseMIT License
Package: slacks
Slacks aka SlackSayThis is a small CLI utility that can be used in scripts to send slack messages via Incoming Webhooks.See:https://cloud.docker.com/u/hicrondss/repository/docker/hicrondss/slacksUsageDockerPull tha latest image:dockerpullhicrondss/slacks:latestYou only need to pass your Incoming Webhook as environment variable. This will send a message to the channel configured in your Slack webhook:export MY_WEBHOOK_URL=https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYYYYYYYY
echo "*Hello, world!*" | docker run -e WEBHOOK_URL=${MY_WEBHOOK_URL} -i hicrondss/slacks:latestCLI Helpdockerrun-ihicrondss/slacks:latest-husage: slacks.py [-h] [-f [FILE]] [-m [MESSAGE]] [-b] [-t] [-p]

optional arguments:
  -h, --help            show this help message and exit
  -f [FILE], --file [FILE]
                        use contents of a FILE as text message
  -m [MESSAGE], --message [MESSAGE]
                        pass message as string
  -b, --block           Message will be a markdown block
  -t, --test            Use exapmle from example.py
  -p, --plaintext       Format with plaintext instead of markdown
Package: slack-secret
Slack SecretInstallation:pip install slack-secretDevelopementThese instructions assume that you’ve installed the following tools:PyenvPyenv-virtualenvPoetryPre-commitCreate a virtualenvpyenv virtualenv 3.8.1 slacksecretInstall pre-commitCheck the doc onOr:pip install pre-commit
pre-commit install
pre-commit run --all-filesGetting startedpyenv virtualenv 3.8.1 slacksecretUsing poetry 101Managing the environmentpoetry add <library-name>
poetry install: install all the libraries
peoetry update: update the dependecies
poetry version [major-minor-patch]Publishingpoetry publish –buildtype login and password
Package: slacksend
CLI tool to send messages to the Incoming webhook of Slack (https://slack.com).Helpusage: slacksend [-h] [-V] [-C CONFIG] [-c CHANNEL] [-U URL] [-u USERNAME]
                 [-i ICON]
                 [message]

Sends messages to slack's incoming webhooks via CLI

positional arguments:
  message               The message to send. If not specified it will be read
                        from STDIN

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -C CONFIG, --config CONFIG
                        Use a different configuration file
  -c CHANNEL, --channel CHANNEL
                        Send to this channel
  -U URL, --url URL     Slack webhook URL
  -u USERNAME, --username USERNAME
                        Username
  -i ICON, --icon ICON  IconConfiguration fileThe only required option to start sending messages to slack is the webhook url.
You can either set this in a configurations file (globally in/etc/slacksend.confor locally in$HOME/.slacksend.conf) or specify it on the CLI with the –url argument.This is an example of a configuration file for slacksend:[DEFAULT]
url = https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXX
icon = :ghost:
username = This is a bot
channel = @myselfExample usageecho "Hello world!" | slacksend -U https://hooks.slack.com/services/XXX
slacksend -U https://hooks.slack.com/services/XXX "Hello world!"LICENSECopyright (c) 2014 Massimiliano Torromeoslacksend is free software released under the terms of the BSD license.See the LICENSE file provided with the source distribution for full details.ContactsMassimiliano Torromeo <massimiliano.torromeo@gmail.com>
Package: slack-serverless
Utility library for serverless Slack appsThis is a (currently very simple) library that eases development of serverless Slack
app and bots.Currently, it targets Google Cloud Platform (but is easily generalised), and provides
a decorator and some utility functions that make Slack signature verification automatic
and help with building responses in a very lightweight fashion.I will grow it with things I end up needing in my work, but if you have different
needs and want to extend the library to support them, then PRs would be gratefully
received!MVP ExampleThis will accept any slash command you've configured for your bot, and just greet
the user who calls it, tagging them in the reply.fromslack_serverlessimportslack_slash_command_gcpfromslack_messagingimportslack_in_channel_text_response,slack_tags@slack_slash_command_gcp(slack_signing_key=YOUR_SIGNING_KEY)defcommand_handler(payload):returnslack_in_channel_text_response(f"Hi there <@{slack_tags([payload['user_id']])}>")Message DeferralIf you need to take more than three seconds to reply to a Slack message, the usual
thing to do in a serverless environment is hand off the message to another function,
and have the first one acknowledge receipt back to Slack within three seconds. This
is required - failing to respond in a timely fashion will result in the user seeing
an error message.This library provides a comfort wrapper around this use case - all you need to do is
set up a PubSub topic (or your cloud's equivalent, though only GCP is supported as yet)
and defer the message in your main Slack handler with theslack_deferfunction.You then have a second lambda, triggered by the pubsub (Eventarc or equivalent) in
which the main function is decorated with@slack_deferred_slash_handler_gcp(despite the name, it supports both events and slash commands - it'll be
changing soon) and handles the event.This will take care of wrapping and unwrapping the event appropriately and generally
trades of some ease of use for a little flexibility. If it doesn't meet your needs
you can of course just ignore it and code up the functionality yourself.Other Cloud ProvidersThings will be a bit more manual here (but I'll happily add comfort wrappers if
there's enough call and a PR that contributes them 😉).The easiest thing to do is use theslack_slash_commanddecorator, which
is similar to thegcpone above but needs you pass in a couple ofCallables
the code will use to get access to the data in a provider-specific way.Take a look at the code inslack_serverless.pyfor examples to get you started.DevelopingDon't forget to set uppre-commitif you're developing things, especially if you
plan to push a PR.Legal Mumbo-JumboCopyright (c)2023 Ross Bamford (and contributors)License: MIT (seeLICENSE.mdfor details).
Package: slack-signature-verifier
SLACK SIGNATURE VERIFIERUse- pass in post request from slack and your apps signing secret
- returns whether request is valid message from slackslack_request = {
    body: "example_body",
    headers: {
        "X-Slack-Signature": "signature_from_slack"
        "X-Slack-Request-Timestamp": "EPOCH_TIMESTAMP"
    }
 }

 is_valid_request = verify_slack_signature(slack_request, os.envrion["SLACK_SIGNING_SECRET"])
Package: slacksound
Create playlists democratically by reactions in Slack!! THIS IS STILL A BETA !!Documentation:https://slacksound.readthedocs.org/en/latestFeaturesGet Youtube videos reactions from message attachments and add the song to a Spotify playlist.How does it workThe application acts as a middle man between Slack and Spotify by getting the
reactions count from a message’s attachment and then looking up the title on
Spotify’s. If the title has been found, it will add the one that has best
popularity to the queue.In order to the bot pick up the song, a user must paste a Youtube URL in the
channel. The bot will start looking for reactions on that URL and get the title
of the video which it will be used as a search text for Spotify.A message will be shown back to the channel whether the bot could add the song
to the playlist or not.It is worth mention that the tracks of the playlist will be removed at every
time the bot it is started. This is by design as it in a jukebox.History0.0.1 (2017-10-13)First releaseMethods for Spotify APISlackclient wrapper0.0.2 (2017-10-14)CLI draftCredentials parsingMinimal logic0.0.3 (2017-10-14)Reaction name and reaction count configurable0.0.4 (2017-10-26)Refactored SpotifyClient with objects and methodsRefactored SlackSound interface0.0.5 (2017-10-27)Entrypoint for main0.1.0 (2017-10-27)Try a private channel first or fallback as a public one if fails0.1.1 (2017-10-27)Logging for user0.1.2 (2017-10-27)Fix local variable referenced before assignment
Package: slackstyler
slackstylerslackstyleris a Python package that converts Markdown text into Slack message formatting. The motivation for creating this package is to allow Python developers to prepare and send richly-formatted messages to Slack in a way that's familiar and easy to use.slackstylerwas inspired by JavaScript'sslackify-markdownlibrary and also based onmistune, a markdown parser in pure Python.FeaturesConverts Markdown text into Slack message formatting.Supports various Markdown syntaxes:Bold textItalic textLinkand more...InstallationInstallslackstylerwith pip:pipinstallslackstylerUsageHere is a quick example of how to useslackstyler:fromslackstylerimportSlackStyler# Create a styler instancestyler=SlackStyler()# Convert markdown text to slack message textmarkdown_text="Hello, **Slack**!"slack_message=styler.convert(markdown_text)print(slack_message)When you run this code, you will see:Hello, *Slack*!AcknowledgmentsThis project was inspired byslackify-markdown, a similar library written in JavaScript.Licenseslackstyleris licensed under theMIT License.