|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | +[<img src="docs/icon.png" alt="Code Statistic" width="64" height="64" style="transform: translateY(50px);">](https://stats.deeptrain.net) |
| 4 | +# [Code Statistic](https://stats.deeptrain.net) |
| 5 | + |
| 6 | +#### Dynamically generate your GitHub statistic card! |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +<br> |
| 12 | +</div> |
| 13 | + |
| 14 | +## 🍊 User Card |
| 15 | +Hey, want to generate quickly? Have a look at our [website](https://stats.deeptrain.net/)! |
| 16 | + |
| 17 | +Use in your Github homepage! use it in your website! use it anywhere you want! |
| 18 | +```markdown |
| 19 | +[](https://github.com/zmh-program/code-statistic) |
| 20 | +``` |
| 21 | +[](https://github.com/zmh-program/code-statistic) |
| 22 | + |
| 23 | +> **Note** |
| 24 | +> Currently only your own repositories as statistics, do not support the repositories **contributed** to others, do not support **private** repositories, excluding **fork** repositories. |
| 25 | +> |
| 26 | +> We will count all repository data such as stars, forks, open issues and output the statistic. |
| 27 | +
|
| 28 | + |
| 29 | +## 🍉 Repository Card |
| 30 | +Use in repository introduction! use in pull request! use in issue! use it anywhere you want to introduce the project! |
| 31 | + |
| 32 | +```markdown |
| 33 | +[](https://github.com/zmh-program/code-statistic) |
| 34 | +``` |
| 35 | +[](https://github.com/zmh-program/code-statistic) |
| 36 | + |
| 37 | +> **Warning** |
| 38 | +> By default, we can't get the data of private repo, please use your own [token](https://github.com/settings/tokens/new) to deploy. Don't forget to check the box to access your private repositories! |
| 39 | +
|
| 40 | +## 🥝 Dark Theme |
| 41 | +Very easy, just add `?theme=dark` after it in any kind of card! |
| 42 | +```markdown |
| 43 | +[](https://github.com/zmh-program/code-statistic) |
| 44 | +``` |
| 45 | +[](https://github.com/zmh-program/code-statistic) |
| 46 | + |
| 47 | + |
| 48 | +## 👨💻 API |
| 49 | +1. `GET` `https://stats.deeptrain.net/api/user/{user}` |
| 50 | + |
| 51 | + > Example response: |
| 52 | + > ```json |
| 53 | + > { |
| 54 | + > "username": "zmh-program", |
| 55 | + > "org": false, |
| 56 | + > "location": "Shandong, China", |
| 57 | + > "repos": 24, |
| 58 | + > "stars": "0.3k", |
| 59 | + > "watchers": "0.3k", |
| 60 | + > "followers": "45", |
| 61 | + > "forks": "10", |
| 62 | + > "issues": "2", |
| 63 | + > "languages": [ |
| 64 | + > { |
| 65 | + > "color": "#3572A5", |
| 66 | + > "lang": "Python", |
| 67 | + > "percent": 35.30345154490841, |
| 68 | + > "text": "Python 35% (525.1k)", |
| 69 | + > "value": 525070 |
| 70 | + > }, |
| 71 | + > ... |
| 72 | + > ] |
| 73 | + > } |
| 74 | + > ``` |
| 75 | + > Error response: |
| 76 | + > ```json |
| 77 | + > { |
| 78 | + > "message": "user not found" |
| 79 | + > } |
| 80 | + > ``` |
| 81 | + <br> |
| 82 | +
|
| 83 | +2. `GET` `https://stats.deeptrain.net/api/repo/{user}/{repo}` |
| 84 | + |
| 85 | + > Example response: |
| 86 | + > ```json |
| 87 | + > { |
| 88 | + > "username": "zmh-program", |
| 89 | + > "license": "MIT", |
| 90 | + > "repo": "code-statistic", |
| 91 | + > "stars": "26", |
| 92 | + > "watchers": "26", |
| 93 | + > "color": "#a91e50", |
| 94 | + > "forks": "1", |
| 95 | + > "issues": "0", |
| 96 | + > "size": "1.0 MiB", |
| 97 | + > "languages": [ |
| 98 | + > { |
| 99 | + > "color": "#3178c6", |
| 100 | + > "lang": "TypeScript", |
| 101 | + > "percent": 42.76333789329686, |
| 102 | + > "text": "TypeScript 43% (21.9k)", |
| 103 | + > "value": 21882 |
| 104 | + > }, |
| 105 | + > ... |
| 106 | + > ] |
| 107 | + > } |
| 108 | + > ``` |
| 109 | + > Error response: |
| 110 | + > ```json |
| 111 | + > { |
| 112 | + > "message": "repo not found" |
| 113 | + > } |
| 114 | + > ``` |
0 commit comments