Skip to main content

A simple and intuitive Python package for generating random strings and numbers.

Project description

Strig

GitHub releases PyPI release License: MIT

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strig-2.0.0a2.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

strig-2.0.0a2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file strig-2.0.0a2.tar.gz.

File metadata

  • Download URL: strig-2.0.0a2.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for strig-2.0.0a2.tar.gz
Algorithm Hash digest
SHA256 a592b6336adbb495f07a5c8bb19d0a062805a18c6b0ca48be5df6e0aa42199f3
MD5 1b26b648b77281777227cfef3df5a158
BLAKE2b-256 aa94e4d4058882d435f391aca3f33bf64f173c95a4d159c38f4edcd384797530

See more details on using hashes here.

File details

Details for the file strig-2.0.0a2-py3-none-any.whl.

File metadata

  • Download URL: strig-2.0.0a2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for strig-2.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 fff5229ff7f5d29684c0ae7448a839dc9444167c8bf62ef17d5d813cd818c3ff
MD5 d38674dea28b6184453a089506a46105
BLAKE2b-256 b600da213f7aa2466c644a4b06382ddc53df1cd2aaed8b8a65fc2da57ab8667f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page