carderne / signal-export

Export your Signal chats to markdown files with attachments
Other
503 stars 54 forks source link

Support exporting all messages into JSON #110

Closed mitar closed 8 months ago

mitar commented 9 months ago

I would like to backup all messages with all available metadata in some structured format like JSON, instead of lossy markdown. I would assume that internally data is in some structured form? So one could then have JSON -> Markdown -> HTML conversions. But I could also load JSON into some database and have them searchable, etc.

carderne commented 8 months ago

Yes this is a good idea... will try to look at this in the next couple of days but no promises.

carderne commented 8 months ago

Hi @mitar just added this in v2.0.0. Please install it and give it a go:

pip install signal-export>=2.0.0

Great to hear if there are any obvious bugs.

Btw: I could also just dump the full JSON that comes out of the DB but prefer to keep some control over what's coming out... if you just want the raw DB access, you can look at sigexport/data.py and see how you can run queries against that...

The JSON file will be output to data.json in the same folder as the markdown and html. It's in newline-delimited json, basically just doesn't have a [ at the beginning and ] at the end... Tools like jq work well if you just add the --slurp option.

mitar commented 6 months ago

I tried it now and it works great! Thanks!