gitmyhub

faker

Python ★ 19k updated 12d ago

Faker is a Python package that generates fake data for you.

A Python library that generates realistic fake data, names, addresses, phone numbers, emails, instantly for testing, database seeding, and anonymizing real user data during development.

Pythonpytestsetup: easycomplexity 2/5

Faker is a Python library that generates realistic-looking but completely made-up data on demand. When you are building or testing an app, you often need sample data — names, addresses, phone numbers, email addresses, company names, and so on. Writing that data by hand is tedious, and using real personal data from your users in development is a privacy risk. Faker solves this by producing randomized but plausible data instantly with a simple function call.

You just call something like fake.name() or fake.address() and get back a believable fake result every time. It supports localization, meaning you can ask for names and addresses in Italian, Japanese, German, and dozens of other locales rather than always getting American-style data. It works as a Python library you import, a command-line tool you run in a terminal, and also integrates with pytest (a popular testing framework) for automatic test data generation.

You would use Faker any time you need to populate a database with test records, generate sample documents, stress-test a system, or anonymize real data before sharing it with developers. It requires Python 3.8 or higher.

Where it fits