Github回购管理
github-repo的Python项目详细描述
安装
$ [sudo] pip install github-repo
配置
$ exportGITHUB_TOKEN="xxx"
$ cd path/to/repo
>>>os.environ["GITHUB_TOKEN"]="xxx">>>os.chdir("path/to/repo")
函数
function | ^{ |
---|---|
^{ | create github repo |
^{ | return fullname (owner/repo) string |
^{ | requests.request |
^{ | return repo description |
^{ | update repo description |
^{ | return repo homepage |
^{ | update repo homepage |
^{ | ^{ |
^{ | return git remote tuple (name, url) |
^{ | return git remote name |
^{ | ^{ |
^{ | return git remote url |
^{ | add topics |
^{ | return topics list |
^{ | replace all topics |
CLI
usage | ^{ |
---|---|
^{ | open github repo in browser |
^{ | create github repo |
^{ | get/update description |
^{ | print fullname (owner/repo) |
^{ | get/update homepage |
^{ | print git remote name |
^{ | ^{ |
^{ | print git remote url |
^{ | add topics to repository |
^{ | print repository topics |
^{ | remove repository topics |
^{ | repository topics |
示例
cli
$ git remote add github git@github.com:owner/repo.git
$ python -m github_repo.remote.name
github
$ python -m github_repo.remote.url
git@github.com:owner/repo.git
$ python -m github_repo.fullname
owner/repo
$ python -m github_repo.remote.rm # git remote rm github
$ python -m github_repo.description "new description"
$ python -m github_repo.description
new description
$ python -m github_repo.homepage "https://user.github.io/"
$ python -m github_repo.homepage
https://user.github.io/
$ python -m github_repo.topics.add "python""pypi" $ python -m github_repo.topics.get python pypi $ python -m github_repo.topics.update "node""npm" $ python -m github_repo.topics.rm
功能
>>>github_repo.remote.add("github","git@github.com:owner/repo.git")>>>github_repo.remote.get()or(None,None)('github','git@github.com:owner/repo.git')>>>github_repo.remote.name()'github'>>>github_repo.remote.url()'git@github.com:owner/repo.git'>>>github_repo.fullname()'owner/repo'>>>github_repo.remote.rm()
>>>github_repo.description.update('new description')>>>github_repo.description.get()'new description'
>>>github_repo.homepage.update('https://user.github.io/')>>>github_repo.homepage.get()'https://user.github.io/'
>>>github_repo.topics.add(['python','pypi'])>>>github_repo.topics.get()['python','pypi']>>>github_repo.topics.replace(['node','npm'])>>>github_repo.topics.rm()
readme-md-readme.md生成器