slackhistory


Nameslackhistory JSON
Version 0.3.7 PyPI version JSON
download
home_pagehttps://github.com/AlexFangSW/slack_history
SummaryA slack helper library to get history (messages and replies) of a channel
upload_time2023-11-06 02:28:56
maintainer
docs_urlNone
authorAlexFangSW
requires_python>=3.11
licenseMIT
keywords slackhistory slack history slack helper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Slack History

A Slack helper library to get the history (messages and replies) of a channel


## Installation
```bash
pip install slackhistory
```

## Quick start
```python
import asyncio
from slackhistory import SlackHelper
from slackhistory.type.slack_types import SlackMessageAndReply
from os import environ


async def main():
    slack_helper = SlackHelper(token=environ.get("TOKEN", ""))

    # end_date is optional
    message_and_replies: SlackMessageAndReply = await slack_helper.get_message_and_replies(
        "alex-playground", start_date="2023-10-28 08:00:00", end_date="2023-11-4 22:00:00")

    # the result can be converted to dict or json
    print(message_and_replies.to_dict())
    print(message_and_replies.to_json())


if __name__ == "__main__":
    asyncio.run(main())
```
Example Result: [example_result.json](./examples/example_result.json)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AlexFangSW/slack_history",
    "name": "slackhistory",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "slackhistory,slack history,slack helper",
    "author": "AlexFangSW",
    "author_email": "alexfangsw@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/52/34/2797896c82de51c9e9594b9ed1f6f5713850c845b1255bd68a23034b4fb6/slackhistory-0.3.7.tar.gz",
    "platform": null,
    "description": "# Slack History\n\nA Slack helper library to get the history (messages and replies) of a channel\n\n\n## Installation\n```bash\npip install slackhistory\n```\n\n## Quick start\n```python\nimport asyncio\nfrom slackhistory import SlackHelper\nfrom slackhistory.type.slack_types import SlackMessageAndReply\nfrom os import environ\n\n\nasync def main():\n    slack_helper = SlackHelper(token=environ.get(\"TOKEN\", \"\"))\n\n    # end_date is optional\n    message_and_replies: SlackMessageAndReply = await slack_helper.get_message_and_replies(\n        \"alex-playground\", start_date=\"2023-10-28 08:00:00\", end_date=\"2023-11-4 22:00:00\")\n\n    # the result can be converted to dict or json\n    print(message_and_replies.to_dict())\n    print(message_and_replies.to_json())\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\nExample Result: [example_result.json](./examples/example_result.json)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A slack helper library to get history (messages and replies) of a channel",
    "version": "0.3.7",
    "project_urls": {
        "Homepage": "https://github.com/AlexFangSW/slack_history"
    },
    "split_keywords": [
        "slackhistory",
        "slack history",
        "slack helper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ce779392a85fc29b9ad2f4fd2d341cd1bd5fd0ce53f0e8350399f1351813368",
                "md5": "9210b90c83282bb0d5ac783fa49b9db6",
                "sha256": "276da0715fa196f11babe5af85aa33dcd5eb09116ee9de6fb13b748e11b6b33a"
            },
            "downloads": -1,
            "filename": "slackhistory-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9210b90c83282bb0d5ac783fa49b9db6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 7005,
            "upload_time": "2023-11-06T02:28:55",
            "upload_time_iso_8601": "2023-11-06T02:28:55.449168Z",
            "url": "https://files.pythonhosted.org/packages/5c/e7/79392a85fc29b9ad2f4fd2d341cd1bd5fd0ce53f0e8350399f1351813368/slackhistory-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "52342797896c82de51c9e9594b9ed1f6f5713850c845b1255bd68a23034b4fb6",
                "md5": "0b1a3f79ba8e383f564b4922e55f8e13",
                "sha256": "3295339bc1d122382c5528315afce60fe5a2aeaa074c53fad3f0bc88221c9d25"
            },
            "downloads": -1,
            "filename": "slackhistory-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "0b1a3f79ba8e383f564b4922e55f8e13",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 6306,
            "upload_time": "2023-11-06T02:28:56",
            "upload_time_iso_8601": "2023-11-06T02:28:56.902855Z",
            "url": "https://files.pythonhosted.org/packages/52/34/2797896c82de51c9e9594b9ed1f6f5713850c845b1255bd68a23034b4fb6/slackhistory-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-06 02:28:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AlexFangSW",
    "github_project": "slack_history",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "slackhistory"
}
        
Elapsed time: 0.36142s