python flag for `--output` to export chats to json?
See original GitHub issueis there a python flag for --output
so I can export chats to json?
I see this in the CLI documentation (you included -o
flag in your cmd) but not for the ChatDownloader().get_chat()
⦠I need this json so I can pd.read_json for ETL of chat data
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-106-472d1877d159> in <module>
----> 1 chat = ChatDownloader().get_chat(url=url,message_types=["text_message", "paid_message", "membership_item"],output=outfile)
TypeError: get_chat() got an unexpected keyword argument 'output'
__Originally posted by @atnjqt in https://github.com/xenova/chat-downloader/issues/61#issuecomment-778847756__
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Python conversion from JSON to JSONL - Stack Overflow
5 Answers 5 ; import json with open ; 'output.jsonl', 'w') as ; for entry in JSON_file: json.dump(entry, outfile) outfile.write('\n').
Read more >Working With JSON Data in Python
In this tutorial you'll learn how to read and write JSON-encoded data ... Well, us sneaky Pythoneers use the -i interactive flag when...
Read more >Chatistics | Python scripts to parse Messenger, Hangouts ...
Python scripts to parse Messenger, Hangouts, WhatsApp and Telegram chat logs into DataFrames.
Read more >bigquery-schema-generator - PyPI
BigQuery schema generator from JSON or CSV data. ... Command Line; Schema Output; Command Line Flag Options. Help ( --help ); Input Format...
Read more >CoffeeScript
-t, --transpile, Pipe the CoffeeScript compiler's output through Babel before saving or running ... Use this flag to forward options directly to Node.js....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi there!
This functionality has been included in the code, but not in the
get_chat
method. Theget_chat
method was only responsible for returning a an iterableChat
object (hence theget
in the name). ThisChat
object has the ability to generate more messages (using http requests) when needed.File output and other more advanced processing should be the responsibility of the user implementing the code. That being said, there are ways to use the moduleās outputting functionality as I will describe later.
Early into development, users wanted a way to continuously write to file. Since this is not standard functionality for file IO in python, the continuous_write.py module was created.
Now, there are many ways to use this, but I will describe 2:
ContinuousWriter
run
. Alternatively, if your programās functionality matches that of the command line interface, you can āsimulateā running it from the command line using therun(**kwargs)
method:This option is less suitable if you need more control.
No worries! Yeah, the documentation still needs a lot of work⦠š