Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

github3.py

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 will likely be some changes which change behavior in the near future.

Installation

$ pip install github3.py

Dependencies

Every-day Use

Testing

License

Modified BSD license

Examples

See the docs for more detailed examples.

>>> from github3 import login
>>> gh = login(username, password)
>>> issue = gh.issue('sigmavirus24', 'Todo.txt-python', 17)
>>> issue.html_url
u'https://github.com/sigmavirus24/Todo.txt-python/issues/17'
>>> issue.state
u'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].event
u'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')
>>> sha
u'57fad9a39b27e5eb4700f66673ce860b65b93ab8'
>>> blob = repo.blob(sha)
>>> blob.content
u'VGVzdGluZyBibG9iIGNyZWF0aW9u\n'
>>> blob.decoded
u'Testing blob creation'
>>> blob.encoding
u'base64'
>>> from github3 import login
>>> g = login(username, password)
>>> repo = g.repository('sigmavirus24', 'github3.py')
>>> tag = repo.tag('cdba84b4fede2c69cb1ee246b33f49f19475abfa')
>>> tag
<Tag [cdba84b4fede2c69cb1ee246b33f49f19475abfa]>
>>> tag.object.sha
u'24ea44d302c6394a0372dcde8fd8aed899c0034b'
>>> tag.object.type
u'commit'

Contributing

Please see the section 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 place on Travis, run:

make travis
# or
make tests

To test how much of the library is covered:

make coverage_auth
# equivalently
make coverage_all
# or without authentication
make coverage

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

coverage report
Name                 Stmts   Miss  Cover
----------------------------------------
github3/__init__         8      0   100%
github3/api             50      0   100%
github3/decorators      18      0   100%
github3/events          89      0   100%
github3/gists           94      0   100%
github3/git             93      0   100%
github3/github         335     53    84%
github3/issues         192      2    99%
github3/legacy          97      0   100%
github3/models         173      0   100%
github3/orgs           153      0   100%
github3/pulls          124      6    95%
github3/repos          644    119    82%
github3/users          132      4    97%
----------------------------------------
TOTAL                 2202    184    92%

Author

Ian Cordasco (sigmavirus24)

Contact Options

  • You may contact (via email) the author directly with questions/suggestions

  • You may send your email to github3.py@librelist.com

History/Changelog

0.1: 2012-11-xx

  • Support for the complete GitHub API (accomplished)

    • Now also includes the Statuses API

    • Also covers the auto_init parameters to the Repository creation methodology

    • Limited implementation of iterators in the place of list functions.

  • 92% coverage by unit tests

Metadata

Release files for github3.py 0.1a8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for github3.py 0.1a8
File Size Uploaded Provenance Actions
github3.py-0.1a8.tar.gz 42.3 kB Without provenance Details for github3.py-0.1a8.tar.gz

Release files / github3.py-0.1a8.tar.gz

Download URL github3.py-0.1a8.tar.gz
Size 42.3 kB
Tags Source
SHA-256 checksum
How to use checksums
34871f7860989f7ced21288ea9a4a1b4397a3bb4086885853f4262f60e462d48
BLAKE2b-256 checksum
How to use checksums
47d7498cd0dabaf87e59e8a7f8207b627238cd17a949be1d1c8e4ce553e80a8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for github3.py 0.1a8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page