{"id":19298210,"url":"https://github.com/casbin/readme-checker","last_synced_at":"2025-12-11T19:03:02.811Z","repository":{"id":240354495,"uuid":"802152895","full_name":"casbin/readme-checker","owner":"casbin","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-18T07:54:40.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T22:37:48.868Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casbin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"casbin"}},"created_at":"2024-05-17T16:09:20.000Z","updated_at":"2024-05-18T07:54:44.000Z","dependencies_parsed_at":"2024-05-18T08:47:01.641Z","dependency_job_id":null,"html_url":"https://github.com/casbin/readme-checker","commit_stats":null,"previous_names":["casbin/readme-checker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Freadme-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Freadme-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Freadme-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Freadme-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin","download_url":"https://codeload.github.com/casbin/readme-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242900108,"owners_count":20203708,"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":[],"created_at":"2024-11-09T23:07:15.945Z","updated_at":"2025-12-11T19:02:57.777Z","avatar_url":"https://github.com/casbin.png","language":"Python","funding_links":["https://github.com/sponsors/casbin"],"categories":[],"sub_categories":[],"readme":"# readme-checker\n\nThis script scans all repositories in a specified GitHub organization for a specific keyword in their README files. It uses the GitHub API to fetch repository information and README content.\n\n## Requirements\n\n- Python 3.x\n- `requests` library\n\nYou can install the `requests` library using pip:\n\n```bash\npip install requests\n```\n\n## Usage\n\n### 1. Clone the Repository\n\nFirst, clone the repository to your local machine:\n\n```bash\ngit clone \u003crepository-url\u003e\n```\n\n### 2. Set Up Your Environment\n\nBefore running the script, you need to set up your environment by providing the required parameters:\n\n- **Organization Name**: The name of the GitHub organization you want to scan.\n- **Keyword**: The keyword you want to search for in the README files.\n- **GitHub Token**: Your GitHub API token for authentication.\n\n### 3. Run the Script\n\nOpen the **`main.py`** file and replace the placeholder values with your actual data:\n\n```python\nif __name__ == \"__main__\":\n    # Replace here with the organization name and keywords you need to scan, as well as your GitHub token.\n    org_name = \"jcasbin\"  # Please fill in the name of the organization you need to scan here.\n    keyword = \"[![Gitter]\"  # Please enter the keywords you are looking for here.\n    token = \"ghp_**********\"  # Please fill in your GitHub token here.\n    main(org_name, keyword, token)\n```\n\n### 4. Execute the Script\n\nRun the script using Python:\n\n```bash\npython main.py\n```\n\n## Script Description\n\n### `get_repos(org_name, headers)`\n\nFetches all repositories of a given organization.\n\n- **`org_name`**: The name of the organization.\n- **`headers`**: Headers for the HTTP request, including the authorization token.\n\n### `get_readme(repo, headers)`\n\nFetches the README file content for a given repository.\n\n- **`repo`**: The repository object.\n- **`headers`**: Headers for the HTTP request, including the authorization token.\n\n### `main(org_name, keyword, token)`\n\nMain function to scan all repositories and search for the keyword in their README files.\n\n- **`org_name`**: The name of the organization.\n- **`keyword`**: The keyword to search for in the README files.\n- **`token`**: Your GitHub API token for authentication.\n\n### Output\n\nThe script will output the following information:\n\n1. The URL of each README file (or \"Not Found\" if the README does not exist).\n2. The name of the repository if the keyword is found in its README file.\n3. The total number of scanned repositories.\n4. The total number of repositories containing the keyword.\n5. A list of repositories containing the keyword (if any).\n\n## Example Output\n\n```markdown\nREADME URL: https://github.com/jcasbin/example-repo/blob/main/README.md\nRepository: example-repo contains [![Gitter] in its README.md\n================================================================================\nTotal scanned repositories: 10\nTotal repositories containing '[![Gitter]': 2\nRepositories containing the keyword:\n\n- example-repo1\n- example-repo2\n```\n\n## **Notes**\n\n- Ensure your GitHub token has the necessary permissions to access the repositories of the specified organization.\n- The **`per_page=100`** parameter is used to fetch up to 100 repositories per API call. If the organization has more than 100 repositories, the script will handle pagination automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Freadme-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin%2Freadme-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Freadme-checker/lists"}