Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python library for interfacing with the GitHub APIv3

License

NotificationsYou must be signed in to change notification settings

github3py/github3py

 
 

Repository files navigation

Build Status

Eventually this will be a python module to access the GitHub v3 API.

This is not stable yet and there is no backwards compatibility yet. There willlikely be some changes which change behavior in the near future.

Installation

$ pip install github3.py

Dependencies

Every-day Use

Testing

License

Modified BSDlicense

Examples

See thedocs for more detailed examples.

>>> from github3 import login>>> gh = login(username, password)>>> issue = gh.issue('sigmavirus24', 'Todo.txt-python', 17)>>> issue.html_urlu'https://github.com/sigmavirus24/Todo.txt-python/issues/17'>>> issue.stateu'open'>>> events = issue.list_events()>>> events[<Issue Event [#17 - subscribed - sigmavirus24]>, <Issue Event [#17 - assigned - sigmavirus24]>, <Issue Event [#17 - referenced - sigmavirus24]>]>>> events[0].actor<User [sigmavirus24:None]>>>> events[0].issue<Issue [sigmavirus24/Todo.txt-python #17]>>>> events[0].closed_at>>> events[0].eventu'subscribed'
>>> from github3 import login>>> g = login(username, password)>>> repo = g.repository('sigmavirus24', 'Todo.txt-python')>>> sha = repo.create_blob('Testing blob creation', 'utf-8')>>> shau'57fad9a39b27e5eb4700f66673ce860b65b93ab8'>>> blob = repo.blob(sha)>>> blob.contentu'VGVzdGluZyBibG9iIGNyZWF0aW9u\n'>>> blob.decodedu'Testing blob creation'>>> blob.encodingu'base64'
>>> from github3 import login>>> g = login(username, password)>>> repo = g.repository('sigmavirus24', 'github3.py')>>> tag = repo.tag('cdba84b4fede2c69cb1ee246b33f49f19475abfa')>>> tag<Tag [cdba84b4fede2c69cb1ee246b33f49f19475abfa]>>>> tag.object.shau'24ea44d302c6394a0372dcde8fd8aed899c0034b'>>> tag.object.typeu'commit'

Contributing

Please see thesection of the documentation pertaining to this.

Testing

If you want to run the unittests with authentication, simply run:

make alltests

From the root of the repository. If you would rather see what will take placeon Travis, run:

make travis# ormake tests

To test how much of the library is covered:

make coverage_auth# equivalentlymake coverage_all# or without authenticationmake coverage

Depending on which you run, you will see different percentages reported bycoverage. As of this writing (2012-09-16),coverage_auth reports 87% ofthe library is covered and every module has coverage >= 80%.

coverage reportName                 Stmts   Miss  Cover----------------------------------------github3/__init__         8      0   100%github3/api             50      0   100%github3/decorators      13      0   100%github3/events          89      0   100%github3/gists           92      0   100%github3/git             94      0   100%github3/github         304     61    80%github3/issues         189     28    85%github3/legacy          97      0   100%github3/models         165     11    93%github3/orgs           148     30    80%github3/pulls          120     12    90%github3/repos          646    115    82%github3/users          126     19    85%----------------------------------------TOTAL                 2141    276    87%

Author

Ian Cordasco (sigmavirus24)

Contact Options

  • You may contact (via email) the author directly with questions/suggestions
  • You may send your email togithub3.py@librelist.com

About

Python library for interfacing with the GitHub APIv3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python100.0%

[8]ページ先頭

©2009-2025 Movatter.jp