Skip to main content

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

fakexyz-2.3.tar.gz (78.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fakexyz-2.3-py3-none-any.whl (120.8 kB view details)

Uploaded Python 3

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

Hashes for fakexyz-2.3.tar.gz
Algorithm Hash digest
SHA256 cf1fdf275be53be67360762453c4986308d9bed2c0d5f71d1297d93b4bd08052
MD5 dfcdebfc7774483139726d8532af5ef2
BLAKE2b-256 48f674420cea55e5862e3dbb582a0367490c07dddc48c6701362ad7e13d84b0f

See more details on using hashes here.

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

Hashes for fakexyz-2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 60ce0aa18e4c00cd6c8dcb140ef61851865436e8be9cca0a41719f6bf4aee93a
MD5 965fa7a8b655aff80e18a9a2bc46fa19
BLAKE2b-256 7e7f56f0548dae9bd3b764b5e53413b88e54f76a4305b492dca0e5b1f04211dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page