https://github.com/jiro4989/faker
Faker is a Nim package that generates fake data for you.
https://github.com/jiro4989/faker
cli data faker generator lib nim
Last synced: about 1 month ago
JSON representation
Faker is a Nim package that generates fake data for you.
- Host: GitHub
- URL: https://github.com/jiro4989/faker
- Owner: jiro4989
- License: mit
- Created: 2019-12-16T23:21:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-06T01:43:12.000Z (10 months ago)
- Last Synced: 2024-11-15T05:32:28.829Z (6 months ago)
- Topics: cli, data, faker, generator, lib, nim
- Language: Nim
- Homepage: https://jiro4989.github.io/faker/faker.html
- Size: 744 KB
- Stars: 40
- Watchers: 5
- Forks: 7
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-nim - faker - A Nim package that generates fake data for you. (Development Tools / Testing)
README
=====
faker
=====|gh-actions|
faker is a Nim package that generates fake data for you.
faker is heavily inspired by `Python Faker `_.**WIP**
.. contents:: Table of contents
:depth: 3Installation
============.. code-block:: Bash
nimble install faker
Usage
=====Library
-------.. code-block:: Nim
import faker
block:
let fake = newFaker("ja_JP")
echo fake.address()
# -> 茨城県港区東三島31丁目3番16号echo fake.name()
# -> 若松 香織block:
# default locale is `LANG` environment variableslet fake = newFaker()
echo fake.address()
# -> 94622 Cesar Camp Apt. 13 South Caitlyn, HI 35128echo fake.name()
# -> Bruce Wagner DDSCLI
----.. code-block:: Bash
$ faker address
大阪府調布市湯宮27丁目24番12号# Set locale and run
$ LANG=en_US.UTF-8 faker name
Mr. Leonard JohnsSupported locale
================I understand only English and Japanese.
====== ===========
Locale Description
====== ===========
en_US English
ja_JP Japanese
fa_IR Persian
====== ===========Providers
=========TODO list.
- [ ] base
- [o] faker.provider.address
- [o] faker.provider.automotive
- [o] faker.provider.bank
- [ ] faker.provider.barcode
- [ ] faker.provider.color
- [o] faker.provider.company
- [ ] faker.provider.credit_card
- [o] faker.provider.currency
- [ ] faker.provider.date_time
- [o] faker.provider.file
- [ ] faker.provider.geo
- [ ] faker.provider.internet
- [o] faker.provider.isbn
- [o] faker.provider.job
- [ ] faker.provider.lorem
- [o] faker.provider.misc
- [o] faker.provider.person
- [o] faker.provider.phone_number
- [ ] faker.provider.profile
- [ ] faker.provider.python
- [o] faker.provider.ssn
- [o] faker.provider.user_agentAPI document
============* https://jiro4989.github.io/faker/faker.html
Development
===========Adding new module
-----------------You can generate a new module with `nimble genMod` task.
Run below... code-block:: Bash
$ nimble genMod new_module
Please see other module implements, and edit a generated module.
Update provider code
--------------------You can update `src/faker/provider/*.nim` codes with `generator` tool.
Run below if you had edited a new module... code-block:: Bash
$ nimble tool
$ ./tools/generatorSee `src/faker/provider/*.nim`.
A new provider will be generated... code-block: Bash
$ ls -1 src/faker/provider/*.nim
src/faker/provider/address.nim
src/faker/provider/job.nim
src/faker/provider/person.nim
src/faker/provider/phone_number.nim
src/faker/provider/new_module.nim # <--- New provider.
src/faker/provider/util.nimPull request
============Welcome :heart:
LICENSE
=======MIT
.. |gh-actions| image:: https://github.com/jiro4989/faker/workflows/test/badge.svg
:target: https://github.com/jiro4989/faker/actions