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
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
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