{ "info": { "author": "David Wolever", "author_email": "david@wolever.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Topic :: Utilities" ], "description": "The Wayslack Machine\n====================\n\nThe Wayslack Machine: incrementally archive Slack teams and delete old files,\nusing Slack's \"archive\" export format.\n\nWayslack can also delete old files from Slack, freeing up storage space\nfor users on the free tier. See the ``delete_old_files`` option.\n\n\nGetting Started\n===============\n\n1. Install ``wayslack``::\n\n $ pip install wayslack\n\n2. (optional) Export your team history and unzip it: https://get.slack.help/hc/en-us/articles/201658943-Export-your-team-s-Slack-history\n\n3. Get a legacy token from: https://api.slack.com/custom-integrations/legacy-tokens\n\n4. Run ``wayslack path/to/export/directory`` to create an archive if one\n doesn't already exist, then download all messages and files::\n\n $ wayslack my-export/\n API token for my-export/ (see https://api.slack.com/custom-integrations/legacy-tokens): xoxp-1234-abcd\n Processing: my-export/\n Downloading https://.../image.jpg\n #general: 10 new messages in #general (saving to my-export/_channel-C049V24HY/2016-12-19.json)\n $ ls my-export/_files/\n ...\n https%3A%2F%2F...%2Fimage.jpg\n\n5. Optionally, create a configuration file so multiple teams can be archived easily::\n\n $ cat ~/.wayslack/config.yaml\n ---\n archives:\n - dir: path/to/slack/first-export # path is relative to this file\n # Get token from: https://api.slack.com/custom-integrations/legacy-tokens\n token: xoxp-1234-abcd\n # Delete files from Slack if they're more than 60 days old (useful for\n # free Slack channels which have a file limit).\n # Files will only be deleted from Slack if:\n # - They exist in the archive (_files/storage/...)\n # - wayslack is run with --confirm-delete\n # Otherwise a message will be printed but files will not be deleted.\n delete_old_files: 60 days\n - dir: second-export\n token: xoxp-9876-wxyz\n\n $ wayslack\n Processing: first-export\n ...\n Processing: second-export\n ...\n\nDeleting Old Files from Slack\n=============================\n\nThe ``delete_old_files`` option (along with the ``--confirm-delete`` flag) can\nbe used to delete old files from Slack, freeing up the team's storage.\n\nFiles will only be deleted if the ``--confirm-delete`` flag is used,\nthe files exist in the local archive, and their size matches the size reported\nin Slack's API.\n\n**Note**: due to a `bug in Slack's API`__, the file size reported by Slack's\nAPI is sometimes incorrect. Because Wayslack will not delete files when the\nlocal size does not match the remote size, a few warnings will almost always be\ngenerated when deleting files (and, obviously, those files won't be deleted).\n\n**Note 2**: Slack appears to compress JPEGs, so this check is not applied to\nJPEGs. For all downloaded files, though, the etag is used to verify that the\ndownload was not corrupt (even if it isn't identical to the file originally\nuploaded).\n\nFor example::\n\n $ wayslack --confirm-delete ~/.wayslack/your-archive/\n\n\n__ https://stackoverflow.com/q/44742164/71522\n\nExporting Slack Messages to SQL (PostgreSQL)\n============================================\n\nAlso included in this repository (although not in the installer yet) is\n``wayslack2sql.py``, which will export a Wayslack archive to a PostgreSQL\ndatabase::\n\n $ pip install sqlalchemy\n ...\n $ createdb wayslack\n $ ./wayslack2sql.py postgres://localhost/wayslack ~/.wayslack/your-team\n\n(note: ``wayslack2sql.py`` isn't especially polished yet)\n\nThe schema is straightforward and closely matches Slack's JSON format::\n\n -- Channels (public, private, and IMs)\n CREATE TABLE ws_channel (\n id VARCHAR(64) PRIMARY KEY NOT NULL, -- Slack channel ID\n kind VARCHAR(16), -- 'channel', 'im', or 'group'\n created TIMESTAMP WITHOUT TIME ZONE,\n creator VARCHAR(64), -- Slack creator ID\n members VARCHAR(64)[],\n name VARCHAR,\n purpose JSON,\n topic JSON,\n ..., -- See schema in wayslack2sql.py for all columns\n _original JSON,\n )\n\n -- Users\n CREATE TABLE ws_user (\n id VARCHAR(64) PRIMARY KEY NOT NULL,\n name VARCHAR,\n real_name VARCHAR,\n ..., -- See schema in wayslack2sql.py for all columns\n )\n\n -- Files\n CREATE TABLE ws_file (\n id VARCHAR(64) PRIMARY KEY NOT NULL,\n \"user\" VARCHAR(64), -- Slack ID\n title VARCHAR,\n name VARCHAR,\n size INTEGER, -- note: can be wrong sometimes\n mimetype VARCHAR,\n url_private VARCHAR,\n url_private_download VARCHAR,\n ..., -- See schema in wayslack2sql.py for all columns\n _wayslack_deleted BOOLEAN, -- If Wayslack has deleted this file from Slack\n _original JSON,\n )\n\n -- Messages\n CREATE TABLE ws_msg (\n id SERIAL PRIMARY KEY NOT NULL, -- autoincrement integer primary key\n ts TIMESTAMP WITHOUT TIME ZONE,\n \"user\" VARCHAR(64),\n type VARCHAR(16),\n subtype VARCHAR(32),\n text VARCHAR,\n reactions JSON,\n attachments JSON,\n ..., -- See schema in wayslack2sql.py for all columns\n _original JSON,\n )\n\nFor example, to see who sends the most messages, use::\n\n with mc as (\n select\n \"user\",\n sum(length(to_tsvector(text))) as word_count,\n count(*) as msg_count\n from ws_msg\n group by \"user\"\n ),\n report as (\n select\n name,\n word_count,\n msg_count,\n round((word_count / msg_count::numeric), 2) as words_per_msg\n from mc\n join ws_user as u on u.id = mc.\"user\"\n order by msg_count desc\n )\n select *\n from report\n\nReturns::\n\n wayslack=# ...;\n name | word_count | msg_count | words_per_msg\n ---------------+------------+-----------+---------------\n jane | 34432 | 7489 | 4.60\n wolever | 22871 | 4787 | 4.78\n alex | 19977 | 4346 | 4.60\n smith | 12090 | 2132 | 5.67\n luke | 10099 | 1852 | 5.45\n ...\n\nHint: `pg-histogram`__ is especially useful for visualizing these data.\n\n__ https://github.com/wolever/pg-histogram\n\nIMMATURITY WARNING\n==================\n\n**WARNING**: wayslack is still somewhat immature and not completely tested.\nRight now it will archive:\n\n* Public messages\n* Private groups\n* Private messages\n* All uploaded files\n* All link previews\n* List of channels\n* List of users\n* Files\n\nBut it will likely be very slow for larger (100+ user or channel) teams,\ndoesn't have any configuration options, and likely has bugs which will only be\nfound with time.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wolever/wayslack", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "wayslack", "package_url": "https://pypi.org/project/wayslack/", "platform": "", "project_url": "https://pypi.org/project/wayslack/", "project_urls": { "Homepage": "https://github.com/wolever/wayslack" }, "release_url": "https://pypi.org/project/wayslack/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "The Wayslack Machine: incrementally archive Slack messages and files using Slack's team export format", "version": "0.3.1" }, "last_serial": 4906786, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fba63789c02cd540d865dd99ea835cfa", "sha256": "0a9f197aea1583acdcaad827941754f52588b64db4cf8d347101c6509eff1130" }, "downloads": -1, "filename": "wayslack-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "fba63789c02cd540d865dd99ea835cfa", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17078, "upload_time": "2017-01-03T19:39:18", "url": "https://files.pythonhosted.org/packages/69/3e/cd288ee846e14e598086e4150017122af233ecfdfa8d5991f901c100d42c/wayslack-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de4502f9fbbbfa21f0d88f18dc15db21", "sha256": "19be15f0ae3263117f623fa299483b4b82575e36c999f3235053cc7e37251154" }, "downloads": -1, "filename": "wayslack-0.1.0.tar.gz", "has_sig": false, "md5_digest": "de4502f9fbbbfa21f0d88f18dc15db21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9553, "upload_time": "2017-01-03T19:39:16", "url": "https://files.pythonhosted.org/packages/81/88/6a383c268cd2c36667138ca312ad60147381eff2d059f209fc63e3decc65/wayslack-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1877a5f3fb27048884cc45a9d48b7fa1", "sha256": "450030ab2040ddcc272c38f604ddb770cbf7d7457ae18f816f666237371581ff" }, "downloads": -1, "filename": "wayslack-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "1877a5f3fb27048884cc45a9d48b7fa1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17186, "upload_time": "2017-01-03T20:17:01", "url": "https://files.pythonhosted.org/packages/ce/4a/8846af37928e7b6e3253e91fa38b8f9598d6c9639d033e97b606b1589eae/wayslack-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2c5779a4365db959c2148de3e14aafb", "sha256": "298bb5b386262dd94c886ef6c1b062a7098e98bc7e0382bfb8d2742e3862d4da" }, "downloads": -1, "filename": "wayslack-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c2c5779a4365db959c2148de3e14aafb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9623, "upload_time": "2017-01-03T20:17:00", "url": "https://files.pythonhosted.org/packages/61/27/a6dbf3f4e17ffcc11ee1a62b4eed535719c9138cd753c67c6b5c3a8914bf/wayslack-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "850c1f6559b5a62499fef9a3d1e66244", "sha256": "e0527c4f850deaf8d41facec0c5ac02c5fb00ef66ad254361d76191fe26c385f" }, "downloads": -1, "filename": "wayslack-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "850c1f6559b5a62499fef9a3d1e66244", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17298, "upload_time": "2017-01-04T22:41:00", "url": "https://files.pythonhosted.org/packages/fb/e0/db2c8820a0fa8088453167909f9418aff579ac558421911f1493ad4aa788/wayslack-0.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f88eddff6716fa73177fe556d48ba849", "sha256": "cf36e0ecaa6afe9e41453384a3712038686502adbe7b3f2bfb8b36bc082fe340" }, "downloads": -1, "filename": "wayslack-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f88eddff6716fa73177fe556d48ba849", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9761, "upload_time": "2017-01-04T22:40:59", "url": "https://files.pythonhosted.org/packages/e8/09/ed6c873c3743c686dd1111a6d8c5410930e7aceaed2999bd7c2852be74b9/wayslack-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "81bc49a81249dede2ecf1243b2323edf", "sha256": "3ae1093526e8a15fec58e215f72243f07101cae1bde8c0dedb2d2fdea604340f" }, "downloads": -1, "filename": "wayslack-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "81bc49a81249dede2ecf1243b2323edf", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17366, "upload_time": "2017-04-10T18:21:14", "url": "https://files.pythonhosted.org/packages/37/7d/43da3e7a1ce3b68414210bad11151b175157736b6bd2161f0f59c90875d1/wayslack-0.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6f91eebecd3b0bd87ba4d851b272e2ab", "sha256": "7b3e0a75d48a077c133ee4a84c723f0121d57754e0e10ed7346a4ac0f863cac0" }, "downloads": -1, "filename": "wayslack-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6f91eebecd3b0bd87ba4d851b272e2ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9776, "upload_time": "2017-04-10T18:21:11", "url": "https://files.pythonhosted.org/packages/d7/bc/e1fdd52d36accbd35a6f495bda8d750725b9040c89e59c940c1f135e8cf7/wayslack-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ef35122b3a53861233ab2d8e12398ca6", "sha256": "168a4f1d4ff601880fdaa68ae66ccbb71344d61b913d963c589b8e048ffb88bc" }, "downloads": -1, "filename": "wayslack-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ef35122b3a53861233ab2d8e12398ca6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20726, "upload_time": "2017-06-25T01:36:23", "url": "https://files.pythonhosted.org/packages/b2/3e/f853755cc34f18892f557d932805ecf97b7ca0d42c14228e8508cbb0b1cf/wayslack-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "050cf3760af847a59ccf3816194d1755", "sha256": "4f13d69bcc43cd8091475035e2c5484050021a49d8b129b2999cfc54f690ccda" }, "downloads": -1, "filename": "wayslack-0.2.0.tar.gz", "has_sig": false, "md5_digest": "050cf3760af847a59ccf3816194d1755", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13097, "upload_time": "2017-06-25T01:36:21", "url": "https://files.pythonhosted.org/packages/51/30/3fd31e9709a020598e6ecc80ea3f6fe4598de61696df63a60a787b92ff02/wayslack-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "c3b7ea6e88f95726074b960d13a67804", "sha256": "3874eded0a3a5e1f9a16efc776a2f381ca7087133ae9686da229799ad573d478" }, "downloads": -1, "filename": "wayslack-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "c3b7ea6e88f95726074b960d13a67804", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 22824, "upload_time": "2017-07-12T21:10:58", "url": "https://files.pythonhosted.org/packages/89/31/2ba4dc41984886fe37a100d825a3ee35db38924be7970efa9e77a0dffc0b/wayslack-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fe2c670a16ce350a055255dc1f5000db", "sha256": "20231db98114ad553d23a2e08cbfec4b285ab3321c9596198c2a315a935dab61" }, "downloads": -1, "filename": "wayslack-0.2.1.tar.gz", "has_sig": false, "md5_digest": "fe2c670a16ce350a055255dc1f5000db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14556, "upload_time": "2017-07-12T21:10:57", "url": "https://files.pythonhosted.org/packages/f6/ec/de5fa98030afe63af5b7486df27ed08cac238ada3edab0277c716338da18/wayslack-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "dec950344be5eae5fca7859161c03c57", "sha256": "d9c8d48dddf56dcfb126c6e1f1b7e39f576b3b94e0a0d9ea2800fcebcf47ad88" }, "downloads": -1, "filename": "wayslack-0.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "dec950344be5eae5fca7859161c03c57", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21107, "upload_time": "2019-03-06T19:07:04", "url": "https://files.pythonhosted.org/packages/6a/63/b627a100b5cad5a8048023a1054784c5d74c005cfeec5bc336ea19411e29/wayslack-0.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "852899666e0c2653a20540c530153391", "sha256": "c5411f4e076e58d317e6086bf2474d4a76b6ea00902c7ecf42ee3b1e07605cd4" }, "downloads": -1, "filename": "wayslack-0.3.0.tar.gz", "has_sig": false, "md5_digest": "852899666e0c2653a20540c530153391", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18590, "upload_time": "2019-03-06T19:07:02", "url": "https://files.pythonhosted.org/packages/d7/68/39ecfbe65208ef19b6dad3c1360aacbae2ced1ca1d0703d3115fa45a2b01/wayslack-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "f8f13de42681a60adb36228c7923ed7b", "sha256": "e2627344ea74131004c9a23a6d237ffcbd54ba312588a6e0387028a01dfc60cd" }, "downloads": -1, "filename": "wayslack-0.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "f8f13de42681a60adb36228c7923ed7b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21131, "upload_time": "2019-03-06T19:16:35", "url": "https://files.pythonhosted.org/packages/6b/17/895f74a1cc7ae00c2a1c79349bd4e262b98cf9b44d8d728261c096032f4a/wayslack-0.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a9a5b6bf6f1fe50da051a517e5cb3b8", "sha256": "2eed2de94e8287277cd086951e3ff666a0586c89b5678339e961882b96f2b056" }, "downloads": -1, "filename": "wayslack-0.3.1.tar.gz", "has_sig": false, "md5_digest": "2a9a5b6bf6f1fe50da051a517e5cb3b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18652, "upload_time": "2019-03-06T19:16:33", "url": "https://files.pythonhosted.org/packages/97/24/eb1b1dd0267a434bbb1b1218b8758b8572caf5d0f5cee4032ac73b17e795/wayslack-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f8f13de42681a60adb36228c7923ed7b", "sha256": "e2627344ea74131004c9a23a6d237ffcbd54ba312588a6e0387028a01dfc60cd" }, "downloads": -1, "filename": "wayslack-0.3.1-py2-none-any.whl", "has_sig": false, "md5_digest": "f8f13de42681a60adb36228c7923ed7b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21131, "upload_time": "2019-03-06T19:16:35", "url": "https://files.pythonhosted.org/packages/6b/17/895f74a1cc7ae00c2a1c79349bd4e262b98cf9b44d8d728261c096032f4a/wayslack-0.3.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a9a5b6bf6f1fe50da051a517e5cb3b8", "sha256": "2eed2de94e8287277cd086951e3ff666a0586c89b5678339e961882b96f2b056" }, "downloads": -1, "filename": "wayslack-0.3.1.tar.gz", "has_sig": false, "md5_digest": "2a9a5b6bf6f1fe50da051a517e5cb3b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18652, "upload_time": "2019-03-06T19:16:33", "url": "https://files.pythonhosted.org/packages/97/24/eb1b1dd0267a434bbb1b1218b8758b8572caf5d0f5cee4032ac73b17e795/wayslack-0.3.1.tar.gz" } ] }