A simple and intuitive Python package for generating random strings and numbers.
Project description
Strig
Strig is an open-source 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. Strig is licensed under the MIT License.
Features
- Generate random alphanumeric, alphabetic, or numeric strings.
- Customize length, prefixes, and casing options.
- Verify uniqueness against a database.
Installation
Install using PIP
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
.
Usage
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 strig:
import strig
Generate an alphanumeric string
Generate a 6-character long string composed of letters and numbers.
random_alphanumeric = strig.alphanumeric()
print(random_alphanumeric) # Example output: 'A3c9Dz'
Generate an alphabetic string
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 numeric value
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: 1297637456
Support
If you come across any issues, please create an issue on GitHub.
License
Strig is licensed nder the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file strig-2.0.0a3.tar.gz
.
File metadata
- Download URL: strig-2.0.0a3.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ea0879ceff5bc89e2e159708902606ce6c879e1b5e3fb293d1969f0ee15dbbf |
|
MD5 | 3d52a78e5255270e7d244f18eeff0736 |
|
BLAKE2b-256 | df9a0ff9903468f889dd6ffa86b05dbff52ec8dea57fbcfcb084bde316128b7b |
File details
Details for the file strig-2.0.0a3-py3-none-any.whl
.
File metadata
- Download URL: strig-2.0.0a3-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 205ac1bcf210d4af91974ef2b6b90aa4fc66a42719f912c0ef015b7ea1fa1bbc |
|
MD5 | 2410c3593c41ea68cefe3ffabd04b0c3 |
|
BLAKE2b-256 | cdd5ffb1a66a3438d01c2d6346feaf283909e0ff5fbcf37880e97c04d54c310f |