Skip to main content

Genrex

Genrex generates matching strings to a given regular expressions.

Usecases

  • generate test data
  • calculate the cardinality of a regular expression.

Quickstart

Requirements

  • Pyhton 3.x

Install

pip install genrex

First Steps

import genrex

emails = genrex.parse(r'(John|Jane)\.(Doe|Smith)@(gmail|outlook|protonmail)\.com')

print('random email address: ', emails.random())
print('first email address: ', emails[0])
print('number of email addresses: ', len(emails))

print('')
[print(email) for email in emails] #print all emails

Output:

random email address:  Jane.Doe@gmail.com
first email address:  John.Doe@gmail.com
number of email addresses:  12

John.Doe@gmail.com
Jane.Doe@gmail.com
John.Smith@gmail.com
Jane.Smith@gmail.com
John.Doe@outlook.com
Jane.Doe@outlook.com
John.Smith@outlook.com
Jane.Smith@outlook.com
John.Doe@protonmail.com
Jane.Doe@protonmail.com
John.Smith@protonmail.com
Jane.Smith@protonmail.com

Features

Supported Regular Expression Syntax

  • .
  • *
  • +
  • ?
  • {m}
  • {m,n}
  • | - Branch
  • [...] - Set
  • (...) - Group
  • \d, \s, ... - Categories

TODO

Alternatives

Package License
exrex AGPL-3.0
rstr BSD

Metadata

Release files for genrex 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genrex 1.0.1
File Size Uploaded Provenance Actions
genrex-1.0.1.tar.gz 4.2 kB Without provenance Details for genrex-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for genrex 1.0.1
File Interpreter ABI Platform Actions
genrex-1.0.1-py3-none-any.whl Python 3 none any Details for genrex-1.0.1-py3-none-any.whl

Total release size: 9.5 kB

Release files / genrex-1.0.1.tar.gz

Download URL genrex-1.0.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aa5c27cc8ccc8e9f2ce28eeba6fa58db84ff5d3704d52328ac28be57effc0c67
BLAKE2b-256 checksum
How to use checksums
882100b7dea13d0ce1876a39dda8737cd902db3ecf7791852e8944965ab9e22e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

Release files / genrex-1.0.1-py3-none-any.whl

Download URL genrex-1.0.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95a2dd2c797448a9c38bb8a59515ba03abfae1caa060a7f182778cc5533a7568
BLAKE2b-256 checksum
How to use checksums
54b883ea9252b058c19b202c8846b01073a7e4d8fafc080e9fa75073f207be0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

Security for genrex 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page