Skip to main content

Generate fake user and address information for various countries.

Project description

FakeXYZ

FakeXYZ is a Python library that generates fake addresses for various countries.

Installation

To install the library, you can use pip:

pip install .

Or, if you want to install it in editable mode:

pip install -e .

Usage

Here's how you can use the library to generate fake addresses:

from fakexyz import FakeXYZ

# Initialize the generator
xyz = FakeXYZ()

# Get a list of available countries
available_countries = xyz.get_available_countries()
print("Available Countries:")
print(available_countries)

# Get a single random address from any country
random_address = xyz.get_random_address()
print("\nRandom Address:")
print(random_address)

# Get a single random address from a specific country (e.g., 'US')
us_address = xyz.get_random_address(country='us')
print("\nRandom US Address:")
print(us_address)

# Get 3 random addresses from any country
multiple_addresses = xyz.get_random_addresses(count=3)
print("\nThree Random Addresses:")
for address in multiple_addresses:
    print(address)

# Get 2 random addresses from a specific country (e.g., 'GB')
gb_addresses = xyz.get_random_addresses(count=2, country='gb')
print("\nTwo Random GB Addresses:")
for address in gb_addresses:
    print(address)

API Usage

To run the API, first install the dependencies:

pip install -r requirements.txt

Then, run the API:

python api.py

The API will be available at http://127.0.0.1:5000.

Get a random address

Send a GET request to /api/address with the code parameter.

Example:

http://127.0.0.1:5000/api/address?code=GB

Contributing

Contributions are welcome! Please feel free to submit a pull request.

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.0.tar.gz (74.4 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.0-py3-none-any.whl (118.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fakexyz-2.0.tar.gz
Algorithm Hash digest
SHA256 da2976d73bfa13e298d78a2cd20d59259406f2dbfcb96576bd576d3296d2bcc5
MD5 1dfb026e4d3278c03c51a8d7164558bc
BLAKE2b-256 9ace10c3cc97eb2660b368c8bc4525e797c2b58b5a011f74e85c2ded3e46d5fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fakexyz-2.0-py3-none-any.whl
  • Upload date:
  • Size: 118.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e53dfcaa0206062de5b5900a03893f008a3b30419fd96906f578fc1d79b08a6d
MD5 9a51085f18b9b92a4cef79ce86cca75e
BLAKE2b-256 c993ef444a9503b2847443d42d038840e11c0e5c44ad72941d8b0f984f2ac65e

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