https://github.com/basemax/github-name-friends
A simple Python tool that generates a list of your GitHub friends with their profile links, names, followers, and more. The tool fetches data from GitHub profiles, formats it in multiple output formats (Markdown, HTML, JSON, CSV), and allows you to sort users by name or followers.
https://github.com/basemax/github-name-friends
api friend gh github github-api github-profile github-username py python python3 sort
Last synced: 5 months ago
JSON representation
A simple Python tool that generates a list of your GitHub friends with their profile links, names, followers, and more. The tool fetches data from GitHub profiles, formats it in multiple output formats (Markdown, HTML, JSON, CSV), and allows you to sort users by name or followers.
- Host: GitHub
- URL: https://github.com/basemax/github-name-friends
- Owner: BaseMax
- License: mit
- Created: 2025-05-09T16:43:12.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-05-09T16:56:25.000Z (5 months ago)
- Last Synced: 2025-05-12T02:09:42.925Z (5 months ago)
- Topics: api, friend, gh, github, github-api, github-profile, github-username, py, python, python3, sort
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Name Friends
A simple Python tool that generates a list of your GitHub friends with their profile links, names, followers, and more. The tool fetches data from GitHub profiles, formats it in multiple output formats (Markdown, HTML, JSON, CSV), and allows you to sort users by name or followers.
## Features
- Fetches GitHub profile data (name, followers, location, bio, etc.)
- Supports input from a file or command line
- Sort users by name or followers
- Output in Markdown, HTML, JSON, and CSV formats## Installation
1. Clone the repository:
```bash
git clone https://github.com/BaseMax/github-name-friends.git
```2. Install dependencies:
```bash
pip install -r requirements.txt
```3. Create a .env file with your GitHub token (optional but recommended for higher API limits):
```plaintext
GITHUB_TOKEN=your_github_token
```## Usage
### Command-Line Arguments
- `-f`, `--file`: Input file containing GitHub usernames or profile URLs (one per line).
- `usernames`: GitHub usernames or profile URLs directly passed as arguments.
- `-v`, `--verbose`: Enable verbose output (for debugging).
- `--include-orgs`: Include organization accounts.
- `--sort-by`: Sort users by name or followers (default: name).
- `--out-dir`: Directory to save the output files (default: current directory).## Example Usage
### 1. Using a file:
```bash
$ python github_friends.py -f friends.txt
```### 2. Using a list of usernames:
```bash
$ python github_friends.py user1 user2 user3
```### 3. Enabling verbose output:
```bash
$ python github_friends.py user1 -v
```### 4. Sorting by followers:
```bash
$ python github_friends.py user1 user2 --sort-by followers
```## Output
The tool will generate the following files in the output directory:
- `friends.md`: A Markdown file with a list of your friends' GitHub profile links.
- `friends.html`: An HTML file with a list of your friends' GitHub profile links.
- `friends.json`: A JSON file containing detailed information about the users.
- `friends.csv`: A CSV file with basic profile information.### Example Output (Markdown)
```markdown
# My Friends- [John Doe](https://github.com/johndoe)
- [Jane Smith](https://github.com/janesmith)
```### Example Output (HTML)
```html
My Friends
body{font-family:sans-serif;padding:20px;}a{color:#0366d6;text-decoration:none;}li{margin:5px 0;}
My Friends
```
### License
MIT License - Copyright (c) 2025 Max Base