{ "info": { "author": "Paul Wolf", "author_email": "paul.wolf@yewleaf.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "strgen\n======\n\n|Build Status|\n\nGenerate test data, unique ids, passwords, vouchers or other randomized\ntextual data very quickly using a template language. The template\nlanguage is superficially similar to regular expressions but instead of\ndefining how to match or capture strings, it defines how to generate\nrandomized strings. A very simple invocation to produce a random string\nwith word characters and digits of 10 characters length:\n\n::\n\n >>> import strgen\n >>> strgen.StringGenerator(\"[\\d\\w]{10}\").render()\n 'sj5ic8vebF'\n\nThe purpose of this module is to save the Python developer from having\nto write verbose code around the same pattern every time to generate\npasswords, keys, tokens, test data, etc. of this sort:\n\n::\n\n my_secret_key = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(30))\n\nthat is:\n\n1. Hard to read even at this simplistic level.\n\n2. Hard to safely change quickly. Even modest additions to the\n requirements need unreasonably verbose solutions.\n\n3. Doesn\u2019t use safe encryption standards.\n\n4. Doesn\u2019t provide the implied minimal guarantees of character\n occurance.\n\n5. Hard to track back to requirements (\u201cmust be between x and y in\n length and have characters from sets Q, R and S\u201d).\n\nThe template uses short forms similar to those of regular expressions.\nAn example template for generating a strong password:\n\n::\n\n [\\w\\p\\d]{20}\n\nwill generate something like the following:\n\n::\n\n P{:45Ec5$3)2!I68x`{6\n\nGuarantee at least two \u201cspecial\u201d characters in a string:\n\n::\n\n [\\w\\p]{10}&[\\p]{2}\n\nYou can also generate useful test data, like fake emails with plenty of\nvariation:\n\n::\n\n [\\c]{10}.[\\c]{5:10}@[\\c]{3:12}.(com|net|org)\n\nInstallation\n------------\n\nInstall as standard for Python packages from PyPi:\n\n::\n\n pip install StringGenerator\n\nUsage\n-----\n\n::\n\n from strgen import StringGenerator\n StringGenerator(