import stexport.export as E; return E.make_parser().prog
:results: Export your personal Stackexchange data :end:
Setting up
Alternatively, use =git clone --recursive=, or =git pull && git submodule update --init=. After that, you can use =pip3 install --editable=.
Visit the following link, but
After that you should be authorised and redirected. Copy the =access_token= somewhere, you'll need it later.
Exporting
NOTE: even if you decided not to use =access_token=, you still need to pass the parameter, just set it to empty string.
import stexport.export as E; return E.make_parser().epilog
: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
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:
import stexport.exporthelpers.dal_helper as D; return D.make_parser().epilog
: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]].
main usecase is to be imported as python module to allow for programmatic access to your data.
You can find some inspiration in [[https://beepb00p.xyz/mypkg.html][=my.=]] package that I'm using as an API to all my personal data.
to test it against your export, simply run: ~python3 -m stexport.dal --source /path/to/export~
you can also try it interactively: ~python3 -m stexport.dal --source /path/to/export --interactive~
:end: