osgithub 0.3.5__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osgithub
3
- Version: 0.3.5
3
+ Version: 0.5.0
4
4
  Summary: UNKNOWN
5
5
  Home-page: https://github.com/opensafely-core/osgithub
6
6
  Author: OpenSAFELY
@@ -434,6 +434,32 @@ class GithubRepo:
434
434
  "date": content["committer"]["date"],
435
435
  }
436
436
 
437
+ def get_contributors(self):
438
+ """
439
+ Gets contributors to the repo
440
+
441
+ Returns:
442
+ List of strings, each representing a contributor's login
443
+ """
444
+ path_segments = [*self.repo_path_segments, "contributors"]
445
+ content = self.client.get_json(path_segments)
446
+ contrib_list = [contrib["login"] for contrib in content]
447
+ return contrib_list
448
+
449
+ def get_topics(self):
450
+ """
451
+ Gets the repo's topics.
452
+
453
+ If the repo's name and about are also being fetched from GitHub,
454
+ consider setting `use_cache` to True in the GithubClient to avoid
455
+ duplicate calls to the repo endpoint.
456
+
457
+ Returns:
458
+ list[str]: list of topics
459
+ """
460
+ content = self.client.get_json(self.repo_path_segments)
461
+ return content["topics"]
462
+
437
463
  def clear_cache(self):
438
464
  """Clears all request cache urls for this repo"""
439
465
  cached_urls = self.client.session.cache.urls()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: osgithub
3
- Version: 0.3.5
3
+ Version: 0.5.0
4
4
  Summary: UNKNOWN
5
5
  Home-page: https://github.com/opensafely-core/osgithub
6
6
  Author: OpenSAFELY
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes