生成可读的url,如twitch的片段

sentence-url的Python项目详细描述


句子url

npm包readable-url的端口,用于生成可读的随机短语以添加到动态生成的url。

GitHub repository

生成可读的url,比如twitch的片段。

示例:https://clips.twitch.tv/WiseAcceptableSnoodPupper

开始

要安装:

pip install readable-url

要导入:

from sentence-url import SentenceURL

使用说明

"""
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.

生成随机短语:

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

这可用于添加到URL的结尾。

示例:https://example.com/photos/ForgetfulHarshEgg

为了获得最佳结果,请使用3、4或5的整数值。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
面向java语句的方法与面向表达式的方法   密码学如何在java中为json对象签名?   是否可以通过java程序知道给定卡夫卡消费群体的消费偏移量?   打印字符时出现java未知问号   java为JFrame设置背景色   在ubuntu中检查java版本时linux权限被拒绝   如何用java创建xml模式   java无法在远程服务器上运行Vaadin应用程序   java智能垃圾收集?   java如何在SpringMVC中设置缓存头?   在unix计算机上运行java应用程序a:>签名以输入内容   Java、Apache Commons配置XML属性   使用ArrayList调用Java未经检查的方法   在文本文件中查找并替换单词(Java GUI)   java Android Studio无法检测到JDK7或更新版本   java从socket的有效负载获取事件消息   安卓中java调用子类方法   java如何通过点击超链接来运行jar文件(Firefox)