Strig is a Python utility package for generating random strings and numbers. It is lightweight, flexible, and perfect for use in application backends where unique IDs, secure passwords, or bulk test data are needed.
- Generate random alphanumeric, alphabetic, or numeric strings.
- Customize length, prefixes, and casing options.
pip install strig
Note that pip refers to the Python 3 package manager. In an environment where Python 2 is also present the correct command may be pip3.
Strig can be used to create unique identifiers, test data, or even secure passwords. The simple and customizable functions allow you to specify the format that fits your needs. For detailed documentation and additional functionality, visit the full documentation.
import strigGenerate a 6-character long string composed of letters and numbers.
random_alphanumeric = strig.alphanumeric()
print(random_alphanumeric) # Example output: 'A3c9Dz'Generate a 10-character long string composed of lower-case letters only.
random_alpha = strig.alpha(length=10, case="lower")
print(random_alpha) # Example output: 'abcdefghij'Generate an 8-digit long integer and prefix it with 12. The total number of digits will be 10.
random_numeric = strig.numeric(length=8, prefix=12)
print(random_numeric) # Example output: 1297637456If you come across any issues, please create an issue on GitHub.
Strig is licensed under the MIT License