GitHub Repo Manager is a Python application designed to simplify the management of GitHub repositories. It provides functionality to create, list, and manage GitHub repositories programmatically using the GitHub API. This tool is ideal for developers who need to automate GitHub repository operations or integrate them into their workflows.
- Create GitHub Repositories: Programmatically create new repositories on GitHub.
- Manage Repository Settings: Update repository details and settings.
- List Repositories: Retrieve and display information about repositories.
- Enhanced Logging: Detailed logging of operations and errors.
- Python 3.9+: Ensure you have Python 3.9 or later installed.
- GitHub Account: You need a GitHub account with a Personal Access Token (PAT) for authentication.
- Docker: Optional, for running the application in a Docker container.
-
Clone the Repository:
git clone git@github.com:YourUsername/github_repo_manager.git cd github_repo_manager
-
Set Up a Virtual Environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables:
Create a
.env
file in the root directory of the project and add your GitHub Personal Access Token:GITHUB_TOKEN=your_personal_access_token
-
Create a New Repository:
from github_repo_manager.github import create_github_repo create_github_repo("new-repo-name", "Description of the new repository")
-
List All Repositories:
from github_repo_manager.github import list_github_repos repos = list_github_repos() for repo in repos: print(repo['name'])
-
Build the Docker Image:
docker build -t github_repo_manager .
-
Run the Docker Container:
docker run -it --rm \ -e GITHUB_TOKEN=your_personal_access_token \ github_repo_manager
Replace
your_personal_access_token
with your actual GitHub PAT. The-it
flag runs the container in interactive mode, and--rm
ensures the container is removed after it exits.
To ensure the application is working correctly, run the unit tests:
python3 -m unittest discover -s tests
Contributions are welcome! Please follow these steps to contribute:
- Fork the Repository: Create your own fork of the repository on GitHub.
- Create a Branch: Create a new branch for your changes.
- Make Changes: Implement your changes and write tests.
- Submit a Pull Request: Push your changes to your fork and open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or support, please contact Amit Singh.
Note: Replace placeholder text (like your_personal_access_token
, YourUsername
, etc.) with your actual information.
GitHub Repo Manager is developed and maintained by Amits64.
-
Docker Build and Run Instructions: These instructions are included for those who prefer using Docker to run the application. Make sure your
Dockerfile
is correctly set up to copy the required files and set up the environment. -
Environment Variables in Docker: Using the
-e
flag to pass the GitHub PAT as an environment variable ensures that sensitive information is not hardcoded into the Docker image.
Feel free to adjust the file based on any additional details or specific instructions relevant to your project.