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
Metadata
Release files for fakedpy 1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fakedpy-1.5.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fakedpy-1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.0 kB
Release files / fakedpy-1.5.tar.gz
| Download URL | fakedpy-1.5.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45766792698b61256c1dff65b9fe1074b543e24984f37b41b9ef2da9f69206de
|
|
BLAKE2b-256 checksum How to use checksums |
88465958948d13bca532e5c07dc10ed14f6451d10aac6a3c1421f18ca0853049
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Release files / fakedpy-1.5-py3-none-any.whl
| Download URL | fakedpy-1.5-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09d027f74051ee72ce6bf33cbbf70cfd9a0cf16c79226320a8200d5fadb1ab00
|
|
BLAKE2b-256 checksum How to use checksums |
94c2f7538c9f185c413355f93d91a9249467c2b58eff8bc6c88f05cd66f350d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|