Skip to main content

A small simple wrapper around the mystb.in API.

Reason this release was yanked:

Outdated and no longer works.

Project description

Mystbin.py!

Documentation Status Linting status Build status

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

mystbin_py-6.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

mystbin_py-6.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file mystbin_py-6.1.0.tar.gz.

File metadata

  • Download URL: mystbin_py-6.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.1.0-12-amd64

File hashes

Hashes for mystbin_py-6.1.0.tar.gz
Algorithm Hash digest
SHA256 6a8a7ef5846a0fb718010371f768004eec815c4b9241c10f1a043cb9f2ce26e8
MD5 56bb837f77d054c2b56acdc3986a72c0
BLAKE2b-256 3870d8de5f20fd4584a5a1790e4d16b6026c35b50cdad2048946a49b4a1d1a28

See more details on using hashes here.

File details

Details for the file mystbin_py-6.1.0-py3-none-any.whl.

File metadata

  • Download URL: mystbin_py-6.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Linux/6.1.0-12-amd64

File hashes

Hashes for mystbin_py-6.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 747c90be69b766b5e1b96a77a37ade6eec9e3b1ae83a9209193215b977f7fdcd
MD5 47722f7dfc060467bd4f0ad479c4f276
BLAKE2b-256 e71030e43553ab31c4468022bb4a85849d9d1bc2644f77e1b46b62859b45c102

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page