semvec/pypi-packages huggingface dataset:
usernamegen 0.1.1
Genrate usernames with a Markov chain based on a wordlist
License: MIT

# usernamegen
> Genrate usernames with a Markov chain based on a wordlist

[![Build Status](https://travis-ci.org/stylesuxx/usernamegen.svg?branch=master)](https://travis-ci.org/stylesuxx/usernamegen) [![Downloads](https://img.shields.io/pypi/dm/browserinfo.svg)](https://img.shields.io/pypi/dm/usernamegen.svg) [![Documentation Status](https://readthedocs.org/projects/usernamegen/badge/?version=latest)](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 ..
```
tpfd 0.2.4
Text Parsing Function Dispatcher
License: MIT
Keywords: text, parsing, function, dispatcher, parse, parser

TPFD - Text Parsing Function Dispatcher
=======================================
.. image:: https://travis-ci.org/erinxocon/tpfd.svg?branch=master
    :target: https://travis-ci.org/erinxocon/tpfd
.. image:: https://img.shields.io/pypi/v/tpfd.svg?maxAge=2592000
    :target: https://pypi.python.org/pypi/tpfd/
.. image:: https://img.shields.io/pypi/l/tpfd.svg?maxAge=2592000
    :target: https://opensource.org/licenses/MIT

**TPFD** is an easy way to parse strings and execute functions depending on their contents.

Inspired by `Flask <https://github.com/mitsuhiko/flask>`_ and using `Parse <https://github.com/r1chardj0n3s/parse>`_ under the hood, this allows you to decorate functions with grammar rules and if a pattern that matches one of your grammar rules is found, the function will be run with a set of keyword arguments you've specified passed to it!  Great for parsing logs and executing macros on what it finds!

Examples
--------
.. code-block:: python

    Aniamls.txt
    Turtles are cool
    Sloths are cool
    Mosquitos are dumb

    >>> p  = tpfd.Parser()

    >>> @p.on_parse('{Animal} are cool')
        def main(animal):
            print('I like {0}.'.format(animal))

    >>> p.parse_file('animals.txt')
    'I like turtles.'
    'I like sloths.'

    >>> p.parse(['Turtles are cool', 'Sloths are cool', 'Mosquitos are dumb'])
    'I like turtles.'
    'I like sloths.'

    >>> p.parse('Sloths are cool')
    'I like sloths.'

    >>> p.parse('Mosquitos are dumb')
    None

    >>> @p.on_find('>{}<')
        def find_example(words):
        print (words)

    >>> p.find('<p>the <b>bold</b> text</p>')
    'the bold text'

To Install
----------

::

    $ pip install tpfd

Notes
-----
Any format spec supported by parse is supported by this library since it's all parse under the hood.
Example: ``{[field name]:[format spec]}``

Current Features
----------------

* Support for parsing text files
* Support for accepting generators that output text or ints
* Support for parsing unicode strings
* Supports parsing strings, ints and interator/generator's automagically with new ``parse`` method.


TODO
----
* Expose custom types functionality that `Parse <https://github.com/r1chardj0n3s/parse>`_ already offers