GithubHelp home page GithubHelp logo

the100rabh / slack-export-json-to-csv Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 10.0 4 KB

Convert Slack messages exported in their complicated JSON format to simple CSV format

License: The Unlicense

Python 100.00%

slack-export-json-to-csv's People

Contributors

puzzleduck avatar the100rabh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

slack-export-json-to-csv's Issues

Threaded messages

Hey, I wanted to have all the threaded messages be clearly pointing towards the message the person is replying to. Any advice on how to do that by maybe modifying your code ?

Nested Json to csv in python 3

I am trying to convert JSON data into a CSV in Python3, but it no longer works with this script, giving me different errors. Anyone know how to fix for Python 3? Thanks.

Below is my JSON data:

{
"fruit": [
{
"name": "Apple",
"binomial name": "Malus domestica",
"major_producers": [
"China",
"United States",
"Turkey"
],
"nutrition": {
"carbohydrates": "13.81g",
"fat": "0.17g",
"protein": "0.26g"
}
},
{
"name": "Orange",
"binomial name": "Citrus x sinensis",
"major_producers": [
"Brazil",
"United States",
"India"
],
"nutrition": {
"carbohydrates": "11.75g",
"fat": "0.12g",
"protein": "0.94g"
}
},
{
"name": "Mango",
"binomial name": "Mangifera indica",
"major_producers": [
"India",
"China",
"Thailand"
],
"nutrition": {
"carbohydrates": "15g",
"fat": "0.38g",
"protein": "0.82g"
}
}
]
}

User File Not Found

This script seems to rely on the users.json file but the extract of a channel that my admin provided does not include the users file. Is there a workaround if I don't care about the user data? Thanks!

Traceback (most recent call last):
File "slack_json_to_csv.py", line 34, in
with open(userjson) as user_data:
IOError: [Errno 2] No such file or directory: '/Users/asilcox/Downloads/se-hotline/users.json'

Does not work with SlackBot

The script fails because we have a Slackbot auto reply in our channels:
Error:

Traceback (most recent call last):
  File "slack_json_to_csv.py", line 54, in <module>
    user_cur = user[item["user"]]
KeyError: 'USLACKBOT'

Example message in json

{
         "text": "That's just, like, your opinion, man.",
         "type": "message",
         "subtype": "slackbot_response",
         "user": "USLACKBOT",
         "ts": "1510321670.000102"
},

user error

hi, when i try running the script i get the following error after the script reads the users file:

Traceback (most recent call last):
File "slack_json_to_csv.py", line 54, in
user_cur = user[item["user"]]
KeyError: 'user'

Threaded replies

Hi,

Do you know how to get the show which messages are replies to which message. Like link them or print those messages after the main thread

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.