File size: 419 Bytes
185f702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
import github
from dataclasses import dataclass

@dataclass
class GitHubRepo:
    """Represents a GitHub repository"""
    name: str
    description: str
    private: bool

def create_repo(token: str, repo: GitHubRepo) -> str:
    """Creates a new GitHub repository"""
    g = github.Github(token)
    repo = g.get_user().create_repo(repo.name, repo.description, private=repo.private)
    return repo.html_url