0

I'm using pygithub3 to call an api to receive an organization's repositories, but am getting this result:

<pygithub3.core.result.smart.Result object at 0x7f97e9c03d50>

I believe this is a buffer object. Why is this happening? I want the result to be

['express-file', 'users']

My code looks somewhat like this:

import pygithub3

auth = dict(username="******", password="******") # I hashed these for SO.
gh = pygithub3.Github(**auth)

repos = gh.repos.list_by_org(org="incrosoft", type="all")
print repos

How would I get my desired output? Is it possible? Is there something to turn it into my desired array?

Scott Mermelstein
  • 15,174
  • 4
  • 48
  • 76
baranskistad
  • 2,176
  • 1
  • 21
  • 42

1 Answers1

1

If you look at the docstring of the Result class, you'll see that one can obtain a list by calling your_result.all().

If you type help(pygithub3.core.result.smart.Result) in your Python interpreter session (with pygithub3 imported), you'll see this docstring printed, so you don't need to check the source each time.

ForceBru
  • 43,482
  • 10
  • 63
  • 98
  • Ok, that gave me a list, `[, ]`, but it's still in a Buffer. How do I De-Buffer it? – baranskistad Aug 19 '16 at 17:20
  • @bjskistad, what kind of 'buffer' are you talking about? Please [read the docs](http://pygithub3.readthedocs.io/en/latest/index.html#) first. – ForceBru Aug 19 '16 at 17:30
  • Instead of appearing as strings, they are appearing as the, thing, in the list I just specified. – baranskistad Aug 19 '16 at 17:32
  • @bjskistad, well, there's no other way to know how to convert a `Repo` to a string except simply wandering through the docs and then through the code. Right now, I don't see any kind of `__str__` method or `name` member variable in the `Repo` class. – ForceBru Aug 19 '16 at 17:41