@@ -4,12 +4,11 @@ A small simple wrapper around the [Mystb.in](https://mystb.in/) API.
44
55### Features
66
7- [ x] - ` POST ` ing to the API, which will return the provided url. \
8- [ x] - ` GET ` ting from the API, provided you know the URL or paste ID. \
9- [ x] - Ability to pass in a sync or async session / parameter so it is flexible.
10-
11- [ x] - Write a real underlying Client for this, it will be required for... \
12- [ ] - Authorization. Awaiting the API making this public as it is still WIP. \
7+ - [x] - ` POST ` ing to the API, which will return the provided url.
8+ - [x] - ` GET ` ting from the API, provided you know the URL or paste ID.
9+ - [x] - Ability to pass in a sync or async session / parameter so it is flexible.
10+ - [x] - Write a real underlying Client for this, it will be required for...
11+ - [ ] - ... Authorization. Awaiting the API making this public as it is still WIP.
1312
1413### Installation
1514This project will be on [ PyPI] ( https://pypi.org/project/mystbin.py/ ) as a stable release, you can always find that there.
@@ -35,8 +34,19 @@ import mystbin
3534
3635mystbin_client = mystbin.MystbinClient() # # api_key kwarg for authentication also
3736
38- await mystbin_client.post(" Hello from Mystb.in!" , suffix = " python" )
37+ paste = await mystbin_client.post(" Hello from Mystb.in!" , syntax = " python" )
38+ str (paste)
39+ >> > ' https://mystb.in/<your generated ID>.python'
40+
41+ paste.url
3942>> > ' https://mystb.in/<your generated ID>.python'
43+
44+ get_paste = await mystbin_client.get(" https://mystb.in/<your generated ID>" )
45+ str (paste)
46+ >> > " Hello from Mystb.in!"
47+
48+ paste.created_at
49+ >> > datetime.datetime(2020 , 10 , 6 , 10 , 53 , 57 , 556741 )
4050```
4151
4252``` py
@@ -47,7 +57,7 @@ import requests
4757sync_session = requests.Session()
4858mystbin_client = mystbin.MystbinClient(session = sync_session) # # optional api_key kwarg also
4959
50- mystbin_client.post(" Hello from sync Mystb.in!" , suffix = " text" )
60+ mystbin_client.post(" Hello from sync Mystb.in!" , syntax = " text" )
5161>> > ' https://mystb.in/<your generated ID>.text'
5262```
5363
0 commit comments