Skip to main content

wildling

Python library and CLI for pattern-based string generation. Zero third-party dependencies (stdlib only). Requires Python 3.9+.

Docs: Website · Sandbox · Syntax · Source

Registry: PyPI

Example

http://${'dev,stage,prod'}\-${'api,web'}#{0-2}.example.${'com,net,org'}/@.html

(The \- is a literal hyphen; bare - would mean “one letter or digit”. @ is one lowercase letter.)

That builds URL-shaped candidates: scheme http://, then environment × service × optional digits × TLD, then a one-letter path page. Three environments, two services, zero–two digits ('', 09, 0099), three TLDs, and az51948 strings — the kind of list you generate for fuzzing links or probing staging hosts, not type out.

A few of them:

  • http://dev-api.example.com/a.html / http://stage-web.example.com/z.html
  • http://dev-api0.example.net/a.html / http://prod-web9.example.org/m.html
  • http://dev-api00.example.com/a.html / http://prod-web99.example.org/z.html

Named dictionaries (%{'hosts'}) work the same way when the word lists live in files.

Try it in the sandbox, or see pattern syntax for length ranges, dictionaries, and escapes.

Install

From this repository:

cd python
./build.sh
# or without Docker:
cp ../docs/help.txt wildling/help.txt

The CLI is ./bin/wildling.

Registry: pip install wildling

Git:

pip install "git+https://github.com/dotmonk/wildling.git@v2.0.5#subdirectory=python"

Library

from wildling import create_wildling

wildling = create_wildling(
    patterns=["abrakadabra", "Year 19##"],
    dictionaries={"colors": ["red", "blue"]},
)

wildling.count()  # 101
wildling.get(0)   # "abrakadabra"

value = wildling.next()
while value is not False:
    print(value)
    value = wildling.next()

wildling.reset()

API

Method Description
next() Next combination, or False when exhausted
get(index) Combination at index, or False if out of range
count() Total combinations across all patterns
index() Current position (after next calls)
reset() Reset iteration to the start
generators() Per-pattern generators

CLI

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json

Help text and --check output follow docs/cli.md / docs/help.txt.

Build

./build.sh   # Docker: copy help.txt + byte-compile

Project tests live in ../tests/ and are run with ../test.sh.

Download files

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

Source Distribution

wildling-2.0.5.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wildling-2.0.5-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file wildling-2.0.5.tar.gz.

File metadata

  • Download URL: wildling-2.0.5.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for wildling-2.0.5.tar.gz
Algorithm Hash digest
SHA256 d0bc36150c66238d098298f62d55ae6ca980cc430d98ef3a1ce3f83b2abe3d8d
MD5 4c9dd008db66d9fbdb7d39669f161eda
BLAKE2b-256 191772b8f3d7c5deff658f1831ef8d94f499a64b0a6adb690230839912601a38

See more details on using hashes here.

Provenance

The following attestation bundles were made for wildling-2.0.5.tar.gz:

Publisher: release.yml on dotmonk/wildling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wildling-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: wildling-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for wildling-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bd504c5a5bacab35ccc96078c7be21bbea6a422905b0b84faf4d058dc1a1ef03
MD5 500ae65a82fae6aba63c2f5cd4efb304
BLAKE2b-256 5b9cabf71a293943c26d4cfa4f751be71830de958dd09a1e726c9bc92caa1967

See more details on using hashes here.

Provenance

The following attestation bundles were made for wildling-2.0.5-py3-none-any.whl:

Publisher: release.yml on dotmonk/wildling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.7

2 files

2.0.6

2 files

This release

2.0.5 This release

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

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