Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SuperPaste

Have you ever found yourself in code, needing to send a large chunk of text, such as a log file, but didn't want to clog up the chat with a wall of text? SuperPaste is here to help! SuperPaste is a simple, easy-to-use tool that allows you to paste large chunks of text into a file, and then send a link to that file to your friends or coworkers. They can then view the file in their browser, without having to download it.

This works by taking your desired files, such as a log string, and posting them to a chosen server, such as hst.sh and mystb.in. The server will then return a link to the file, which you can then send to your friends.


This is a continuation of the PostBin project, which was discontinued as it fell into disrepair, and had an ugly API.

Installing:

You can install from git:

pip install git+https://github.com/nexy7574/superpaste.git

Usage:

you can use it in your code like so:

>>> from superpaste.backends import HstSHBackend, BasePasteResult
# See: /src/superpaste/backends/__init__.py for more backends


# Create a backend
>>> backend = HstSHBackend()

# Post a file
>>> result = backend.create_paste(backend.file_class.from_file("path/to/file.txt"))
>>> print(result.url)
BasePasteResult(url='https://hst.sh/2', key="2")

# Post a string
>>> result = backend.create_paste(backend.file_class("content here"))
>>> print(result.url)
BasePasteResult(url='https://hst.sh/2', key="2")

# You can also post bytes, assuming they're actually just UTF-8 text.
r>>> esult = backend.create_paste(backend.file_class(b"bytes here"))
>>> print(result.url)
BasePasteResult(url='https://hst.sh/3', key="3")

# You can post multiple files, too
>>> results = backend.create_paste(
    backend.file_class("content here"),
    backend.file_class.from_file("path/to/file.txt"),
)
[
    BasePasteResult(url='https://hst.sh/4', key="4"),
    BasePasteResult(url='https://hst.sh/5', key="5"),
]

# There is also an async API, which just wraps the sync API in an async function, pushing it to a thread:
# To use this part of the example, you either need to be in an async function, or use iPython.
>>> await backend..async_create_paste(backend.file_class("content here"))
BasePasteResult(url='https://hst.sh/6', key="6")

or use it in your console:

$ superpaste --backend mystb.in path/to/file.txt
...
$ echo "content here" | superpaste --backend hst.sh -
...
$ superpaste --backend hst.sh path/to/file1.txt path/to/another/file1.txt
file file1.txt: https://hst.sh/2
file file2.txt: https://hst.sh/3

Metadata

Release files for superpaste 1.0.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superpaste 1.0.0rc2
File Size Uploaded Provenance Actions
superpaste-1.0.0rc2.tar.gz 17.9 kB Without provenance Details for superpaste-1.0.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for superpaste 1.0.0rc2
File Interpreter ABI Platform Actions
superpaste-1.0.0rc2-py3-none-any.whl Python 3 none any Details for superpaste-1.0.0rc2-py3-none-any.whl

Total release size: 33.5 kB

Release files / superpaste-1.0.0rc2.tar.gz

Download URL superpaste-1.0.0rc2.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7286ba0564cd43e36a5735d3b0586058453a8fcf18e06d87143758093e0dd21d
BLAKE2b-256 checksum
How to use checksums
3feec5e3b80d6831fd64eab91a549cd39c103c87f9a55db17e9abc1d41b7a413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / superpaste-1.0.0rc2-py3-none-any.whl

Download URL superpaste-1.0.0rc2-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
290ca3c9be7e8a47a744eacb30cb42fa0b342cae3c695fa146f2c094298bd5ce
BLAKE2b-256 checksum
How to use checksums
3ec3b3fbd0276f1ae62dc7ade9dc275e77646ea812785bcf385eeb64499c5d6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Security for superpaste 1.0.0rc2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page