{ "info": { "author": "Sairam Krishnan", "author_email": "sairambkrishnan@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "RandomWordGenerator\r\n===================\r\n\r\nPython Library for Generating Random Words\r\n\r\nUsage\r\n-----\r\n\r\n::\r\n\r\n from randomgenerator import randomwordgenerator\r\n\r\n num_words = 20\r\n randomwordgenerator.generate_random_words(n = num_words)\r\n\r\nUnder the hood, the random word generator first tries to use the primary\r\npathway.\r\n\r\nprimary\r\n~~~~~~~\r\n\r\nWord Source: FreeBSD Dictionary\r\n\r\n::\r\n\r\n def get_n_random_words(num_random_words, prefix = None, suffix = None, substr = None):\r\n '''\r\n @param prefix\r\n - A character or phrase that all target words must start with\r\n @param suffix\r\n - A character or phrase that all target words must end with\r\n @param substr\r\n - A character or phrase that all target words must contain\r\n @param num_random_words\r\n - The number of random words to generate\r\n - Must be nonnegative\r\n @return \r\n - a list of @num_random_words unique words from _URL that \r\n meet the specified criteria\r\n - all words meeting the specified criteria if @num_random_words \r\n exceeds the number of matching words\r\n - None if @num_random_words is < 0, [] if @num_random_words is 0\r\n '''\r\n\r\nIf the primary generator fails (a.k.a, we lose Internet connectivity, so\r\nwe can't access the FreeBSD dictionary), the random word generator\r\nswitches over to the backup pathway.\r\n\r\nbackup\r\n~~~~~~\r\n\r\n::\r\n\r\n def get_random_word(min_word_len, max_word_len):\r\n '''\r\n @param min_word_len \r\n - Minimum number of characters that must be in random word\r\n - Must be non-negative\r\n \r\n @param max_word_len \r\n - Maximum number of characters that can be in random word\r\n - Must be non-negative\r\n\r\n @return \r\n - A random word whose length is >= @min_word_len and <= @max_word_len characters.\r\n - If any of the inputs are invalid, then raise an InvalidWordLengthBoundsError.\r\n '''\r\n\r\n::\r\n\r\n def get_n_random_words(n, word_len_bounds = (2, 10)):\r\n '''\r\n @param n\r\n (Required)\r\n Number of random words to generate\r\n\r\n @param word_len_bounds\r\n (Optional)\r\n Tuple containing the bounds for the word length of each randomly generated word;\r\n item 0 = minimum word length (2 by default), item 1 = maximum word length (10 by default)\r\n\r\n @return\r\n - A list with @n random words, where word_len_bounds[0] <= len(each word) <= word_len_bounds[1]\r\n - An InvalidWordLengthBoundsError if word_len_bounds is an invalid tuple (length < 2)\r\n '''\r\n\r\nThe key difference between the primary and backup pathways is that the\r\nlatter might not generate actual words; it is actually creating various\r\nstrings of varying lengths and characters. Overall, the backup pathway\r\nis not as ideal as the primary, but it is a suitable alternative in the\r\nevent of a network failure.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/SaiWebApps/RandomWordGenerator/tarball/1.0.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SaiWebApps/RandomWordGenerator", "keywords": "Python,random-word", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "randomwordgenerator", "package_url": "https://pypi.org/project/randomwordgenerator/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/randomwordgenerator/", "project_urls": { "Download": "https://github.com/SaiWebApps/RandomWordGenerator/tarball/1.0.0", "Homepage": "https://github.com/SaiWebApps/RandomWordGenerator" }, "release_url": "https://pypi.org/project/randomwordgenerator/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Python 3 Random Word Generator Library", "version": "1.0.0" }, "last_serial": 2322343, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c232fc08e5ec9dcfdf4be9c165bd13a6", "sha256": "d2d3a7cddcabc3aa7a27f544248e2a324eb836449cf5ed48a81204a13d26d905" }, "downloads": -1, "filename": "randomwordgenerator-1.0.0.zip", "has_sig": false, "md5_digest": "c232fc08e5ec9dcfdf4be9c165bd13a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5148, "upload_time": "2016-09-03T02:15:14", "url": "https://files.pythonhosted.org/packages/05/28/b914e591374d70824b96c79315d311180966bb4f0568ab95cf3fa36ae3ac/randomwordgenerator-1.0.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c232fc08e5ec9dcfdf4be9c165bd13a6", "sha256": "d2d3a7cddcabc3aa7a27f544248e2a324eb836449cf5ed48a81204a13d26d905" }, "downloads": -1, "filename": "randomwordgenerator-1.0.0.zip", "has_sig": false, "md5_digest": "c232fc08e5ec9dcfdf4be9c165bd13a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5148, "upload_time": "2016-09-03T02:15:14", "url": "https://files.pythonhosted.org/packages/05/28/b914e591374d70824b96c79315d311180966bb4f0568ab95cf3fa36ae3ac/randomwordgenerator-1.0.0.zip" } ] }