Skip to main content

A package that generates random address, names, phonenumbers and profile to fulfill website registration requirements.

Project description

Pypal - A Random Profile Generator

Build Status

Build Status

Pypal is a Python package that generates profiles with random human-like and fantasy names, US or UK addresses, domestic or international phone numbers, and emails. It is useful for testing, development, and anonymized data generation.

Installation

If you want to import the package, install from: [https://pypi.org/project/pypal-nyu/] using pip:

pip install pypal-nyu 

Currently our package has version 0.1.6.

Note

pip install pypal 

will give you a different package.

Example Usage

After you install pypal-nyu from pypi, try

python example_usage.py

to try to randomly generate some names for usage.

Function Usage

Function: generate_name

Generates a random name (either a human name or a fantasy name).

Parameters

  • type (str): "human" or "fantasy", determining the type of name generated.
  • length (int): The number of names to generate.

Returns

  • list[str]: A list of generated names.

Example

from pypal.generator import generate_name

# Generate a single human name
print(generate_name(type="human", length=1))

# Generate multiple fantasy names
print(generate_name(type="fantasy", length=3))

Function: generate_address

Generates a random address in US or UK format, either in a short or long version.

Parameters

  • country (str):
    • "US" → Generates a US-based address.
    • "UK" → Generates a UK-based address.
  • format (str):
    • "short" → Returns street, city.
    • "long" → Returns street, city, postal_code, country.

Returns

  • str: A properly formatted address.

Example

from pypal.generator import generate_address

# Generate a US address in short format
print(generate_address(country="US", format="short"))

# Generate a UK address in long format
print(generate_address(country="UK", format="long"))

Function: generate_phone_number

Generates a random US phone number, either in domestic format or with an international country code.

Parameters

  • style (str):
    • "domestic" → Generates a US phone number like (XXX) XXX-XXXX.
    • "international" → Generates a phone number with country code +1-XXX-XXX-XXXX.

Returns

  • str: A properly formatted phone number.

Example Usage

from pypal.generator import generate_phone_number

# Generate a domestic phone number
print(generate_phone_number(style="domestic"))

# Generate an international phone number
print(generate_phone_number(style="international"))

Function: generate_profile

Generates a full random user profile, including a name, address, phone number, and email.

Parameters

  • include_email (bool, default=True):
    • True → Includes a generated email.
    • False → Excludes the email field.
  • include_phone (bool, default=True):
    • True → Includes a generated phone number.
    • False → Excludes the phone field.

Returns

  • dict: A dictionary containing:
    • "name" (str): A randomly generated full name.
    • "address" (str): A randomly generated address.
    • "email" (str, optional): A generated email (first@example.com).
    • "phone" (str, optional): A generated phone number.

Example Usage

from pypal.generator import generate_profile

# Generate a full profile with email & phone
print(generate_profile(include_email=True, include_phone=True))

# Generate a profile with only a name & address
print(generate_profile(include_email=False, include_phone=False))

Contributing

We welcome contributions from the community! Follow these steps to set up your development environment:

1. Clone the Repository

Fork the repository on GitHub, then clone your fork locally:

git clone https://github.com/software-students-spring2025/3-python-package-pypal.git
cd 3-python-package-pypal

2. Set Up Virtual Environment

Using Pipenv:

pip install pipenv
pipenv install --dev
pipenv shell 

Using Conda:

conda create -n pypal python=3.12
conda activate pypal

3. Build the Package

Build the package locally:

pip install .

4. Run Unit Tests

Ensure all tests pass before submitting a pull request:

cd tests
pytest test_generator.py

5. Make Your Contributions

1. Create a new branch:

git checkout -b your-feature-branch

2. Make your changes and commit:

git add .
git commit -m "Describe your changes"

3. Push to your fork:

git push origin your-feature-branch

4. Create pull request from your fork to the main repository.

Teammates

Sophia Gu

Jason Lin

Allen Ni

Zifan Zhao

Running the Project on Any Platform

To ensure cross-platform compatibility, we recommend using a virtual environment as described in the Contributing section. The package is tested on Linux, macOS, and Windows. Feel free to explore our work!

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

pypal_nyu-0.1.6.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

pypal_nyu-0.1.6-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file pypal_nyu-0.1.6.tar.gz.

File metadata

  • Download URL: pypal_nyu-0.1.6.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pypal_nyu-0.1.6.tar.gz
Algorithm Hash digest
SHA256 22df804e35e13cc35312d164d45d6b72bd70cfd1906106be0f28c5ae8f1757e1
MD5 0d5bef90a23f9a8a41d9090786ae662c
BLAKE2b-256 650da78f077650590d018d9f0b16200be11a526cdcbd7d49330e37bbd9640e5e

See more details on using hashes here.

File details

Details for the file pypal_nyu-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pypal_nyu-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pypal_nyu-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7817889205a95a4000349e867151e5d0683b798b4c5830ec5e57081f01a09a30
MD5 c603cf5b69eec48e69f76bbb71ab78a0
BLAKE2b-256 a3197380b5dcec3544795fc37db2c6b4147c189c27fd08c507faa3ad9132bb0f

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