1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-18 15:05:08 +00:00

Adding fetching orgs

This commit is contained in:
VarMonke 2022-03-29 19:42:29 +05:30
parent 6c8e5cec0e
commit 45db6d5120
4 changed files with 23 additions and 5 deletions

View file

@ -128,4 +128,13 @@ async def get_repo_from_name(session: aiohttp.ClientSession, owner: str, repo_na
result = await session.get(REPO_URL.format(owner, repo_name))
if result.status == 200:
return await result.json()
raise RepositoryNotFound
raise RepositoryNotFound
# org-related functions / utils
async def get_org(session: aiohttp.ClientSession, org_name: str):
"""Returns an org's public data in JSON format."""
result = await session.get(ORG_URL.format(org_name))
if result.status == 200:
return await result.json()
raise OrganizationNotFound