Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request ability to use faker to generate more robust data #5

Open
rsaylor73 opened this issue May 18, 2022 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@rsaylor73
Copy link

The process now that generates random hash data works but it would be useful if we could pipe to a faker data generator to be able to take the production data and replace with test data that is human readable.

https://github.com/joke2k/faker

@ppomes ppomes added enhancement New feature or request labels Jul 12, 2022
@ppomes
Copy link
Owner

ppomes commented Apr 27, 2023

Hi @rsaylor73,

Sorry for the so looooong delay.... Just to let you know, I started to work on this request.

Pierre

@alexliam83
Copy link

Hi @ppomes,

Is there any documentation about this update?

Thank you in advance!

@ppomes
Copy link
Owner

ppomes commented Mar 26, 2024

Nope :-( Finally did not have any time to do it.... :-(

@ppomes
Copy link
Owner

ppomes commented Apr 8, 2024

@rsaylor73, @alexliam83 , @davidmr163,

I just added some code as a draft, to provide python support. Python faker can now be used.

You need to install python-dev libraries (for Ubuntu: apt-get install python3-dev)

Then, you need to build from branch issue5:

git checkout issue5
git pull
./autogen.sh
./configure --enable-python
make
make check

For the faker example, assuming faker is installed (for Ubuntu : apt-get install python3-fake-factory)

PYTHONPATH=$(pwd)/tests main/myanon -f tests/faker_test.conf < tests/faker_test.sql

Key points are:

  • a python script is given in the global section of the config file (without .py extension)
  • the path of this script must be set by the env variable PYTHONPATH
  • this script must contain all the functions you need (ie : faker function for names, faker function for emails, etc...)
  • for each field, you can select which faker function you want to use

Doc is not yet updated.

Feedback needed! If this new feature seems ok for you, I will do more tests/improvements, I will update the doc and merge into main branch.

Thanks!
Pierre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants