PyGithub repository.get_pulls parameter options?

813 Views Asked by At

I'm using Python's PyGithub library and want to get a list of closed prs in order from the ones most recent closed to the oldest ones closed. However, the PyGithub documentation doesn't show what options I have available for the parameters (specifically the variables available for "sorted"). How might I go about doing this? Would it be sorted=newest or something like that?

2

There are 2 best solutions below

0
On
get_pulls(state=NotSet, sort=NotSet, direction=NotSet, base=NotSet, head=NotSet)

Calls: GET /repos/{owner}/{repo}/pulls

Parameters: 
state – string
sort – string
direction – string
base – string
head – string

Return type:
github.PaginatedList.PaginatedList of github.PullRequest.PullRequest

0
On

This reply should answer it for ya: https://github.com/PyGithub/PyGithub/issues/2233#issuecomment-1130520989

Based on the GitHub docs you can use sort="created" sort="updated" etc

Can be one of: created, updated, popularity, long-running