1
- # MystBin.py!
1
+ <div align =" center " >
2
+ <h1>Mystbin.py!</h1>
3
+ <a href='https://mystbinpy.readthedocs.io/en/latest/?badge=latest'>
4
+ <img src='https://readthedocs.org/projects/mystbinpy/badge/?version=latest' alt='Documentation Status' />
5
+ </a>
6
+ <a href='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Linting'>
7
+ <img src='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Linting/badge.svg?branch=main' alt='Linting status' />
8
+ </a>
9
+ <a href='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Analysis'>
10
+ <img src='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Analysis/badge.svg?branch=main' alt='Code analysis' />
11
+ </a>
12
+ <a href='https://github.com/AbstractUmbra/mystbin.py/workflows/Build'>
13
+ <img src='https://github.com/AbstractUmbra/mystbin.py/workflows/Build/badge.svg' alt='Build status' />
14
+ </a>
15
+ </div >
16
+ <br >
2
17
3
18
A small simple wrapper around the [ MystB.in] ( https://mystb.in/ ) API.
4
-
5
19
----------
6
- ![ Code Linting] ( https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Linting/badge.svg?branch=main )
7
- ![ Code Analysis] ( https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Analysis/badge.svg?branch=main )
8
- ![ Build] ( https://github.com/AbstractUmbra/mystbin.py/workflows/Build/badge.svg )
9
20
### Features
10
21
11
22
- [x] - ` POST ` ing to the API, which will return the provided url.
@@ -39,7 +50,6 @@ Since the project is considered multi-sync, it will work in a sync/async environ
39
50
import mystbin
40
51
41
52
mystbin_client = mystbin.Client()
42
- # NOTE : The `api_key` kwarg in the Client constructor is optional.
43
53
44
54
paste = await mystbin_client.post(" Hello from MystBin!" , syntax = " python" )
45
55
str (paste)
@@ -57,22 +67,13 @@ paste.created_at
57
67
```
58
68
59
69
``` py
60
- # sync example - we need to pass a session though
61
70
import mystbin
62
- import requests
63
71
64
- sync_session = requests.Session()
65
- mystbin_client = mystbin.Client(session = sync_session)
66
- # NOTE : The `api_key` kwarg in the Client constructor is optional.
72
+ mystbin_client = mystbin.SyncClient()
67
73
68
74
paste = mystbin_client.post(" Hello from sync Mystb.in!" , syntax = " text" )
69
75
str (paste)
70
76
>> > ' https://mystb.in/<your generated ID>.text'
71
77
```
72
78
73
79
NOTE: There is a timeout of 15s for each operation.
74
-
75
- ### Dependencies
76
-
77
- ` aiohttp ` - required \
78
- ` requests ` - optional
0 commit comments