{"id":13848137,"url":"https://github.com/hfaran/slack-export-viewer","last_synced_at":"2025-05-13T17:07:25.976Z","repository":{"id":39612306,"uuid":"52595285","full_name":"hfaran/slack-export-viewer","owner":"hfaran","description":"A Slack Export archive viewer that allows you to easily view and share your Slack team's export","archived":false,"fork":false,"pushed_at":"2025-02-01T22:42:53.000Z","size":947,"stargazers_count":1009,"open_issues_count":54,"forks_count":196,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-24T01:57:20.874Z","etag":null,"topics":["slack"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/slack-export-viewer","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hfaran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-02-26T09:55:43.000Z","updated_at":"2025-04-23T04:26:14.000Z","dependencies_parsed_at":"2023-11-19T23:23:52.962Z","dependency_job_id":"6e306bff-5531-446c-8ca0-fa9fc7105745","html_url":"https://github.com/hfaran/slack-export-viewer","commit_stats":{"total_commits":204,"total_committers":49,"mean_commits":4.163265306122449,"dds":0.3921568627450981,"last_synced_commit":"78b59360d3b2d7c04370bbcf1b5874edcb815fd5"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfaran%2Fslack-export-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfaran%2Fslack-export-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfaran%2Fslack-export-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfaran%2Fslack-export-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hfaran","download_url":"https://codeload.github.com/hfaran/slack-export-viewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990466,"owners_count":21995774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["slack"],"created_at":"2024-08-04T19:00:42.767Z","updated_at":"2025-05-13T17:07:20.963Z","avatar_url":"https://github.com/hfaran.png","language":"Python","funding_links":[],"categories":["Uncategorized","Python"],"sub_categories":["Uncategorized"],"readme":"# Slack Export Viewer\n\n![CI](https://github.com/hfaran/slack-export-viewer/actions/workflows/ci.yml/badge.svg)\n[![PyPI version](https://badge.fury.io/py/slack-export-viewer.svg)](http://badge.fury.io/py/slack-export-viewer)\n\nA Slack Export archive viewer that allows you to easily view and share your \nSlack team's export (instead of having to dive into hundreds of JSON files).\n\n![Preview](screenshot.png)\n\n\n## Contents\n\n* [Overview](#overview)\n* [Installation](#installation)\n* [Usage](#usage)\n* [Acknowledgements](#acknowledgements)\n\n## Overview\n\n`slack-export-viewer` is useful for small teams on a free Slack plan (limited to 10,000 messages) who overrun their budget and ocassionally need a nice interface to refer back to previous messages. You get a web interface to easily scroll through all channels in the export without having to look at individual JSON files per channel per day.\n\n`slack-export-viewer` can be used locally on one machine for yourself to explore an export, it can be run on a headless server (as it is a Flask web app) if you also want to serve the content to the rest of your team, or it can output HTML for deploying a static website.\n\n\n## Installation\n\nI recommend [`pipx`](https://github.com/pipxproject/pipx) for a nice\nisolated install.\n\n```bash\npipx install slack-export-viewer\n```\n\nOr just feel free to use `pip` as you like.\n\n```bash\npip install slack-export-viewer\n```\n\n`slack-export-viewer` will be installed as an entry-point; run from anywhere.\n\n```bash\n$ slack-export-viewer --help\nUsage: slack-export-viewer [OPTIONS]\n\nOptions:\n  -p, --port INTEGER              Host port to serve your content on\n                                  Environment var: SEV_PORT (default: 5000)\n  -z, --archive PATH              Path to your Slack export archive (.zip file or directory)\n                                  Environment var: SEV_ARCHIVE  [required]\n  -I, --ip TEXT                   Host IP to serve your content on\n                                  Environment var: SEV_IP (default: localhost)\n  --no-browser                    If you do not want a browser to open automatically, set this.\n                                  Environment var: SEV_NO_BROWSER (default: false)\n  --channels TEXT                 A comma separated list of channels to parse.\n                                  Environment var: SEV_CHANNELS (default: None)\n  --no-sidebar                    Removes the sidebar.\n                                  Environment var: SEV_NO_SIDEBAR (default: false)\n  --no-external-references        Removes all references to external\n                                  css/js/images. Environment var:\n                                  SEV_NO_EXTERNAL_REFERENCES (default: false)\n  --test                          Runs in 'test' mode, i.e., this will do an archive extract, but will not start the server, and immediately quit.\n                                            Environment var: SEV_TEST (default: false\n  --debug                         Enable debug mode\n                                  Environment var: FLASK_DEBUG (default: false)\n  -o, --output-dir PATH           Output directory for static HTML files.\n                                  Environment var: SEV_OUTPUT_DIR (default: html_output)\n  --html-only                     If you want static HTML only, set this.\n                                  Environment var: SEV_HTML_ONLY (default: false)\n  --since [%Y-%m-%d]              Only show messages since this date.\n                                  Environment var: SEV_SINCE (default: None)\n  --show-dms / --no-show-dms      Show/Hide direct messages\n                                  Environment var: SEV_SHOW_DMS (default: false)\n  --thread-note / --no-thread-note\n                                  Add/don't add 'Thread Reply' to thread messages.\n                                  Environment var: SEV_THREAD_NOTE (default: true)\n  --skip-channel-member-change    Hide channel join/leave messages\n                                  Environment var: SEV_SKIP_CHANNEL_MEMBER_CHANGE (default: false)\n  --hide-channels TEXT            Comma separated list of channels to hide.\n                                  Environment var: SEV_HIDE_CHANNELS (default: None)\n  --help                          Show this message and exit.\n```\n\n\n## Usage\n\n### 1) Grab your Slack team's export\n\n#### Option 1: official Slack export\n* Visit [https://my.slack.com/services/export](https://my.slack.com/services/export)\n* Create an export\n* Wait for it to complete\n* Refresh the page and download the export (.zip file) into whatever directory\n\n#### Option 2: slackdump\n* Download slackdump from https://github.com/rusq/slackdump/\n* Setup authentication as outlined in the slackdump documentation\n* Run slackdump and export messages in the \"Standard\" format as either a directory or zip file.\n    * `slack-export-viewer` can also use the director without zip file.\n\n### 2) Point `slack-export-viewer` to it\n\nPoint slack-export-viewer to the .zip file and let it do its magic\n\n```bash\nslack-export-viewer -z /path/to/export/zip\n```\n\nIf everything went well, your archive will have been extracted and processed, and a browser window will have opened showing your *#general* channel from the export. Or, if the `html-only` flag was set, HTML files will be available in the `html-output` directory (or a different directory if specified).\n\n\n## CLI\n\nThere is now a CLI included as well. Currently the one command you can use is clearing the cache from slack-export-viewer from your %TEMP% directory; see usage:\n\n```bash\n$ slack-export-viewer-cli --help\nUsage: cli.py [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  clean   Cleans up any temporary files (including cached output by...\n  export  Generates a single-file printable export for an archive file or...\n```\n\nExport:\n```bash\n$ slack-export-viewer-cli export --help\nUsage: cli.py export [OPTIONS] ARCHIVE_DIR\n\n  Generates a single-file printable export for an archive file or directory\n\nOptions:\n  --debug                         Enable debug mode\n                                  Environment var: SEV_DEBUG (default: false)\n  --show-dms / --no-show-dms      Show/Hide direct messages\"\n                                  Environment var: SEV_SHOW_DMS (default: false)\n  --thread-note / --no-thread-note\n                                  Add/don't add 'Thread Reply' to thread messages.\n                                  Environment var: SEV_THREAD_NOTE (default: true)\n  --since [%Y-%m-%d]              Only show messages since the given date\n                                  Environment var: SEV_SINCE (default: None)\n  --skip-channel-member-change    Hide channel join/leave messages\n                                  Environment var: SEV_SKIP_CHANNEL_MEMBER_CHANGE (default: false)\n  --template FILENAME             Custom single file export template\n                                  Environment var: SEV_TEMPLATE (default: \"export_single.html\")\n  --hide-channels TEXT            Comma separated list of channels to hide.\n                                  Environment var: SEV_HIDE_CHANNELS (default: None)\n  --help                          Show this message and exit.\n```\n\nAn example template can be found in the repositories [`slackviewer/templates/example_template_single_export.html`](https://github.com/hfaran/slack-export-viewer/tree/master/slackviewer/templates/example_template_single_export.html) file\n\nClean\n```bash\n$ slack-export-viewer-cli clean --help\nUsage: cli.py clean [OPTIONS]\n\n  Cleans up any temporary files (including cached output by slack-export-\n  viewer)\n\nOptions:\n  -w, --wet  Actually performs file deletion\n             Environment var: SEV_CLEAN_WET (default: false)\n  --help     Show this message and exit.\n```\n\n\n### Examples\n\nClean:\n```bash\n$ slack-export-viewer-cli clean\nRun with -w to remove C:\\Users\\hamza\\AppData\\Local\\Temp\\_slackviewer\n$ slack-export-viewer-cli clean -w\nRemoving C:\\Users\\hamza\\AppData\\Local\\Temp\\_slackviewer...\n```\n\nExport:\n```bash\n$ slack-export-viewer-cli export \\\n    --since $(date -d \"2 days ago\" '+%Y-%m-%d') \\\n    --template /tmp/example_template_single_export.html \\\n    --show-dms \\\n    --skip-channel-member-change \\\n    --no-thread-note \\\n    --hide-channels \"random,alerts\" \\\n    /tmp/slack-export\nArchive already extracted. Viewing from /tmp/slack-export...\nExported to slack-export.html\n```\n\n\n## Local Development\n\nAfter installing the requirements in requirements.txt and dev-requirements.txt, \ndefine `FLASK_APP` as `main` and select any channels desired from an export:\n\n```bash\nexport FLASK_APP=main \u0026\u0026 export SEV_CHANNELS=general\n```\n\nStart a development server by running `app.py` in the root directory:\n\n```bash\npython3 app.py -z /Absolute/path/to/archive.zip --debug\n```\n\n## Acknowledgements\n\nCredit to Pieter Levels whose [blog post](https://levels.io/slack-export-to-html/) and PHP script I used as a jumping off point for this.\n\n### Improvements over Pieter's script\n\n `slack-export-viewer` is similar in core functionality but adds several things on top to make it nicer to use:\n\n* An installable application\n* Automated archive extraction and retention\n* A Slack-like sidebar that lets you switch channels easily\n* Much more \"sophisticated\" rendering of messages\n* A Flask server which lets you serve the archive contents as opposed to a PHP script which does static file generation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfaran%2Fslack-export-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhfaran%2Fslack-export-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfaran%2Fslack-export-viewer/lists"}