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.
  • - 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!", syntax="txt")
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!", syntax="txt")
file2 = mystbin.File(filename="test.py", content="print('hello!')", syntax="py")

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

mystbin-py-5.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

mystbin_py-5.0.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file mystbin-py-5.0.0.tar.gz.

File metadata

  • Download URL: mystbin-py-5.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.10.4 Linux/5.10.0-15-amd64

File hashes

Hashes for mystbin-py-5.0.0.tar.gz
Algorithm Hash digest
SHA256 0ab216c9b761b6fab105a2c81aede44e2d9621e7b5257c1b6c870b959d778ce6
MD5 e0c0134124a75ce1039fc67eca934dbb
BLAKE2b-256 7ffa80d929dcf451a97d4d54cd1b7c871eb3ea820322a0c62eda70c4c5f29f58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mystbin_py-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.10.4 Linux/5.10.0-15-amd64

File hashes

Hashes for mystbin_py-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07157ca49662867c7b1ada8f81c4e2dac5d42286df47cd602cdc53acd4e7c623
MD5 3f156d29138698e6108effc3bc492d6d
BLAKE2b-256 50cb94b6bbc3d9cdb5223dca43f09fae5d56fee0e12afdb117c2fad468b36cac

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