https://github.com/zh-plus/faker-openai
Generate fake data with OpenAI's GPT-3 API.
https://github.com/zh-plus/faker-openai
data fake fake-data fake-data-generator faker openai-api python test-data test-data-generator testing
Last synced: 3 months ago
JSON representation
Generate fake data with OpenAI's GPT-3 API.
- Host: GitHub
- URL: https://github.com/zh-plus/faker-openai
- Owner: zh-plus
- License: mit
- Created: 2023-05-10T11:08:04.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-11T10:46:33.000Z (about 2 years ago)
- Last Synced: 2025-03-13T09:52:57.975Z (3 months ago)
- Topics: data, fake, fake-data, fake-data-generator, faker, openai-api, python, test-data, test-data-generator, testing
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenFaker
*OpenFaker* is a Python package that utilizes OpenAI's GPT series model to generate fake data.
**This new project is rapidly underway, and we welcome any issues or pull requests.**
## Basic Usage
Install with pip:
```shell
pip install openfaker
```To generate data, create and initialize a faker generator using the `faker.Faker()` method. Access properties named after the type of data you want to generate.
```python
from openfaker import Faker
from openfaker.utils import setup_openaisetup_openai('') # Get your API key from https://platform.openai.com/account/api-keys
faker = Faker()
faker.name()
# 'John Doe'faker.address(2)
# ['426 Jordy Lodge', 'Cartwrightshire, SC 88120-6700']
```## Todo
- Add basic faker data types (reference to [faker-js](https://github.com/faker-js/faker) and [faker-python](https://github.com/joke2k/faker))
- [ ] Fine-grained address (city, country, street, etc.)
- [ ] Fine-grained name (first name, last name, job, etc.)
- [ ] Color
- [ ] Company
- [ ] Internet
- [ ] Image
- [ ] Store commonly used fake data locally to avoid calling the OpenAI API for small amounts of data.
- [ ] Test the stability of the prompt.## Credits
- https://github.com/faker-js/faker
- https://github.com/joke2k/faker
- https://github.com/openai/openai-python
- https://github.com/flyingcircusio/pycountry