Skip to content

Commit 654149c

Browse files
committed
branding updates, version and dep bump
1 parent c221f26 commit 654149c

File tree

5 files changed

+223
-166
lines changed

5 files changed

+223
-166
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Mystb.in-py!
1+
# MystBin.py!
22

3-
A small simple wrapper around the [Mystb.in](https://mystb.in/) API.
3+
A small simple wrapper around the [MystB.in](https://mystb.in/) API.
44

55
### Features
66

@@ -34,10 +34,10 @@ Since the project is considered multi-sync, it will work in a sync/async environ
3434
# async example - it will default to async
3535
import mystbin
3636

37-
mystbin_client = mystbin.MystbinClient()
37+
mystbin_client = mystbin.Client()
3838
#NOTE: The `api_key` kwarg in the Client constructor is optional.
3939

40-
paste = await mystbin_client.post("Hello from Mystb.in!", syntax="python")
40+
paste = await mystbin_client.post("Hello from MystBin!", syntax="python")
4141
str(paste)
4242
>>> 'https://mystb.in/<your generated ID>.python'
4343

@@ -46,7 +46,7 @@ paste.url
4646

4747
get_paste = await mystbin_client.get("https://mystb.in/<your generated ID>")
4848
str(paste)
49-
>>> "Hello from Mystb.in!"
49+
>>> "Hello from MystBin!"
5050

5151
paste.created_at
5252
>>> datetime.datetime(2020, 10, 6, 10, 53, 57, 556741)
@@ -58,7 +58,7 @@ import mystbin
5858
import requests
5959

6060
sync_session = requests.Session()
61-
mystbin_client = mystbin.MystbinClient(session=sync_session) ## optional api_key kwarg also
61+
mystbin_client = mystbin.Client(session=sync_session) ## optional api_key kwarg also
6262

6363
mystbin_client.post("Hello from sync Mystb.in!", syntax="text")
6464
>>> 'https://mystb.in/<your generated ID>.text'

mystbin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
from .client import MystbinClient
2828
from .errors import *
2929

30-
__version__ = "0.3.5"
30+
__version__ = "0.3.6"
3131
VersionInfo = namedtuple(
3232
"VersionInfo", "major minor micro releaselevel serial")
33-
version_info = VersionInfo(major=0, minor=3, micro=5,
33+
version_info = VersionInfo(major=0, minor=3, micro=6,
3434
releaselevel='final', serial=0)

mystbin/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@
3131
if TYPE_CHECKING:
3232
import requests
3333

34+
from . import __version__ as ver
3435
from .constants import *
3536
from .errors import *
3637
from .objects import *
3738

38-
__all__ = ("MystbinClient", )
39+
__all__ = ("Client", )
3940

4041

41-
class MystbinClient:
42+
class Client:
4243
"""
4344
Client for interacting with the Mystb.in API.
4445
@@ -69,7 +70,7 @@ def _generate_sync_session(self, session: Type["requests.Session"]) -> Type["req
6970
# the passed session was found to be 'sync'.
7071
if self.api_key:
7172
session.headers.update(
72-
{"Authorization": self.api_key, "User-Agent": "Mystbin.py"})
73+
{"Authorization": self.api_key, "User-Agent": f"Mystbin.py v{ver}"})
7374

7475
return session
7576

@@ -80,7 +81,7 @@ async def _generate_async_session(self, session: Optional[aiohttp.ClientSession]
8081

8182
if self.api_key:
8283
session._default_headers.update(
83-
{"Authorization": self.api_key, "User-Agent": "Mystbin.py"})
84+
{"Authorization": self.api_key, "User-Agent": f"Mystbin.py v{ver}"})
8485

8586
session._timeout = aiohttp.ClientTimeout(CLIENT_TIMEOUT)
8687
return session

0 commit comments

Comments
 (0)