Our take
- Activity
- 20
- Community
- 38
- Issues
- 21
- Pull requests
- 21
-2 stars in the last 10 days
Overview
fake2db is a Python command-line tool for creating databases populated with fake but valid data. It helps developers and testers work with populated datasets without manually creating records or using production data.
It supports SQLite, MySQL, PostgreSQL, MongoDB, Redis, and CouchDB. Use it when you need a quick dataset for local development, test runs, or database demonstrations, rather than a general-purpose data migration or production database tool.
Key Features
- Generates data for six database types: SQLite, MySQL, PostgreSQL, MongoDB, Redis, and CouchDB.
- Sets the number of rows to generate with
--rows. - Can generate data in a selected locale, with
en_USas the default. - Accepts a seed to reproduce generated datasets, though UUID values remain random.
- Allows custom fields through the
--customoption and supported data types. - Supports optional database names and connection settings such as host, port, username, and password.
- Can be used with the FoundationDB SQL Layer through the PostgreSQL generator and SQL Layer port.
Use Cases
- Developers can populate a local database with sample records while building an application.
- Test engineers can prepare datasets for database integration tests without using real customer information.
- Educators and tutorial authors can create populated databases for exercises and demonstrations.
- Teams evaluating database-backed tools can generate data across supported SQL and NoSQL systems.
Getting Started
Install from PyPI and generate a sample SQLite database:
pip install fake2db
fake2db --rows 200 --db sqlite
See the README for backend-specific dependencies, connection options, and custom generation details.
Alternatives
- mimesis: Mimesis is a Python data-generation library for building records and datasets; fake2db focuses on populating supported databases directly.
- factory_boy: factory_boy builds test objects through configurable factories and ORM integrations, rather than generating populated databases through a standalone CLI.
- mixer: Mixer generates test instances for Python models and can save them through an ORM, while fake2db seeds databases across SQL and NoSQL backends.
| Project | Language | License | Stars | Status |
|---|---|---|---|---|
| fake2db | Python | GPL-2.0 | 2.3k | Not checked yet |
| mimesis | Python | MIT | 4.8k | Active |
| factory_boy | Python | MIT | 3.8k | Quiet |
| mixer | Python | Other | 954 | Inactive |
Considerations
- Database drivers are optional and must be installed separately for the relevant backends. PostgreSQL also requires
pg_configto installpsycopg2. - Seeded runs are not fully deterministic because UUID values remain random.
- The repository was last pushed on 2019-11-25, so check compatibility with current Python versions, database servers, and drivers before adopting it.
- The GPL-2.0 license may affect how the software can be incorporated or redistributed.
Found this useful?
Share it with someone who would like fake2db.