|
1 | 1 | # Starred |
2 | 2 |
|
3 | | -[](https://github.com/maguowei/starred/actions/workflows/ci.yml) |
| 3 | +[](https://github.com/maguowei/starred/actions/workflows/ci.yml) |
4 | 4 | [](https://github.com/maguowei/starred/actions/workflows/publish.yml) |
5 | 5 |
|
6 | | -## Install |
| 6 | +English | [简体中文](README.zh-CN.md) |
7 | 7 |
|
8 | | -```bash |
| 8 | +Create and maintain your own Awesome-style list from GitHub stars. |
9 | 9 |
|
10 | | -$ pip install starred |
11 | | -$ starred --username maguowei --token=xxxxxxxx --sort > README.md |
12 | | -``` |
| 10 | +## Features |
| 11 | + |
| 12 | +- Generate a Markdown list from your starred repositories. |
| 13 | +- Group results by language (default) or repository topics. |
| 14 | +- Optionally sort categories alphabetically. |
| 15 | +- Write the generated file directly to a target GitHub repository. |
| 16 | +- Include private repositories with `--private`. |
| 17 | + |
| 18 | +## Installation |
13 | 19 |
|
14 | | -## Usage |
| 20 | +Requires Python `3.10+`. |
15 | 21 |
|
16 | 22 | ```bash |
17 | | -$ starred --help |
| 23 | +pip install starred |
| 24 | +``` |
18 | 25 |
|
19 | | -Usage: starred [OPTIONS] |
| 26 | +## Quick Start |
20 | 27 |
|
21 | | - GitHub starred |
| 28 | +1. Create a GitHub token: [Personal access tokens](https://github.com/settings/tokens) |
| 29 | +2. Generate a README from your stars: |
22 | 30 |
|
23 | | - creating your own Awesome List by GitHub stars! |
| 31 | +```bash |
| 32 | +export GITHUB_TOKEN=<your-token> |
| 33 | +starred --username <your-github-username> --sort > README.md |
| 34 | +``` |
24 | 35 |
|
25 | | - example: starred --username maguowei --token=xxxxxxxx --sort > README.md |
| 36 | +## CLI Usage |
26 | 37 |
|
27 | | -Options: |
28 | | - --username TEXT GitHub username [required] |
29 | | - --token TEXT GitHub token [required] |
30 | | - --sort sort by category[language/topic] name alphabetically |
31 | | - [default: False] |
| 38 | +```bash |
| 39 | +starred --help |
| 40 | +``` |
32 | 41 |
|
33 | | - --topic category by topic, default is category by language |
34 | | - [default: False] |
| 42 | +Common options: |
35 | 43 |
|
36 | | - --topic_limit INTEGER topic stargazer_count gt number, set bigger to reduce |
37 | | - topics number [default: 500] |
| 44 | +- `--username`: GitHub username (required) |
| 45 | +- `--token`: GitHub token (required) |
| 46 | +- `--sort`: Sort categories alphabetically |
| 47 | +- `--topic`: Group by topic instead of language |
| 48 | +- `--topic_limit`: Topic popularity threshold (default: `500`) |
| 49 | +- `--repository`: Target repository name to update/create |
| 50 | +- `--filename`: Target file name in the repository (default: `README.md`) |
| 51 | +- `--message`: Commit message used when updating a file |
| 52 | +- `--private`: Include private repositories |
38 | 53 |
|
39 | | - --repository TEXT repository name [default: ] |
40 | | - --filename TEXT file name [default: README.md] |
41 | | - --message TEXT commit message [default: update stars] |
42 | | - --private include private repos [default: False] |
43 | | - --version Show the version and exit. |
44 | | - --help Show this message and exit. |
45 | | -``` |
| 54 | +## Update a Repository Directly |
46 | 55 |
|
47 | | -## Demo |
| 56 | +This command creates the repository if it does not exist, then updates `README.md` in that repository. |
48 | 57 |
|
49 | 58 | ```bash |
50 | | -# automatically create the repository |
51 | | -$ export GITHUB_TOKEN=yourtoken |
52 | | -$ starred --username yourname --repository awesome-stars --sort |
| 59 | +export GITHUB_TOKEN=<your-token> |
| 60 | +starred --username <your-github-username> --repository awesome-stars --sort |
53 | 61 | ``` |
54 | 62 |
|
55 | | -- [`maguowei/awesome-stars`](https://github.com/maguowei/awesome-stars) |
56 | | -- [update awesome-stars every day by GitHub Action](https://github.com/maguowei/awesome-stars/blob/master/.github/workflows/schedules.yml) the example with GitHub Action |
57 | | - |
58 | | -### Who uses starred? |
59 | | - |
60 | | -- by search: https://github.com/search?p=1&q=%22Generated+by+starred%22&type=Code |
61 | | -- by topics: |
62 | | - - https://github.com/topics/starred |
63 | | - - https://github.com/topics/awesome-stars |
| 63 | +Example repository: |
64 | 64 |
|
65 | | -## Use [awesome-stars](https://github.com/maguowei/awesome-stars) as template |
| 65 | +- [maguowei/awesome-stars](https://github.com/maguowei/awesome-stars) |
66 | 66 |
|
67 | | -The simple way to create an awesome-stars repository is to use [maguowei/awesome-stars](https://github.com/maguowei/awesome-stars/generate) as template. |
68 | | -It will auto update your awesome-stars repository every day by GitHub Action. |
| 67 | +## Use `awesome-stars` as a Template |
69 | 68 |
|
70 | | -1. Click [Create a new repository from awesome-stars](https://github.com/maguowei/awesome-stars/generate) |
| 69 | +The easiest setup is using [maguowei/awesome-stars](https://github.com/maguowei/awesome-stars/generate) as your template repository. It includes a scheduled GitHub Actions workflow for automatic updates. |
71 | 70 |
|
72 | | - |
| 71 | +1. Click [Create a new repository from awesome-stars](https://github.com/maguowei/awesome-stars/generate). |
73 | 72 |
|
74 | | -2. [Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository) |
| 73 | + |
75 | 74 |
|
76 | | -set permissions to `Read and write permissions` and click `Save` button |
| 75 | +2. Configure workflow token permissions: |
| 76 | + [Set `GITHUB_TOKEN` permissions](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository) |
77 | 77 |
|
78 | | - |
| 78 | +Set permissions to `Read and write permissions`, then click `Save`. |
79 | 79 |
|
80 | | -3. Run the workflow first time |
| 80 | + |
81 | 81 |
|
82 | | -click `Run workflow` button |
| 82 | +3. Run the workflow once manually by clicking `Run workflow`. |
83 | 83 |
|
84 | | - |
| 84 | + |
85 | 85 |
|
86 | | -4. Customize the workflow schedule |
| 86 | +4. Customize the schedule in: |
| 87 | + [.github/workflows/schedules.yml#L5](https://github.com/maguowei/awesome-stars/blob/master/.github/workflows/schedules.yml#L5) |
87 | 88 |
|
88 | | -- [.github/workflows/schedules.yml#L5](https://github.com/maguowei/awesome-stars/blob/master/.github/workflows/schedules.yml#L5) |
| 89 | + |
89 | 90 |
|
90 | | - |
| 91 | +## Who Uses `starred`? |
91 | 92 |
|
92 | | -## FAQ |
| 93 | +- Code search: [Generated by starred](https://github.com/search?p=1&q=%22Generated+by+starred%22&type=Code) |
| 94 | +- Topic pages: |
| 95 | + - [starred](https://github.com/topics/starred) |
| 96 | + - [awesome-stars](https://github.com/topics/awesome-stars) |
93 | 97 |
|
94 | | -1. Generate new token |
| 98 | +## Development |
95 | 99 |
|
96 | | - link: [Github Personal access tokens](https://github.com/settings/tokens) |
| 100 | +```bash |
| 101 | +uv sync --dev |
| 102 | +uv run starred --help |
| 103 | +``` |
97 | 104 |
|
98 | | -2. Install the master branch version |
| 105 | +Install from source tarball: |
99 | 106 |
|
100 | | - ```bash |
101 | | - $ uv build |
102 | | - $ pip install dist/starred-${x.x.x}.tar.gz |
103 | | - ``` |
104 | | -3. Dev & Run |
105 | | - ```bash |
106 | | - uv sync --dev |
107 | | - uv run starred --help |
108 | | - ``` |
| 107 | +```bash |
| 108 | +uv build |
| 109 | +pip install dist/starred-<version>.tar.gz |
| 110 | +``` |
0 commit comments