A Python library for generating fake data with various output formats.
Project description
FakedPy
A Python library for generating fake data with various output formats.
Installation
pip install fakedpy
Features
- Generate various types of fake data
- Support multiple output formats (CSV, JSON, Excel, Parquet), but CSV as a default
- Support localization (including Indonesian)
- Generate related/dependent data
- Easy to use and flexible
Basic Usage
from fakedpy import FakedGenerator
# Initialize generator
generator = FakedGenerator(locale='id_ID') # For Indonesian data
# orr
generator = FakedGenerator(locale=['id_ID', 'en_US']) # For mixed data
# Generate simple data
df = generator.generate(
rows=5,
fields=["name", "email", "address"]
)
# Save to different formats
df = generator.generate(
rows=5,
fields=["name", "email", "job"],
output_format="json",
output_path="data/output"
)
Available Fields
Personal Information
- name: Full name
- first_name: First name
- last_name: Last name
- email: Email address
- phone_number: Phone number
- date: Date
- gender: Gender
Address Information
- address: Full address
- street_address: Street address
- city: City
- state: State/Province
- country: Country
- postcode: Postal code
- latitude: Latitude
- longitude: Longitude
Internet Information
- username: Username
- password: Password
- domain_name: Domain name
- url: URL address
- ipv4: IPv4 address
- ipv6: IPv6 address
- mac_address: MAC address
Company Information
- company: Company name
- job: Job title
Financial Information
- credit_card_number: Credit card number
- credit_card_provider: Credit card provider
- currency_code: Currency code
Technology
- file_name: File name
- file_extension: File extension
- mime_type: MIME type
Miscellaneous
- text: Text paragraph
- word: Single word
- sentence: Single sentence
- paragraph: Full paragraph
- color_name: Color name
- hex_color: HEX color code
- rgb_color: RGB color code
Advanced Usage
Related Data
# Generate data with ID and department
df = generator.generate(
rows=5,
fields=["user_id", "name", "department"],
related_fields={
"user_id": {"type": "counter", "start": 1000},
"department": {
"type": "choice",
"values": ["IT", "HR", "Finance", "Marketing"]
}
}
)
Different Output Formats
# CSV
df = generator.generate(
rows=10,
fields=["name", "email"],
output_format="csv",
output_path="data/users"
)
# JSON
df = generator.generate(
rows=10,
fields=["name", "email"],
output_format="json",
output_path="data/users"
)
# Excel
df = generator.generate(
rows=10,
fields=["name", "email"],
output_format="excel",
output_path="data/users"
)
# Parquet
df = generator.generate(
rows=10,
fields=["name", "email"],
output_format="parquet",
output_path="data/users"
)
Contributing
Feel free to contribute by creating issues or pull requests in this repository.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fakedpy-1.5.tar.gz
(6.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
fakedpy-1.5-py3-none-any.whl
(7.5 kB
view details)
File details
Details for the file fakedpy-1.5.tar.gz.
File metadata
- Download URL: fakedpy-1.5.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45766792698b61256c1dff65b9fe1074b543e24984f37b41b9ef2da9f69206de
|
|
| MD5 |
183ec750a632d021b6bba48c69eaa86e
|
|
| BLAKE2b-256 |
88465958948d13bca532e5c07dc10ed14f6451d10aac6a3c1421f18ca0853049
|
File details
Details for the file fakedpy-1.5-py3-none-any.whl.
File metadata
- Download URL: fakedpy-1.5-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09d027f74051ee72ce6bf33cbbf70cfd9a0cf16c79226320a8200d5fadb1ab00
|
|
| MD5 |
ada37ff55301f2b7a3f3081c916c1199
|
|
| BLAKE2b-256 |
94c2f7538c9f185c413355f93d91a9249467c2b58eff8bc6c88f05cd66f350d1
|