karlicoss / stexport

Export and access your Stackexchange data
MIT License
11 stars 1 forks source link
backup data-liberation export stackexchange stackoverflow takeout

+begin_src python :dir src :results drawer :exports results

import stexport.export as E; return E.make_parser().prog

+end_src

+RESULTS:

:results: Export your personal Stackexchange data :end:

NOTE: even if you decided not to use =access_token=, you still need to pass the parameter, just set it to empty string.

TODO ugh. it doesn't capture --all-sites or --user-sites or anything. ugh

really need a more literate approach somehow..

+begin_src python :dir src :results drawer :exports results

import stexport.export as E; return E.make_parser().epilog

+end_src

+RESULTS:

:results:

Usage:

Recommended: create =secrets.py= keeping your api parameters, e.g.:

: key = "KEY" : access_token = "ACCESS_TOKEN"

After that, use:

: python3 -m stexport.export --secrets /path/to/secrets.py

That way you type less and have control over where you keep your plaintext secrets.

Alternatively, you can pass parameters directly, e.g.

: python3 -m stexport.export --key --access_token

However, this is verbose and prone to leaking your keys/tokens/passwords in shell history.

I highly recommend checking exported files at least once just to make sure they contain everything you expect from your export. If not, please feel free to ask or raise an issue!

:end:

+begin_src python :dir src :results drawer :exports results

import stexport.exporthelpers.dal_helper as D; return D.make_parser().epilog

+end_src

+RESULTS:

:results:

You can use =stexport.dal= (stands for "Data Access/Abstraction Layer") to access your exported data, even offline. I elaborate on motivation behind it [[https://beepb00p.xyz/exports.html#dal][here]].

:end: