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.
- Intelligent Country Suggestions: Provides highly relevant suggestions for country names and codes if the input is incorrect, prioritizing exact matches, best name matches, and prefix-based code matches.
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 intelligent 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</code>)
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</code>)
# ๐ฌ๐ญ Ghana (<code>GH</code>)
# ๐ฌ๐ง United Kingdom (<code>GB</code>)
try:
address = xyz.get_random_address(country="zz") # No close match
except ValueError as e:
print(e)
# Expected output: Country 'zz' not found.
# Did you mean?
# Please check the supported countries list using the `!country` command.
Listing Supported Countries
from fakexyz import FakeXYZ
xyz = FakeXYZ()
countries = xyz.get_available_countries()
print("Supported Countries:", countries)
Supported Countries
Here is a list of countries currently supported by FakeXYZ:
- ๐ฆ๐ซ Afghanistan (AF)
- ๐ฆ๐ฑ Albania (AL)
- ๐ฉ๐ฟ Algeria (DZ)
- ๐ฆ๐ฎ Anguilla (AI)
- ๐ฆ๐ถ Antarctica (AQ)
- ๐ฆ๐ท Argentina (AR)
- ๐ฆ๐ฒ Armenia (AM)
- ๐ฆ๐บ Australia (AU)
- ๐ฆ๐น Austria (AT)
- ๐ฆ๐ฟ Azerbaijan (AZ)
- ๐ง๐ฉ Bangladesh (BD)
- ๐ง๐ฒ Bermuda (BM)
- ๐ง๐ด Bolivia (BO)
- ๐ง๐น Bhutan (BT)
- ๐ง๐ท Brazil (BR)
- ๐ง๐ฌ Bulgaria (BG)
- ๐ฐ๐ญ Cambodia (KH)
- ๐จ๐ฒ Cameroon (CM)
- ๐จ๐ฆ Canada (CA)
- ๐จ๐ฑ Chile (CL)
- ๐จ๐ณ China (CN)
- ๐จ๐ด Colombia (CO)
- ๐จ๐ฟ Czechia (CZ)
- ๐ฉ๐ฐ Denmark (DK)
- ๐ช๐ฌ Egypt (EG)
- ๐ซ๐ฎ Finland (FI)
- ๐ซ๐ท France (FR)
- ๐ฌ๐ช Georgia (GE)
- ๐ฉ๐ช Germany (DE)
- ๐ฌ๐ญ Ghana (GH)
- ๐ฌ๐ท Greece (GR)
- ๐ฌ๐ฑ Greenland (GL)
- ๐ฌ๐น Guatemala (GT)
- ๐ญ๐ฐ Hong Kong (HK)
- ๐ฎ๐ธ Iceland (IS)
- ๐ฎ๐ณ India (IN)
- ๐ฎ๐ฉ Indonesia (ID)
- ๐ฎ๐ถ Iraq (IQ)
- ๐ฎ๐ช Ireland (IE)
- ๐ฎ๐ฑ Israel (IL)
- ๐ฎ๐น Italy (IT)
- ๐ฏ๐ต Japan (JP)
- ๐ฏ๐ด Jordan (JO)
- ๐ฐ๐ฟ Kazakhstan (KZ)
- ๐ฐ๐ช Kenya (KE)
- ๐ง๐ญ Kingdom of Bahrain (BH)
- ๐ง๐ช Kingdom of Belgium (BE)
- ๐ฑ๐ง Lebanon (LB)
- ๐ฒ๐พ Malaysia (MY)
- ๐ฒ๐ป Maldives (MV)
- ๐ฒ๐ท Mauritania (MR)
- ๐ฒ๐ฝ Mexico (MX)
- ๐ฒ๐ฆ Morocco (MA)
- ๐ฒ๐ฒ Myanmar (MM)
- ๐ณ๐ต Nepal (NP)
- ๐ณ๐ฑ Netherlands (NL)
- ๐ณ๐ฟ New Zealand (NZ)
- ๐ณ๐ช Niger (NE)
- ๐ณ๐ฌ Nigeria (NG)
- ๐ณ๐ด Norway (NO)
- ๐ด๐ฒ Oman (OM)
- ๐ต๐ฐ Pakistan (PK)
- ๐ต๐ธ Palestine (PS)
- ๐ต๐ฆ Panama (PA)
- ๐ต๐ช Peru (PE)
- ๐ต๐ญ Philippines (PH)
- ๐ต๐ฑ Poland (PL)
- ๐ต๐น Portugal (PT)
- ๐ถ๐ฆ Qatar (QA)
- ๐ท๐ด Romania (RO)
- ๐ท๐บ Russia (RU)
- ๐ธ๐ฒ San Marino (SM)
- ๐ธ๐ฆ Saudi Arabia (SA)
- ๐ธ๐ฌ Singapore (SG)
- ๐ฟ๐ฆ South Africa (ZA)
- ๐ฐ๐ท South Korea (KR)
- ๐ช๐ธ Spain (ES)
- ๐ฑ๐ฐ Sri Lanka (LK)
- ๐ธ๐ฉ Sudan (SD)
- ๐ธ๐ช Sweden (SE)
- ๐จ๐ญ Switzerland (CH)
- ๐น๐ผ Taiwan (TW)
- ๐น๐ฟ Tanzania (TZ)
- ๐น๐ญ Thailand (TH)
- ๐น๐ท Turkiye (TR)
- ๐บ๐ฌ Uganda (UG)
- ๐บ๐ฆ Ukraine (UA)
- ๐ฆ๐ช United Arab Emirates (AE)
- ๐ฌ๐ง United Kingdom (GB)
- ๐บ๐ธ United States (US)
- ๐ป๐ช Venezuela (VE)
- ๐ป๐ณ Vietnam (VN)
- ๐พ๐ช Yemen (YE)
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.3.tar.gz.
File metadata
- Download URL: fakexyz-2.3.tar.gz
- Upload date:
- Size: 78.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 |
cf1fdf275be53be67360762453c4986308d9bed2c0d5f71d1297d93b4bd08052
|
|
| MD5 |
dfcdebfc7774483139726d8532af5ef2
|
|
| BLAKE2b-256 |
48f674420cea55e5862e3dbb582a0367490c07dddc48c6701362ad7e13d84b0f
|
File details
Details for the file fakexyz-2.3-py3-none-any.whl.
File metadata
- Download URL: fakexyz-2.3-py3-none-any.whl
- Upload date:
- Size: 120.8 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 |
60ce0aa18e4c00cd6c8dcb140ef61851865436e8be9cca0a41719f6bf4aee93a
|
|
| MD5 |
965fa7a8b655aff80e18a9a2bc46fa19
|
|
| BLAKE2b-256 |
7e7f56f0548dae9bd3b764b5e53413b88e54f76a4305b492dca0e5b1f04211dd
|