Skip to content

Commit e247d96

Browse files
committed
release: prepare v1.0.0
1 parent 9482d53 commit e247d96

10 files changed

Lines changed: 97 additions & 253 deletions

File tree

README.md

Lines changed: 76 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -1,215 +1,83 @@
1-
<div align="center">
2-
31
# 🚀 LeetCode Sync
42

5-
Automatically synchronize accepted LeetCode solutions to GitHub.
6-
7-
Download solutions • Generate metadata • Update README • Push to GitHub automatically
8-
9-
Built with ❤️ in Python
10-
11-
</div>
12-
13-
## Badges
14-
15-
![Python](https://img.shields.io/badge/Python-3.13-blue)
16-
![Tests](https://github.com/arnav-on-code/LEETCODE_SYNC/actions/workflows/tests.yml/badge.svg)
17-
![Lint](https://github.com/arnav-on-code/LEETCODE_SYNC/actions/workflows/lint.yml/badge.svg)
18-
![Sync](https://github.com/arnav-on-code/LEETCODE_SYNC/actions/workflows/sync.yml/badge.svg)
19-
![License](https://img.shields.io/github/license/arnav-on-code/LEETCODE_SYNC)
20-
21-
22-
## ✨ Features
23-
24-
- ✅ Automatic LeetCode authentication
25-
- ✅ Fetch recent accepted submissions
26-
- ✅ Download source code
27-
- ✅ Save metadata
28-
- ✅ Git automation
29-
- ✅ README generation
30-
- ✅ Statistics tracking
31-
- ✅ GitHub Actions automation
32-
- ✅ Unit tested
3+
Automatically synchronize accepted LeetCode submissions to GitHub.
334

5+
---
346

35-
## 🏗️ Architecture
7+
## 📈 Progress
368

379
```text
10+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
11+
12+
Solved: 0 / 300 Problems
13+
14+
📊 Statistics
15+
Difficulty Solved
16+
🟢 Easy 0
17+
🟡 Medium 0
18+
🔴 Hard 0
19+
Total 0
20+
🔥 Latest Accepted Problem
21+
22+
23+
| Field | Value |
24+
|------|------|
25+
| Problem ID | 1 |
26+
| Title | Two Sum |
27+
| Language | Python3 |
28+
| Runtime | 45 ms |
29+
| Memory | 17 MB |
30+
31+
32+
💻 Languages Used
33+
34+
- **Python3** : 4
35+
36+
## 📚 Recent Accepted Problems
37+
38+
- 1 Two Sum
39+
- 295 Find Median From Data Stream
40+
- 1 Two Sum
41+
- 295 Find Median From Data Stream
42+
43+
44+
---
45+
46+
✨ Features
47+
Automatic LeetCode synchronization
48+
Automatic Git commits
49+
Automatic GitHub push
50+
Metadata generation
51+
README generation
52+
GitHub Actions support
53+
Unit tests
54+
📂 Repository Structure
55+
storage/
56+
└── solutions/
57+
├── 0011_Container_With_Most_Water/
58+
│ ├── solution.py
59+
│ └── metadata.json
60+
└── ....
61+
⚙️ Workflow
3862
LeetCode
39-
40-
41-
Authentication
42-
43-
44-
API Client
45-
46-
47-
Parser
48-
49-
50-
Downloader
51-
52-
53-
Statistics
54-
55-
56-
README Generator
57-
58-
59-
Git Manager
60-
61-
62-
GitHub
63-
```
64-
65-
## ⚙️ Installation
66-
67-
```bash
68-
git clone https://github.com/arnav-on-code/LEETCODE_SYNC.git
69-
70-
cd LEETCODE_SYNC
71-
72-
python -m venv myenv
73-
74-
pip install -r requirements.txt
75-
```
76-
77-
## 🔐 Environment Variables
78-
79-
Create a `.env`
80-
81-
```text
82-
LEETCODE_SESSION=
83-
84-
CSRF_TOKEN=
85-
86-
LEETCODE_USERNAME=
87-
88-
GITHUB_USER=
89-
90-
GITHUB_EMAIL=
91-
```
92-
93-
## 🚀 Usage
94-
95-
Run manually
96-
97-
```bash
98-
python main.py
99-
```
100-
101-
Run tests
102-
103-
```bash
104-
pytest tests -v
105-
```
106-
107-
Format code
108-
109-
```bash
110-
black .
111-
```
112-
113-
Lint
114-
115-
```bash
116-
flake8 .
117-
```
118-
119-
## 📊 Statistics
120-
121-
Easy
122-
123-
Medium
124-
125-
Hard
126-
127-
Total
128-
129-
Languages
130-
131-
Recent Problems
132-
133-
Latest Accepted
134-
135-
Last Sync
136-
137-
138-
## 📂 Repository Structure
139-
140-
```text
141-
Leetcode_sync
142-
143-
├── .github/
144-
├── config/
145-
├── github_sync/
146-
├── leetcode/
147-
├── storage/
148-
├── sync/
149-
├── tests/
150-
├── utils/
151-
├── README.md
152-
├── requirements.txt
153-
└── main.py
154-
```
155-
156-
## 🧪 Testing
157-
158-
Current Status
159-
160-
- ✅ 23 Unit Tests
161-
- ✅ GitHub Actions
162-
- ✅ Lint Checks
163-
- ✅ Automatic Synchronization
164-
165-
166-
## 🤖 GitHub Actions
167-
168-
Three workflows are configured.
169-
170-
• tests.yml
171-
172-
Runs all unit tests.
173-
174-
• lint.yml
175-
176-
Checks formatting and linting.
177-
178-
• sync.yml
179-
180-
Automatically synchronizes LeetCode submissions every 6 hours.
181-
182-
## 🛣️ Roadmap
183-
184-
- [x] Authentication
185-
186-
- [x] Downloader
187-
188-
- [x] Metadata
189-
190-
- [x] Statistics
191-
192-
- [x] README Generator
193-
194-
- [x] GitHub Actions
195-
196-
- [x] Unit Tests
197-
198-
- [x] README Automation
199-
200-
- [ ] Docker Image
201-
202-
- [ ] Multi-language README
203-
204-
- [ ] PyPI Package
205-
206-
207-
## 📜 License
208-
209-
This project is licensed under the MIT License.
210-
211-
## 📖 About
212-
213-
LeetCode Sync automatically downloads accepted LeetCode solutions, stores them with metadata, updates repository statistics, regenerates the project README, and synchronizes everything to GitHub.
214-
215-
The project is designed with a modular architecture and includes automated testing, CI workflows, and Git integration.
63+
64+
65+
API
66+
67+
68+
Downloader
69+
70+
71+
Statistics
72+
73+
74+
README Generator
75+
76+
77+
Git
78+
79+
80+
GitHub
81+
⏰ Last Sync
82+
83+
2026-07-02 12:18:27

github_sync/manager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ class GitManager:
1010

1111
def __init__(self, repository: Path):
1212
if shutil.which("git") is None:
13-
raise RuntimeError(
14-
"Git is not installed or not available in PATH."
15-
)
13+
raise RuntimeError("Git is not installed or not available in PATH.")
1614

1715
self.repository = Path(repository).resolve()
1816

@@ -58,4 +56,4 @@ def push(self) -> None:
5856
self.run("push")
5957

6058
def pull(self) -> None:
61-
self.run("pull")
59+
self.run("pull")

github_sync/readme.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ def generate(self, stats) -> Path:
4545
"recent_problems",
4646
[],
4747
):
48-
recent += (
49-
f'- {problem["id"]} '
50-
f'{problem["title"]}\n'
51-
)
48+
recent += f'- {problem["id"]} ' f'{problem["title"]}\n'
5249

5350
if latest:
5451
latest_problem = f"""
@@ -143,4 +140,4 @@ def generate(self, stats) -> Path:
143140
encoding="utf-8",
144141
)
145142

146-
return self.readme
143+
return self.readme

github_sync/statistics.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,14 @@ def update(self, profile, detail):
7777
stats["medium"] = solved.get("Medium", 0)
7878
stats["hard"] = solved.get("Hard", 0)
7979

80-
8180
language = detail.language_verbose
8281

8382
languages = stats.get("languages", {})
8483

85-
languages[language] = (
86-
languages.get(language, 0) + 1
87-
)
84+
languages[language] = languages.get(language, 0) + 1
8885

8986
stats["languages"] = languages
9087

91-
9288
latest = {
9389
"id": detail.question_id,
9490
"title": detail.title_slug.replace("-", " ").title(),
@@ -99,7 +95,6 @@ def update(self, profile, detail):
9995

10096
stats["last_problem"] = latest
10197

102-
10398
recent = stats.get("recent_problems", [])
10499

105100
recent.insert(
@@ -110,15 +105,12 @@ def update(self, profile, detail):
110105
},
111106
)
112107

113-
114108
stats["recent_problems"] = recent[:5]
115109

116110
# ---------- Last sync ----------
117111

118-
stats["last_sync"] = datetime.now().strftime(
119-
"%Y-%m-%d %H:%M:%S"
120-
)
112+
stats["last_sync"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
121113

122114
self.save(stats)
123115

124-
return stats
116+
return stats

storage/state.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"last_submission_id": "2051842379"
2+
"last_submission_id": "2052380776"
33
}

0 commit comments

Comments
 (0)