This part of the documentation covers the Authorization object.

class github3.auths.Authorization(auth, session=None)

The Authorization object.

Two authorization instances can be checked like so:

a1 == a2
a1 != a2

And is equivalent to: == !=

See also:

app = None

Details about the application (name, url)

created_at = None

datetime object representing when the authorization was created.


delete this authorization


Return an instance of cls formed from json.

id = None

Unique id of the authorization

name = None

App name

note = None

Note about the authorization

note_url = None

URL about the note


Number of requests before GitHub imposes a ratelimit.


Re-retrieve the information for this object and returns the refreshed instance.

Parameters:conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs

The reasoning for the return value is the following example:

repos = [r.refresh() for r in g.iter_repos('kennethreitz')]

Without the return value, that would be an array of None‘s and you would otherwise have to do:

repos = [r for i in g.iter_repos('kennethreitz')]
[r.refresh() for r in repos]

Which is really an anti-pattern.

Changed in version 0.5.

scopes = None

List of scopes this applies to


Return the json representing this object.

token = None

Returns the Authorization token

update(scopes=[], add_scopes=[], rm_scopes=[], note=u'', note_url=u'')

Update this authorization.

  • scopes (list) – (optional), replaces the authorization scopes with these
  • add_scopes (list) – (optional), scopes to be added
  • rm_scopes (list) – (optional), scopes to be removed
  • note (str) – (optional), new note about authorization
  • note_url (str) – (optional), new note URL about this authorization


updated_at = None

datetime object representing when the authorization was updated.