A small simple wrapper around the mystb.in API.
Reason this release was yanked:
Security fix in later release.
Project description
A small simple wrapper around the Mystb.in API. API docs can be found here.
Documentation for this wrapper can be found here.
If you want the docs for the main
branch, those can be found here.
Features
- - Creating pastes.
- Supporting attachments.
- - Editing pastes.
- Pending design work.
- - Deleting pastes.
- - Getting pastes.
- - User endpoints.
- - Sync client.
- This one will take some time as I have no motivation to do it, but PRs are welcome if others want to do it.
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
Installing from source:
python -m pip install git+https://github.com/PythonistaGuild/mystbin.py.git
Usage examples
# async example - it will default to async
import mystbin
client = mystbin.Client()
paste = await client.create_paste(filename="Hello.txt", content="Hello there!")
# we also support passing a mystbin.File directly to the `file=` kwarg!
str(paste)
>>> 'https://mystb.in/<your generated ID>'
get_paste = await client.get_paste("<your generated ID>")
get_paste.files[0].content
>>> "Hello there!"
get_paste.created_at
>>> datetime.datetime(2020, 10, 6, 10, 53, 57, 556741)
Or if you want to create a paste with multiple files...
import mystbin
file = mystbin.File(filename="File1.txt", content="Hello there!")
file2 = mystbin.File(filename="test.py", content="print('hello!')")
paste = await client.create_paste(files=[file, file2])
for file in paste.files:
print(file.content)
>>> "Hello there!"
>>> "print('hello!')"
If you have any question please feel free to join the Pythonista Discord server:
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
Built Distribution
File details
Details for the file mystbin_py-7.0.0.tar.gz
.
File metadata
- Download URL: mystbin_py-7.0.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.6 Linux/6.1.0-12-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ef718699e0ae3a01d5240a49ad09acb3e0e7fa3f0f5882965f16f1082696c17 |
|
MD5 | ce9e2f6b93e50bd79bbae7b932b1b908 |
|
BLAKE2b-256 | e2896566c9c26e1f67dabb3bbee965b2d1f80bc705f2c4e9f3333b9de31546de |
File details
Details for the file mystbin_py-7.0.0-py3-none-any.whl
.
File metadata
- Download URL: mystbin_py-7.0.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.6 Linux/6.1.0-12-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f33da624c862b42f5ab6c39803c82528db3e42ad53636bdcee84a4cea47763bb |
|
MD5 | a2ee3d9b210c17a2a946dd9063b10cc7 |
|
BLAKE2b-256 | 00a27ee752c2bd0ca0a2f5b0793e74f8f760630e6ffd5111f5a8ccacfec9fba7 |