Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Generates readable URLs like Twitch's clips

Project description

sentence-url

A port of the NPM package readable-url to generate readable random phrases to add to dynamically generated URLs.

GitHub repository

To generate readable URLs like Twitch's clips.

Example: https://clips.twitch.tv/WiseAcceptableSnoodPupper

Get started

To install:

pip install readable-url

To import:

from sentence-url import SentenceURL

Usage Instructions

"""
Takes 3 parameters.
1. An integer value - The number of words to be generated in the string. (Between 2 and 10).
2. A boolean value - If true, returns string in CamelCase, else lowercase.
3. A string - The seperator between the words.
"""

generator = SentenceURL() # 3, True, '' are the default values.

#generator = SentenceURL(False, 5, '-') # Other options.

To generate a random phrase:

url = generator.generate()
print(url); # Prints out 'ForgetfulHarshEgg'

This can be used to add to the end of a URL.

Example: https://example.com/photos/ForgetfulHarshEgg

For best results, use an integer value of 3, 4, or 5.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sentence-url, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size sentence_url-0.0.1-py3-none-any.whl (2.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size sentence-url-0.0.1.tar.gz (1.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page