Skip to main content

github repo watching client .

Project description

# Repo Watching

Github repos watching framework

## Install

pip install watching

## Simple Usage

function `ctx.upsert_file_and_pr` is a helper to update or create file and create pull request .

watcher = Watcher({
'github_access_token': ACCESS_TOKEN,

def license_middleware(ctx: Context):
branch = 'watcher_license_create'
path = '/LICENSE'
new_content = 'MIT\n\ncreated by joway'
message = 'add MIT license'
pr_title = 'Init: MIT License'
pr_body = '- create MIT License'

file_branch = 'master'

path=path, content=new_content, branch=branch,
should_upsert=lambda new, old: new != old, message=message,
pr_title=pr_title, pr_body=pr_body,

def other_middleware(ctx: Context):

def filter_func(repo: Repo):
if == 'repo-watching-demo':
return True

# task chain , it will be executed by every repo
watcher.use(license_middleware, other_middleware)

# filter the repos you need
repos = watcher.get_all_repos(filter_func=filter_func)

# listen repos

# traverse all repos you listened


## Advanced Usage

# get commit list

# access your github username | org name

# create file
# update file
# get file
# create branch
# create pr

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for watching, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size watching-0.0.4.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page