carderne/signal-export

Support exporting all messages into JSON

mitar opened this issue · 3 comments

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.

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

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.

I tried it now and it works great! Thanks!