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. 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.
- - 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
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 client.create_paste(filename="Hello.txt", content="Hello there!")
str(paste)
>>> 'https://mystb.in/<your generated ID>'
get_paste = await mystbin_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_multifile_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-5.1.0.tar.gz
.
File metadata
- Download URL: mystbin_py-5.1.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9f05c7920140a06359b5a8f25fd628b06b90ff25ea3fa502a61afa1093e4439 |
|
MD5 | d088fb221d88ae909f7cf38b331deea2 |
|
BLAKE2b-256 | 710375fd9500e2445d1f70bfea1bc60094bfe149f415c9c4ac0c81dd4b1b83ea |
File details
Details for the file mystbin_py-5.1.0-py3-none-any.whl
.
File metadata
- Download URL: mystbin_py-5.1.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaf4220f88f942a2a505dbddd11995918f386ae1841849390f59196550bd95d0 |
|
MD5 | c1588e295f07f0e0092d1c99732ad192 |
|
BLAKE2b-256 | d66ba923fde0ed9c23ddbc008b8d18ccac85d07096035b3fdf47b2afdebe94c8 |