|
1 | | -# Development Seed contributor network |
| 1 | +# Development Seed Contributor Network |
2 | 2 |
|
3 | 3 | The code behind <https://developmentseed.org/contributor-network>. |
4 | 4 |
|
5 | 5 |  |
6 | 6 |
|
7 | | -This visual is derived from the excellent <https://github.com/nbremer/ORCA/tree/main/top-contributor-network>. |
| 7 | +This visual is derived from the excellent [ORCA top-contributor-network](https://github.com/nbremer/ORCA/tree/main/top-contributor-network) by Nadieh Bremer. |
8 | 8 |
|
9 | | -## Rebuilding |
| 9 | +## Quick Start |
10 | 10 |
|
11 | | -We use [workflow dispatch](https://github.com/developmentseed/contributor-network/actions/workflows/build.yml) to rebuild the source data. |
12 | | -Right now this is manual, but eventually we'd like to set this up on a schedule: <https://github.com/developmentseed/contributor-network/issues/8>. |
| 11 | +### Prerequisites |
13 | 12 |
|
14 | | -## Development |
| 13 | +- [uv](https://docs.astral.sh/uv/getting-started/installation/) for Python package management |
| 14 | +- A GitHub personal access token with `public_repo` scope |
15 | 15 |
|
16 | | -To view things locally: |
| 16 | +### View Locally |
17 | 17 |
|
18 | 18 | ```shell |
19 | | -python -m http.server |
| 19 | +cd dist |
| 20 | +python -m http.server 8000 |
20 | 21 | ``` |
21 | 22 |
|
22 | | -This will open the page on <http://localhost:8000/>. |
| 23 | +Then open <http://localhost:8000/>. |
| 24 | + |
| 25 | +## CLI Commands |
| 26 | + |
| 27 | +All commands are run via `uv run contributor-network <command>`. |
| 28 | + |
| 29 | +### `list-contributors` |
23 | 30 |
|
24 | | -To check the Python files, get [uv](https://docs.astral.sh/uv/getting-started/installation/), then: |
| 31 | +List all configured contributors by category: |
25 | 32 |
|
26 | 33 | ```shell |
27 | | -uv sync |
28 | | -uv run ruff check --fix |
29 | | -uv run ruff format |
30 | | -uv run pytest |
| 34 | +uv run contributor-network list-contributors |
31 | 35 | ``` |
32 | 36 |
|
33 | | -To add new repos or contributors, see [constants.py](src/devseed_contributor_network/constants.py) |
| 37 | +### `discover` |
| 38 | + |
| 39 | +Find new repositories that DevSeed employees contribute to: |
34 | 40 |
|
35 | | -### Rebuilding locally |
| 41 | +```shell |
| 42 | +export GITHUB_TOKEN="your_token_here" |
| 43 | +uv run contributor-network discover --min-contributors 2 --limit 50 |
| 44 | +``` |
36 | 45 |
|
37 | | -To build the data locally, set up [.netrc authentication for Github](https://pygithub.readthedocs.io/en/stable/examples/Authentication.html#netrc-authentication). |
38 | | -Then: |
| 46 | +This queries GitHub to find repos where multiple DevSeed employees have contributed, which are not yet in the configuration. |
| 47 | + |
| 48 | +### `data` |
| 49 | + |
| 50 | +Fetch contribution data from GitHub for all configured repositories: |
39 | 51 |
|
40 | 52 | ```shell |
| 53 | +export GITHUB_TOKEN="your_token_here" |
41 | 54 | uv run contributor-network data data |
| 55 | +``` |
| 56 | + |
| 57 | +Options: |
| 58 | +- `--all-contributors`: Include alumni/friends (not just current DevSeed employees) |
| 59 | + |
| 60 | +### `csvs` |
| 61 | + |
| 62 | +Generate CSV files from the fetched JSON data: |
| 63 | + |
| 64 | +```shell |
42 | 65 | uv run contributor-network csvs data |
| 66 | +``` |
| 67 | + |
| 68 | +### `build` |
| 69 | + |
| 70 | +Build the static site to the `dist/` folder: |
| 71 | + |
| 72 | +```shell |
43 | 73 | uv run contributor-network build data dist |
44 | 74 | ``` |
45 | 75 |
|
| 76 | +## Full Workflow |
| 77 | + |
| 78 | +To update the visualization with new data: |
| 79 | + |
| 80 | +```shell |
| 81 | +# 1. Set your GitHub token |
| 82 | +export GITHUB_TOKEN="your_token_here" |
| 83 | + |
| 84 | +# 2. (Optional) Discover new repos to add |
| 85 | +uv run contributor-network discover --min-contributors 2 |
| 86 | + |
| 87 | +# 3. Edit config.toml to add/remove repos or contributors |
| 88 | + |
| 89 | +# 4. Fetch data from GitHub |
| 90 | +uv run contributor-network data data |
| 91 | + |
| 92 | +# 5. Generate CSVs |
| 93 | +uv run contributor-network csvs data |
| 94 | + |
| 95 | +# 6. Build the site |
| 96 | +uv run contributor-network build data dist |
| 97 | + |
| 98 | +# 7. Preview locally |
| 99 | +cd dist && python -m http.server 8000 |
| 100 | +``` |
| 101 | + |
| 102 | +## Configuration |
| 103 | + |
| 104 | +Edit `config.toml` to configure: |
| 105 | + |
| 106 | +- **repositories**: List of GitHub repos to track (format: `"owner/repo"`) |
| 107 | +- **contributors.devseed**: Current DevSeed employees (format: `github_username = "Display Name"`) |
| 108 | +- **contributors.alumni**: Friends and alumni (commented out by default) |
| 109 | + |
| 110 | +## Development |
| 111 | + |
| 112 | +### Code Quality |
| 113 | + |
| 114 | +```shell |
| 115 | +uv sync |
| 116 | +uv run ruff check --fix |
| 117 | +uv run ruff format |
| 118 | +uv run pytest |
| 119 | +``` |
| 120 | + |
| 121 | +### Automated Rebuilds |
| 122 | + |
| 123 | +We use [workflow dispatch](https://github.com/developmentseed/contributor-network/actions/workflows/build.yml) to rebuild the source data manually. |
| 124 | + |
| 125 | +## Branding |
| 126 | + |
| 127 | +This visualization uses the Development Seed brand colors: |
| 128 | +- **Grenadier** (#CF3F02): Primary orange accent |
| 129 | +- **Aquamarine** (#2E86AB): Secondary blue |
| 130 | +- **Base** (#443F3F): Text color |
| 131 | + |
46 | 132 | ## License |
47 | 133 |
|
48 | 134 | This work was copied-and-modified from <https://github.com/nbremer/ORCA> and is licensed under the same (MPL). |
0 commit comments