A small simple wrapper around the mystb.in API.
Reason this release was yanked:
Outdated and no longer works.
Project description
A small simple wrapper around the MystB.in API.
Features
- -
POST
ing to the API, which will return the provided url. - -
GET
ting from the API, provided you know the URL or paste ID. - -
DELETE
ing from the API, provided the paste is attached to your account. - -
PATCH
ing to the API, provided the paste is attached to your account. - - Ability to pass in a sync or async session / parameter so it is flexible.
- - Write a real underlying Client for this, it will be required for...
- - ... Authorization. Awaiting the API making this public as it is still WIP.
Installation
This project will be on PyPI as a stable release, you can always find that there.
Installing via pip
:
python -m pip install -U mystbin.py
# or for optional sync addon...
python -m pip install -U mystbin.py[requests]
Installing from source:
python -m pip install git+https://github.com/AbstractUmbra/mystbin-py.git #[requests] for sync addon
Usage examples
Since the project is considered multi-sync, it will work in a sync/async environment, see the optional dependency of requests
below.
# async example - it will default to async
import mystbin
mystbin_client = mystbin.Client()
paste = await mystbin_client.post("Hello from MystBin!", syntax="python")
str(paste)
>>> 'https://mystb.in/<your generated ID>.python'
paste.url
>>> 'https://mystb.in/<your generated ID>.python'
get_paste = await mystbin_client.get("https://mystb.in/<your generated ID>")
str(get_paste)
>>> "Hello from MystBin!"
paste.created_at
>>> datetime.datetime(2020, 10, 6, 10, 53, 57, 556741)
import mystbin
mystbin_client = mystbin.SyncClient()
paste = mystbin_client.post("Hello from sync Mystb.in!", syntax="text")
str(paste)
>>> 'https://mystb.in/<your generated ID>.text'
NOTE: There is a timeout of 15s for each operation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mystbin.py-4.0.2.tar.gz
(8.4 kB
view details)
Built Distribution
File details
Details for the file mystbin.py-4.0.2.tar.gz
.
File metadata
- Download URL: mystbin.py-4.0.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0a05daa6da8c9a2a91917e1d2f20d105da5186e4e9a1444cca07d0dde2fce9b |
|
MD5 | ab1830cdd236fb07bf801d278030215c |
|
BLAKE2b-256 | 047fb2d7019d80ac0d71ceca04bcba3ffca64c3957581619bbeb780d7869d4b8 |
File details
Details for the file mystbin.py-4.0.2-py3-none-any.whl
.
File metadata
- Download URL: mystbin.py-4.0.2-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba964e97fdf200a8298e3137acfaa2cfd98256f8c8eeac4695d966c440f560d8 |
|
MD5 | 0cdc264f5edb38e78f8510ec853c35d4 |
|
BLAKE2b-256 | 51a99bfc284107b354a9061494b91ebe234b5610b384c554821c6f37dd3e97d1 |