sprang

raw JSON →
0.21 verified Sat May 09 auth: no python deprecated

A command-line tool and Python library for posting and retrieving text snippets via the sprunge.us pastebin service. Current version 0.21. No recent updates; repository archived/unmaintained.

pip install sprang
error ModuleNotFoundError: No module named 'sprang'
cause Package not installed or virtual environment not activated.
fix
Run 'pip install sprang' in your environment.
error AttributeError: module 'sprang' has no attribute 'Sprange'
cause Older version or incorrect import path.
fix
Use 'from sprang import Sprange' (capital S).
deprecated sprang is unmaintained and the sprunge.us service may be unreliable or offline.
fix Consider using an alternative like dpaste, ix.io, or a self-hosted service.
gotcha The library does not handle network errors gracefully; exceptions may be unhelpful.
fix Wrap calls in try/except blocks and check response status.

Basic usage: create and retrieve a paste.

from sprang import Sprange
s = Sprange()
url = s.paste('Hello, world!')
print(url)
# Retrieve
content = s.get(url.split('/')[-1])
print(content)