{"id":16275218,"url":"https://github.com/l-x/fakr","last_synced_at":"2025-04-08T16:26:08.091Z","repository":{"id":57428310,"uuid":"101739277","full_name":"l-x/fakr","owner":"l-x","description":"🖕 Random data, fakrs!","archived":false,"fork":false,"pushed_at":"2018-02-05T11:41:20.000Z","size":377,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T04:36:26.032Z","etag":null,"topics":["command-line","command-line-tool","fake-data","faker","generator","load-testing","python","python3","python34"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l-x.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-29T08:41:56.000Z","updated_at":"2018-06-10T18:42:48.000Z","dependencies_parsed_at":"2022-09-02T18:30:33.622Z","dependency_job_id":null,"html_url":"https://github.com/l-x/fakr","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-x%2Ffakr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-x%2Ffakr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-x%2Ffakr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l-x%2Ffakr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l-x","download_url":"https://codeload.github.com/l-x/fakr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247880030,"owners_count":21011573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","command-line-tool","fake-data","faker","generator","load-testing","python","python3","python34"],"created_at":"2024-10-10T18:32:30.518Z","updated_at":"2025-04-08T16:26:08.068Z","avatar_url":"https://github.com/l-x.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://beerpay.io/l-x/fakr/badge.svg?style=beer\n   :target: https://beerpay.io/l-x/fakr\n\n.. image:: https://badges.gitter.im/random-data-fakrs/Lobby.svg\n    :target: https://gitter.im/random-data-fakrs/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-\n\n.. image:: https://travis-ci.org/l-x/fakr.svg?branch=master\n    :target: https://travis-ci.org/l-x/fakr\n\n.. image:: https://codecov.io/gh/l-x/fakr/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/l-x/fakr\n\n\n\nRandom data, fakrs!\n===================\n\n*fakr* reads a Jinja2 Template from ``stdin``, renders it using a vocabulary and writes the result to ``stdout``. It's as simple as that...\n\nInstallation\n------------\n\n``$ pip install fakr``\n\nBasic Usage\n-----------\n\n``$ fakr --help``\n\nExamples\n--------\n\nGenerate a simple csv file with 100k rows\n\n::\n\n $ echo \"{{row}},{{row%100}},{{firstname}},{{lastname}},{{email}}\" \\\n   | fakr --count 100000``\n\n\nUse a file for complex template\n\n::\n\n  $ cat examples/templates/vcard.tpl \\\n    | fakr --count 1000\n\n\nMake a http request using curl:\n\n::\n\n  $ echo \"company={{company|urlencode}}\u0026city={{city|urlencode}}\"  \\\n    | fakr -c1 \\\n    | curl httpbin.org/post -d @-\n\n\n\nWrite data to a redis server:\n\n::\n\n  $ echo 'firstname \\\"{{firstname}}\\\" lastname \\\"{{lastname}}\\\" email \\\"{{email}}\\\"' \\\n    | fakr \\\n    | xargs -i redis-cli HMSET {}``\n\n\nTemplates\n---------\n\nThe templates you use for data generation are plain `Jinja2 Templates`_. See their reference for detailed information.\n\nThere are a few custom filters, functions and variables for use with fakr:\n\nCustom filters:\n\n- ``ascii``: Converts the value to ascii (using Unidecode_) (i. e. ``{{lastname|ascii}}``)\n- ``shuffle``: Shuffles the value randomly (i. e. ``{{lastname|shuffle}}``)\n- ``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)\n- ``rjust``: Right-justifies the value to the given with (i. e. ``{{company|rjust(40)}}``)\n- ``ljust``: Left-justifies the value to the given with (i. e. ``{{company|ljust(40)}}``)\n- ``center``: Centers the value in width (i. e. ``{{company|center(40)}}``)\n- ``hash``: Calculates the hash with a given hashing algo (i. e. `{{email|hash('md5')}}`)\n\nCustom functions:\n\n- ``translate``\n- ``uuid4``: Returns a new UUIDv4 on every call (i. e. ``{{uuid4()}}``)\n- ``unixtime``: Returns a the current unixtime as float in seconds, (i. e. ``{{unixtime()}}``)\n\nFixed (vocabulary independent) variables:\n\n- ``row``: The row (starting from 0) of the current dataset\n- ``id``: The id or sequence number of the current dataset\n- ``guid``: The representation of the ``id`` in a uuid-like fashion\n\n\n.. _`Jinja2 Templates`: http://jinja.pocoo.org/docs/2.9/templates/\n.. _`Unidecode`: https://pypi.python.org/pypi/Unidecode","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-x%2Ffakr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl-x%2Ffakr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-x%2Ffakr/lists"}