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.
  • 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

fakexyz-2.1.tar.gz (75.2 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.1-py3-none-any.whl (119.0 kB view details)

Uploaded Python 3

File details

Details for the file fakexyz-2.1.tar.gz.

File metadata

  • Download URL: fakexyz-2.1.tar.gz
  • Upload date:
  • Size: 75.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fakexyz-2.1.tar.gz
Algorithm Hash digest
SHA256 2ffd3cff0d50bb385a3c9ef481deaa49f85f0f0e3868dbb039eada7e6c3edcf5
MD5 7a8650cf97a0efc1530b3f8116e7f667
BLAKE2b-256 0e52366dca20bbbba4ac1d4b57b5db790cbd864c1653c6ee2f3ae56098e82c55

See more details on using hashes here.

File details

Details for the file fakexyz-2.1-py3-none-any.whl.

File metadata

  • Download URL: fakexyz-2.1-py3-none-any.whl
  • Upload date:
  • Size: 119.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1fcb2cbdf122acd4cfc19eef1f5563db27732d8b9e116a9b890b22bb2abc46c
MD5 8dd0c2e70dc38500ec466755d22f7e95
BLAKE2b-256 87107075b2f21005d9ecedc3d5c45419da7d8dd0eace7d20f2d2df8ab191f93b

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