Install dependancies
pip install -r requirements.txt
Create a virtual environment
python -m venv .venv
source .venv/bin/activate
Install dependancies
pip install -r requirements.txt
Deactivate the virtual environment
deactivate
- Set target environments
export GITHUB_API_ENDPOINT="https://api.github.com"
export GITHUB_ORG="your-org"
export GITHUB_REPO="your-repo"
export GITHUB_TOKEN="your-token"
export GITHUB_OUTPUT="/path/to/output"
or
Create a .env
file with the following content:
GITHUB_API_ENDPOINT=https://api.github.com
GITHUB_ORG=your-org
GITHUB_REPO=your-repo
GITHUB_TOKEN=your-token
GITHUB_OUTPUT=/path/to/output
- Run the script
python export.py
md files will be generated in the GITHUB_OUTPUT
directory.
Warning
This is a very dangerous operation. Please make sure you understand the content before proceeding.
If you want to download attachments, do following tasks.
- create
.cookie
file in the root directory - open your browser with developer tools.
- access to https://github.com with login.
- copy the value of
cookie
from thenetwork
tab. - paste the value to the
.cookie
file. - run the script with
--download-images
option.
python export.py --download-images