> Genrate usernames with a Markov chain based on a wordlist
[](https://travis-ci.org/stylesuxx/usernamegen) [](https://img.shields.io/pypi/dm/usernamegen.svg) [](http://sync.readthedocs.io/?badge=latest)
## Wordlist
In order to get the most out of the word generation, make sure that you have one word per line, all lower case.
## Installation
Simply install via pip:
pip install usernamegen
## Usage
### Library
You can use the usernamegen directly in your python application.
```bash
>>> import usernamegen
>>> words = ['foo', 'foobar', 'foobarbla', 'foobarblafasel']
>>> formatters = [{'format': usernamegen.Formatter.Join, 'weight': 1}]
>>> minLength = 8
>>> size = 3
>>> gen = usernamegen.Generator(words, size, minLength)
>>> gen.setFormatters(formatters)
>>> gen.getString()
'foobarfoobarblafasel'
```
When multiple formmatters are used, the heigher the weight of a formatter the more likely it is, that it is used.
The following formatters are available:
* Join
* Underscore
* Capitalize
* CapitalizeExceptFirst
* AppendNumber
* CapitalizeAppendNumber
### Scripts
After installation there will be two script available:
#### markov
```bash
usage: markov [-h] [-p PREV] [-n N] WORDLIST
Markov chain word generator. Generate new words based on aword list.
positional arguments:
WORDLIST Path to wordlist used for word generation
optional arguments:
-h, --help show this help message and exit
-p PREV Number of previous letters to base chain on
-n N Amount of new words to generate
```
#### username
```bash
usage: username [-h] [-p PREV] [-n N] [-m MIN] WORDLIST
Generate usernames based on a wordlist and a Markov chain.
positional arguments:
WORDLIST Path to wordlist used for word generation
optional arguments:
-h, --help show this help message and exit
-p PREV Number of previous letters to base chain on
-n N Amount of new words to generate
-m MIN Minimum username length
```
## Running tests
```bash
nosetests --with-coverage --cover-package=usernamegen --with-json-extended
```
## Generating Documentation
```bash
sphinx-apidoc -o docs/source usernamegen -f
cd docs && make html && cd ..
```
Metadata
Release files for usernamegen 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| usernamegen-0.1.1.tar.gz | 4.7 kB | Without provenance | Details for usernamegen-0.1.1.tar.gz |
Release files / usernamegen-0.1.1.tar.gz
| Download URL | usernamegen-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a29154a0aebbe75a34fcf4a71658341367bc80a28c8ffacee08788bf7ba28251
|
|
BLAKE2b-256 checksum How to use checksums |
b5110c0cb4af6355794f5d6eaac5bac45e64b4cec5aeb3b231add57edced4d61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for usernamegen 0.1.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.