Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

string-gen

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-gen

String generator by regex

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

string-gen

String generator by regex

Installation

Install using pip with

pip install string_gen

Example

from string_gen import StringGen

generator = StringGen(r'(A|B)\d{4}(\.|-)\d{1}')
print(generator.render())  # B9954.4
print(generator.render())  # A5292-1

generator = StringGen(r'[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}')
print(generator.render())  # 52aabe4b-01fa-4b33-8976-b53b09f49e72

# Generate list strings
generator = StringGen(r'(A|B)\d{4}\.\d{1}')
print(generator.render_list(5))  # ['A9046.5', 'A8334.7', 'B5496-6', 'A4207-2', 'A1171-7']

# Return a set of generated unique strings
generator = StringGen(r'\d')
print(generator.render_set(10))  # {'4', '6', '3', '9', '2', '7', '5', '1', '8', '0'}

Changelog

  • Releases

Contributing

Contributions are very welcome.

You might want to:

  • Fix spelling errors
  • Improve documentation
  • Add tests for untested code
  • Add new features
  • Fix bugs
Getting started
  • python 3.12
  • pipenv 2023.11.15+
  1. Clone the repository
    git clone https://github.com/tolstislon/string-gen.git
    cd string-gen
    
  2. Install dev dependencies
    pipenv install --dev
    pipenv shell
    
  3. Run the black
    pipenv run black
    
  4. Run the flake8
    pipenv run flake
    
  5. Run tests
    pipenv run tests
    

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc