API Reference#

Client#

class mystbin.Client(*, session: ClientSession | None = None)[source]#
await close() None[source]#

This function is a coroutine.

Closes the internal HTTP session and this client.

await create_paste(*, files: Sequence[File], password: str | None = None, expires: datetime.datetime | None = None) Paste[source]#

This function is a coroutine.

Create a single file paste on mystb.in.

Parameters
  • files (List[File]) – The pre-creates list of files you wish to upload.

  • password (Optional[str]) – The password of the paste, if any.

  • expires (Optional[datetime.datetime]) – When the paste expires, if any.

Returns

The paste that was created.

Return type

mystbin.Paste

await delete_paste(security_token: str, /) None[source]#

This function is a coroutine.

Delete a paste.

Parameters

security_token (str) – The security token relating to the paste to delete.

await get_paste(paste_id: str, *, password: str | None = None, raw: Literal[False]) Paste[source]#
await get_paste(paste_id: str, *, password: str | None = None, raw: Literal[True]) list[str]
await get_paste(paste_id: str, *, password: str | None = None) Paste

This function is a coroutine.

Fetch a paste.

Parameters
  • paste_id (str) – The paste id to fetch.

  • password (Optional[str]) – The password of the paste, if any.

  • raw (bool) – Whether to return the raw file(s) content or a Paste instance. Defaults to False.

Returns

The paste data returned.

Return type

Union[Paste, List[str]]

Paste#

class mystbin.Paste(*, id: str, created_at: str, files: Sequence[File])[source]#

File#

class mystbin.File(*, filename: str, content: str)[source]#