Generate fake user and address information for various countries.
Project description
FakeXYZ
FakeXYZ is a Python library designed to generate fake user and address information for various countries. It's useful for testing, data anonymization, and populating databases with realistic-looking data.
Features
- Multi-country Support: Generate data for a wide range of countries.
- Random Address Generation: Get complete address details including street, city, state, postal code, and more.
- User Information: Generate names, genders, phone numbers, and avatars.
- Fuzzy Matching for Countries: Provides intelligent suggestions for country names and codes if the input is incorrect.
Installation
You can install FakeXYZ using pip:
pip install fakexyz
Usage
Generating a Random Address
from fakexyz import FakeXYZ
xyz = FakeXYZ()
# Get a random address for a specific country (e.g., United States)
address = xyz.get_random_address(country="US")
print(address)
# Get a random address for a specific country by full name (e.g., Bangladesh)
address = xyz.get_random_address(country="Bangladesh")
print(address)
# Get multiple random addresses
addresses = xyz.get_random_addresses(count=3, country="CA")
for addr in addresses:
print(addr)
Handling Incorrect Country Input
If you provide an incorrect country name or code, FakeXYZ will now provide suggestions:
from fakexyz import FakeXYZ
xyz = FakeXYZ()
try:
address = xyz.get_random_address(country="bangldesh") # Typo
except ValueError as e:
print(e)
# Expected output: Country 'bangldesh' not found. Did you mean Bangladesh (Code: BD)?
try:
address = xyz.get_random_address(country="gv") # Typo
except ValueError as e:
print(e)
# Expected output: Country 'gv' not found. Did you mean Georgia (Code: GE)?
Listing Supported Countries
from fakexyz import FakeXYZ
xyz = FakeXYZ()
countries = xyz.get_available_countries()
print("Supported Countries:", countries)
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
This project is licensed under the MIT License. See the LICENSE.txt file for details.
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
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
File details
Details for the file fakexyz-2.2.tar.gz.
File metadata
- Download URL: fakexyz-2.2.tar.gz
- Upload date:
- Size: 75.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec15490a927d8be6d9961db4afabce775d457eb0b42d5c6d6d529e8516a75770
|
|
| MD5 |
228b74d6c82abb4bed11a3f0fe2596c5
|
|
| BLAKE2b-256 |
8e4780aaf2101f35b0c42fc2943da5435593d3a092ac44d8d7bb016a3f9196de
|
File details
Details for the file fakexyz-2.2-py3-none-any.whl.
File metadata
- Download URL: fakexyz-2.2-py3-none-any.whl
- Upload date:
- Size: 119.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52f0d45fa121bf473211486ba6401ad661366e42092246270b115fddaa8cb67d
|
|
| MD5 |
ac091e206c7214ed03c04ac8ff204652
|
|
| BLAKE2b-256 |
a10cc6d42860f1c7cd8860499981dbab0d313765918b16c0caac5e65daa49e70
|