-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
127 lines (84 loc) · 2.57 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
batch_unstar
===========
batch_unstar is a tool for managing GitHub starred repositories in batch.
It helps users export their starred repositories to CSV and batch unstar them.
REQUIREMENTS
-----------
- Python 3.6+
- virtualenv or venv (recommended)
- GitHub Personal Access Token (with read:user and user scopes)
- Any CSV editor
INSTALLATION
-----------
1. Get the code:
git clone https://github.com/yourusername/batch_unstar.git
cd batch_unstar
2. Set up Python virtual environment:
On Linux/Mac:
python -m venv .venv
source .venv/bin/activate
On Windows:
python -m venv .venv
.venv\Scripts\activate
3. Install dependencies:
pip install -r requirements.txt
4. Configure:
cp config.yaml.example config.yaml
# Edit config.yaml and add your GitHub token
USAGE
-----
1. Export starred repos:
python fetch_stars.py
# Find generated starred_repos.csv
2. Mark repos to unstar:
- Open starred_repos.csv
- Set "unstar" column to "Yes" for repos to unstar
- Save file
3. Unstar repos:
python unstar_repos.py
CONFIGURATION
------------
config.yaml format:
github:
token: "your-github-token-here"
To get GitHub token:
1. Visit: GitHub Settings -> Developer settings -> Personal access tokens
2. Generate new token with read:user and user scopes
3. Copy token to config.yaml
RATE LIMITING
------------
The scripts implement rate limiting to comply with GitHub API restrictions:
fetch_stars.py: 0.5s between requests
unstar_repos.py: 1.0s between requests
Both scripts will pause automatically when approaching GitHub's rate limits.
IMPORTANT NOTES
-------------
- BACKUP your starred repos list before running these scripts
- Test with few repos first
- CSV uses UTF-8 encoding
- Rate limits are handled automatically
- Always use virtual environment
- Don't commit your config.yaml file
TROUBLESHOOTING
--------------
Common issues:
Q: Config file not found
A: Ensure you copied config.yaml.example to config.yaml
Q: Authentication error
A: Check if token in config.yaml is valid and has correct permissions
Q: CSV file appears empty
A: Ensure you have starred repositories and token has read access
Q: Unstarring takes too long
A: This is normal due to rate limiting. Each operation takes 1s
REPORTING BUGS
-------------
Send bug reports to:
- Email: i@eventloop.live
- GitHub Issues: https://github.com/WyattJia/batch_unstar/issues
Include:
- Python version
- Error messages
- Steps to reproduce
AUTHORS
-------
Wyatt Jia<i@eventloop.live>