Live data from Hacker News

Faker is a Python package that generates fake data for you

joke2k.net

31–37 of 37 posts

Re: Faker is a Python package that generates fake data for you

#33
post #12
post #6

The name looked familiar and it's indeed inspired by the Faker library for PHP: https://github.com/fzaninotto/Faker Another interesting library that is build on top of Faker is Alice. It allows you to define complex fixtures in .yml: https://github.com/nelmio/alice

Aren't they all kind of inspired by the original Perl implementation? I use the Ruby one for testing. Something kind of similar and worth thinking about is this: http://en.wikipedia.org/wiki/QuickCheck

> Aren't they all kind of inspired by the original Perl implementation?

The original Perl implementation is Data::Faker (https://metacpan.org/pod/Data::Faker). The earliest version available on CPAN appears to be from 2005.

Re: Faker is a Python package that generates fake data for you

#34
post #8

I love faker! It pisses me off a bit that the library is named faker but the package is fake-factory. It trips me up all the time. I use it with factory_boy ( http://factoryboy.readthedocs.org/en/latest/ ) to generate test fixtures that seem to make logical sense. Usernames are real names, birthdays are real dates, etc. I think it helps with experimentation when you're using the REPL and also makes bugs stand out a b…

Nice, fake.bs() looks pretty useful as does fake.catchPhrase()

If I ever start a company, I'm going to run fake.company() and fake.companySuffix() until I find one that looks good.

Re: Faker is a Python package that generates fake data for you

#35
Has anyone ever done a project like this that builds test databases from larger production databases? I mean something that can look at a prod db and model the data in the columns and the relationships between tables and produce a much smaller test db that has the same statistical properties? For numeric columns you could just fit a statistical distribution and sample from that. For names I'm thinking you could look at the frequency charts for first, second, third ... letters and sample according to that. I believe it is also called Markov Chains.

In Andrew Ng's Machine Learning class he talked about taking labeled images and expanding the set by inverting, shearing, flipping, distorting them etc. He called the technique 'data synthesis'.

The test data problem has been hampering my team's ability to create maintainable automated tests.

Re: Faker is a Python package that generates fake data for you

#36
After quick look it seems that this is only poor randomizer. Good generator generates data which isn't too random and internal correlations and ranges are right.

I used to maintain one over 15 years ago.

At least City Street address post number and telephone had to be internally linked. Those are things that can be easily and automatically checked. So those constraints need to be checked also when generating data. It's also silly to give flat address on area where there aren't any flats etc. 30th floor on country side? Oh yeah. Distance based address downtown. As silly.

Re: Faker is a Python package that generates fake data for you

#37

Has anyone ever done a project like this that builds test databases from larger production databases? I mean something that can look at a prod db and model the data in the columns and the relationships between tables and produce a much smaller test db that has the same statistical properties? For numeric columns you could just fit a statistical distribution and sample from that. For names I'm thinking you could look…

I've been working on such a project for a couple years as a solo/on-the-side thing. It's not available as a turnkey product yet, but the technology is working and can build arbitrary amounts of realistic test data (based either on your private data sets, or public sources like census data). I'd love to begin working with others on how exactly to integrate this into their test and development workflows. Email me at ken.woodruff@gmail.com if you'd like discuss further.
Post reply on HN