-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
readme.md
55 lines (36 loc) 路 1.2 KB
/
readme.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Getting Started
## The AT Protocol SDK
> 鈿狅笍 Under construction. Until the 1.0.0 release compatibility between versions is not guaranteed.
Code snippet:
```python
from atproto import Client, client_utils
def main():
client = Client()
profile = client.login('my-handle', 'my-password')
print('Welcome,', profile.display_name)
text = client_utils.TextBuilder().text('Hello World from ').link('Python SDK', 'https://atproto.blue')
post = client.send_post(text)
client.like(post.uri, post.cid)
if __name__ == '__main__':
main()
```
<details>
<summary>Code snippet of async version</summary>
```python
import asyncio
from atproto import AsyncClient, client_utils
async def main():
client = AsyncClient()
profile = await client.login('my-handle', 'my-password')
print('Welcome,', profile.display_name)
text = client_utils.TextBuilder().text('Hello World from ').link('Python SDK', 'https://atproto.blue')
post = await client.send_post(text)
await client.like(post.uri, post.cid)
if __name__ == '__main__':
# use run() for a higher Python version
asyncio.get_event_loop().run_until_complete(main())
```
</details>
```{toctree}
readme.content.md
```