A Python library that wraps and consumes the most popular URL shortener APIs, including TinyURL, Bitly, and others. Current version 1.0.1, released in 2021; development appears stalled but library is functional. Supports Python 3.6+.
pip install pyshortenersVerified import paths — ran on the pinned version, not inferred.
Quickstart: import pyshorteners, create Shortener instance, call a provider's .short() method.
Update imports: replace 'from pyshorteners import Shortener' with 'import pyshorteners' and use pyshorteners.Shortener().tinyurl.short(url).
Switch to active services like TinyURL (no API key) or Bitly (requires API key).
Set API keys via environment variable or pass to Shortener constructor: pyshorteners.Shortener(bitly_token=os.environ.get('BITLY_TOKEN')).Run: pip install pyshorteners
Replace 'from pyshorteners import Shortener' with 'import pyshorteners' and use pyshorteners.Shortener().