Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you. Starting from version 4.0.0, Faker dropped support for Python 2 and from version 5.0.0 only supports Python 3.6 and above. If you still need Python 2 compatibility, please install version 3.0.1 in the meantime, and please consider updating your codebase to support Python 3 so you can enjoy the latest features Faker has to offer. Please see the extended docs for more details, especially if you are upgrading from version 2.0.4 and below as there might be breaking changes. This package was also previously called fake-factory which was already deprecated by the end of 2016, and much has changed since then, so please ensure that your project and its dependencies do not depend on the old package.

Features

  • Use faker.Faker() to create and initialize a faker generator, which can generate data by accessing properties named after the type of data you want
  • Each call to method fake.name() yields a different (random) result. This is because faker forwards faker.Generator.method_name() calls to faker.Generator.format(method_name)
  • Faker also has its own pytest plugin which provides a faker fixture you can use in your tests
  • Each of the generator properties (like name, address, and lorem) are called “fake”. A faker generator has many of them, packaged in “providers”
  • You can check available Faker locales in the source code
  • The Faker constructor takes a performance-related argument called use_weighting, and it specifies whether to attempt to have the frequency of values match real-world frequencies

Project Samples

Project Activity

See All Activity >

Categories

Package Managers

License

MIT License

Follow Faker for Python

Faker for Python Web Site

Other Useful Business Software
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Faker for Python!

Additional Project Details

Programming Language

Python

Related Categories

Python Package Managers

Registered

2021-05-11