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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
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