Skip to main content

Random data generator for the command line

Project description


From pypi:

>>> pip install fakr

From repo:

>>> git clone && pip install -e fakr/

Basic Usage

>>> fakr --help
>>> echo "{{row}},{{row%100}},{{firstname}},{{lastname}},{{email}}" | fakr --count 1000


The templates you use for data generation are plain Jinja2 Templates. See their reference for detailed information.

There are a few custom filters and function for use with fakr:

Custom filters:

  • ascii: Converts the value to ascii (using Unidecode) (i. e. {{lastname|ascii}})

  • shuffle: Shuffles the value randomly (i. e. {{lastname|shuffle}})

  • chance: Gives the value a chance from 0.0 to 1.0 to be returned (i. e. {{firstname|chance(0.9)}} - firstname will be 90% returned, 10% empty)

  • rjust: Right-justifies the value to the given with (i. e. {{company|rjust(40)}})

  • ljust: Left-justifies the value to the given with (i. e. {{company|ljust(40)}})

  • center: Centers the value in width (i. e. {{company|center(40)}})

Custom functions:

  • translate

  • uuid4: Returns a new UUIDv4 on every call (i. e. {{uuid4()}})

  • choice: Returns a random choice of the given arguments, (i. e. {{choice('fu', 'bar', 'herp', 'derp')}})

Project details

Download files

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

Source Distribution

fakr-0.0.5.tar.gz (76.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page