Skip to content

Commit c839582

Browse files
committed
readme update
1 parent 8fe9ba6 commit c839582

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ GITHUB_TOKEN=your_github_token_here
3131

3232
```py
3333
import asyncio
34-
from asyncpygithub import User
34+
from asyncPyGithub import GitHubUserPortal
3535

3636
async def main():
37-
status, user = await User.authenticate()
37+
status, user = await GitHubUserPortal.authenticate()
3838
if status == 200:
3939
print(f"Hello, {user.login}!")
4040
else:
@@ -50,25 +50,30 @@ Calling multiple methods with little to no overlap benefit greatly from concurre
5050
For example, we can call these (3) methods one by one:
5151

5252
```py
53-
from asyncpygithub import User
53+
from asyncPyGithub import GitHubUserPortal
5454

5555
async def one_by_one_example() ->None:
56-
await User.get_by_id( ... )
57-
await User.get_by_username( ... )
58-
await User.all( ... )
59-
56+
await GitHubUserPortal.get_by_id( ... )
57+
await GitHubUserPortal.get_by_username( ... )
58+
await GitHubUserPortal.all( ... )
59+
6060
...
6161
```
6262

6363
However, this is no better than the synchronous equivalent.
6464
To get the full benefits, we can use `asyncio.gather` like so:
6565

6666
```py
67+
from asyncPyGithub import GitHubUserPortal
68+
6769
async def async_gathered_example() -> None:
68-
awaitables:list[CoroutineType[Any, Any, UserQueryReturnable]] = (
69-
User.get_by_id( ... )
70-
User.get_by_username( ... )
71-
User.all( ... )
72-
)
70+
awaitables: list[CoroutineType[Any, Any, UserQueryReturnable]] = [
71+
GitHubUserPortal.get_by_id( ... ),
72+
GitHubUserPortal.get_by_username( ... ),
73+
GitHubUserPortal.all( ... ),
74+
]
7375
results = await asyncio.gather(*awaitables)
76+
77+
...
7478
```
79+
File renamed without changes.

0 commit comments

Comments
 (0)