{"id":26206962,"url":"https://github.com/thatsinewave/github-inventory","last_synced_at":"2026-02-23T13:33:22.389Z","repository":{"id":281949168,"uuid":"946966323","full_name":"ThatSINEWAVE/GitHub-Inventory","owner":"ThatSINEWAVE","description":"Python script that helps you fetch and organize your GitHub repositories into a clean, human-readable report","archived":false,"fork":false,"pushed_at":"2025-03-12T01:09:19.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T09:38:24.671Z","etag":null,"topics":["github-api","github-api-integration","github-api-v3","github-to-markdown","github-to-text","github-tool","github-tools","good-first-bug","good-first-contribution","good-first-issue","good-first-issues","good-first-pr","good-first-pr-first-contribution","good-first-prs","open-source","opensource","python-3","python-script","python-tool","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThatSINEWAVE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ThatSINEWAVE","ko_fi":"thatsinewave"}},"created_at":"2025-03-12T00:29:16.000Z","updated_at":"2025-03-12T01:09:28.000Z","dependencies_parsed_at":"2025-03-12T02:24:26.548Z","dependency_job_id":"55088150-f2d1-49bb-8ede-b5eb275c78d7","html_url":"https://github.com/ThatSINEWAVE/GitHub-Inventory","commit_stats":null,"previous_names":["thatsinewave/github-inventory"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThatSINEWAVE/GitHub-Inventory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatSINEWAVE%2FGitHub-Inventory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatSINEWAVE%2FGitHub-Inventory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatSINEWAVE%2FGitHub-Inventory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatSINEWAVE%2FGitHub-Inventory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThatSINEWAVE","download_url":"https://codeload.github.com/ThatSINEWAVE/GitHub-Inventory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThatSINEWAVE%2FGitHub-Inventory/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264324674,"owners_count":23590934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-api","github-api-integration","github-api-v3","github-to-markdown","github-to-text","github-tool","github-tools","good-first-bug","good-first-contribution","good-first-issue","good-first-issues","good-first-pr","good-first-pr-first-contribution","good-first-prs","open-source","opensource","python-3","python-script","python-tool","python3"],"created_at":"2025-03-12T05:18:54.647Z","updated_at":"2026-02-23T13:33:22.356Z","avatar_url":"https://github.com/ThatSINEWAVE.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n# GitHub Inventory\n\nGitHub Inventory is a Python script that helps you fetch and organize your GitHub repositories into a clean, human-readable report. The script pulls data from the GitHub API, formats it into both text and markdown formats, and saves it in separate files. It also logs important actions and provides status updates for the process. This is useful for quickly reviewing and sharing your GitHub repositories with others or maintaining an inventory of your work.\n\n\u003c/div\u003e\n\n## Features\n\n- Fetches repository data from GitHub using the GitHub API.\n- Generates two types of output:\n  - Text format (.txt)\n  - Markdown format (.md)\n- Creates necessary directories if they do not exist.\n- Saves output files in separate directories for easy management.\n- Logs all actions with timestamps, including directory creation and repository fetching.\n- Handles both public and private repositories.\n- Outputs summary statistics such as the total number of repositories, public and private counts.\n\n\u003cdiv align=\"center\"\u003e\n\n## ☕ [Support my work on Ko-Fi](https://ko-fi.com/thatsinewave)\n\n\u003c/div\u003e\n\n## Requirements\n\n- Python 3.x\n- `requests` library: Used to interact with the GitHub API.\n- `python-dotenv` library: Used to load environment variables from a `.env` file.\n\n## Setup\n\n1. Clone this repository or download the script files.\n2. Install the required dependencies:\n   ```bash\n   pip install requests python-dotenv\n   ```\n\n3. Create a `.env` file in the project directory and add your GitHub credentials:\n   ```\n   GITHUB_TOKEN=your_personal_access_token\n   GITHUB_USERNAME=your_github_username\n   ```\n   - **GITHUB_TOKEN**: A personal access token generated from your GitHub account. Follow [this guide](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) to create one.\n   - **GITHUB_USERNAME**: Your GitHub username.\n\n## How to Get a GitHub API Token\n\nIn order to use this script, you need a GitHub Personal Access Token (PAT). Follow these steps to generate one:\n\n1. **Log into your GitHub account**:\n   - Open your web browser and go to [GitHub](https://github.com/).\n   - Log in with your GitHub credentials.\n\n2. **Go to the Developer settings**:\n   - Once logged in, click on your profile icon in the top-right corner.\n   - Select **Settings** from the dropdown menu.\n   - In the left-hand sidebar, scroll down and click on **[Developer settings](https://github.com/settings/apps)**.\n\n3. **Generate a new token**:\n   - Under **Developer settings**, click on **[Personal access tokens](https://github.com/settings/tokens)**.\n   - Click on the **Generate new token** button.\n\n4. **Set token permissions**:\n   - In the **Note** field, give your token a descriptive name (e.g., \"GitHub Inventory Script\").\n   - Under **Select scopes**, choose the necessary permissions for your token. For fetching repository data, at least the following scopes are required:\n     - **repo**: Grants full control of private repositories.\n     - **read:org**: Allows reading organization membership data.\n   - Optionally, you can choose additional scopes if your script needs to access more specific data.\n\n5. **Generate and save the token**:\n   - Once you’ve selected the necessary permissions, click the **Generate token** button.\n   - GitHub will display your new token. **Make sure to copy it immediately**, as it will not be shown again.\n\n6. **Add the token to your `.env` file**:\n   - Open your project directory and create a `.env` file if you haven’t already.\n   - Add the following line to the file, replacing `your_personal_access_token` with the token you just copied:\n     ```bash\n     GITHUB_TOKEN=your_personal_access_token\n     ```\n\n## Usage\n\n1. Run the script from your terminal:\n   ```bash\n   python github_inventory.py\n   ```\n\n2. The script will:\n   - Fetch your repositories from GitHub.\n   - Check if necessary output folders exist (creating them if they don’t).\n   - Generate two output files:\n     - `text_output_TIMESTAMP.txt`: A plain-text summary of your repositories.\n     - `markdown_output_TIMESTAMP.md`: A markdown formatted summary of your repositories.\n   - Logs will be saved in the `logs/` directory.\n\n\u003cdiv align=\"center\"\u003e\n\n## [Join my discord server](https://discord.gg/2nHHHBWNDw)\n\n\u003c/div\u003e\n\n## Example Output\n\n### Text Output Example\n\n```\nGitHub Inventory Report\nTotal Repositories: 5\nPublic Repos: 3\nPrivate Repos: 2\n\n- Repo 1 (Public)\n  Description for Repo 1\n\n- Repo 2 (Private)\n  Description for Repo 2\n\n...\n```\n\n### Markdown Output Example\n\n```markdown\n# GitHub Inventory Report\n**Total Repositories:** 5  \n**Public Repos:** 3  \n**Private Repos:** 2  \n\n### Repo 1 (Public)\nDescription for Repo 1\n\n### Repo 2 (Private)\nDescription for Repo 2\n\n...\n```\n\n## Logs\n\nLogs of the script’s operations are stored in the `logs/` directory with filenames following this format: `log_TIMESTAMP.txt`. These logs contain detailed information on the script’s actions, including directory checks, repo fetch status, and file creation.\n\n## Contributing\n\nAs this project is in early development, please reach out before submitting pull requests. All contributions are welcome!\n\n## License\n\nThis project is open-source and available under the MIT License. See [LICENSE](LICENSE) for more details.\n","funding_links":["https://github.com/sponsors/ThatSINEWAVE","https://ko-fi.com/thatsinewave"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthatsinewave%2Fgithub-inventory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthatsinewave%2Fgithub-inventory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthatsinewave%2Fgithub-inventory/lists"}