Skip to main content

Generate realistic e-commerce test data: products, SKUs, orders, 25+ carriers, 25+ payment methods, coupons, reviews, and more

Project description

faker-ecommerce-provider

PyPI version License

Faker provider for generating realistic e-commerce fake data.

Installation

pip install faker-ecommerce-provider

Usage

from faker import Faker
from faker_ecommerce import EcommerceProvider

fake = Faker()
fake.add_provider(EcommerceProvider)

# Basic usage
fake.product_name()       # 'Premium Leather Electronics Item'
fake.product_name(include_brand=True) # 'Sony Modern Wireless Headphones'
fake.brand_name()         # 'Samsung'
fake.product_description() # 'A modern headphones made with high-quality stainless steel.'
fake.sku()                # 'ABC-1234-XY'
fake.order_id()           # 'ORD-123456789'
fake.tracking_number()    # '1ZABCD1234567890'
fake.tracking_number(carrier="USPS") # '9400100000000000000000'
fake.price()              # '$49.99'
fake.shipping_carrier()   # 'FedEx'
fake.payment_method()     # 'Apple Pay'

# Generate a complete order
order = fake.full_order()
print(order)
# {
#   'order_id': 'ORD-891234567',
#   'product': 'Apple Classic Aluminum Laptop',
#   'sku': 'DLL-4821-KP',
#   'price': '$899.99',
#   'payment_method': 'Credit Card',
#   'customer_type': 'Prime',
#   'status': 'Shipped',
#   'carrier': 'UPS',
#   'tracking_number': '1Z87654...',
#   'review_rating': 5
# }

💡 Tip: Run python showcase.py to see all available features and examples!

Available Methods

Method Example
product_name() Premium Leather Electronics Item
product_name(include_brand=True) Samsung Modern Smartphone
brand_name() Apple, Sony, Nike
product_description() A modern laptop made with high-quality aluminum.
product_category() Electronics, Clothing, Home & Garden
sku() ABC-1234-XY
order_id() ORD-123456789
tracking_number() 1ZABCD1234567890
price() $49.99
discount_percentage() 25%
shipping_carrier() FedEx, UPS, DHL
payment_method() Credit Card, PayPal, Apple Pay
order_status() Pending, Shipped, Delivered
customer_type() Guest, VIP, Prime
return_reason() Wrong Size, Defective
coupon_code() SAVE20
review_rating() 1-5
full_order() Dictionary with complete order details

Running Tests

To run the tests, install the dependencies and run pytest:

pip install .[dev]
pytest tests/

License

MIT

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

faker_ecommerce_provider-1.2.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

faker_ecommerce_provider-1.2.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file faker_ecommerce_provider-1.2.0.tar.gz.

File metadata

  • Download URL: faker_ecommerce_provider-1.2.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for faker_ecommerce_provider-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b61ca793440144909f3388eea57bc91b78c4efbf9f0eccdc58fbc59d571b3664
MD5 4434fd2b7eec85cd6c58ef0d6dce4ce4
BLAKE2b-256 d6e48e644ad4c85539d01036e0354ad6d0ecb4eb746101688c2c94ca5a5f0279

See more details on using hashes here.

Provenance

The following attestation bundles were made for faker_ecommerce_provider-1.2.0.tar.gz:

Publisher: release.yml on rodrigobnogueira/faker-ecommerce-provider

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file faker_ecommerce_provider-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for faker_ecommerce_provider-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d77ca722237c1bcc8891a4183f4a99fde97b7861f2f5ac6f5e447b2965ed9c3
MD5 8d26d70fd0f217f63d06734a55fc2f87
BLAKE2b-256 eb6015404c392711694866249ab19c326b845ff9b278c6e50e04bc694a757960

See more details on using hashes here.

Provenance

The following attestation bundles were made for faker_ecommerce_provider-1.2.0-py3-none-any.whl:

Publisher: release.yml on rodrigobnogueira/faker-ecommerce-provider

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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