Skip to main content

Faker Food Shop Provider

PyPI version Python 3.7+ License: MIT

A custom Faker provider for generating realistic fake data for food shops, restaurants, bakeries, and more. This provider supports multiple locales (en_US, fr_FR, it_IT, es_ES) to generate localized shop names, products, and drinks.


🌍 Supported Locales

Locale Language Shop Types Example Shop Name Example Product
en_US English (US) pizza place, bakery, kebab shop, etc. "Pizza Hut" "pepperoni pizza"
fr_FR French (France) pizzeria, boulangerie, kebab, etc. "Boulangerie Martin" "baguette tradition"
it_IT Italian (Italy) pizzeria, panificio, gelateria, etc. "Pizzeria da Michele" "margherita"
es_ES Spanish (Spain) pizzería, panadería, kebab, etc. "Panadería La Ideal" "barra de pan"

Default locale: en_US (if no locale is specified).


📦 Installation

pip install faker-food-shop

Or install from the repository:

cd /path/to/project
git clone https://github.com/arribo44/faker-food-shop.git
cd faker-food-shop
pip install -e .

🚀 Usage

Basic Setup

from faker import Faker
from faker_food_shop import FoodShopProvider

# Use default locale (en_US)
fake = Faker()
fake.add_provider(FoodShopProvider)

# Or specify a locale
fake_fr = Faker('fr_FR')
fake_fr.add_provider(FoodShopProvider)

fake_it = Faker('it_IT')
fake_it.add_provider(FoodShopProvider)

fake_es = Faker('es_ES')
fake_es.add_provider(FoodShopProvider)

🏪 Shop Types & Names

# Random shop type (depends on locale)
shop_type = fake.shop_type()  # "pizza place" (en_US), "pizzeria" (fr_FR), etc.

# Random shop name
shop_name = fake.shop_name()  # "Pizza Hut" (en_US), "Boulangerie Martin" (fr_FR), etc.

# Shop name for a specific type
pizzeria_name = fake.shop_name("pizza place")  # en_US
boulangerie_name = fake_fr.shop_name("boulangerie")  # fr_FR

🍹 Drinks

# Random drink (any category)
drink = fake.drink()  # "coffee" (en_US), "vin rouge" (fr_FR), "caffè" (it_IT)

# Drink by category
alcoholic = fake.drink("alcoholic")  # "beer", "whiskey", "bière blonde"
non_alcoholic = fake.drink("non_alcoholic")  # "water", "jus d'orange", "aranciata"
hot = fake.drink("hot")  # "coffee", "thé", "caffè latte"

# Random drink category
drink_category = fake.drink_category()  # "alcoholic", "non_alcoholic", "hot"

🍕 Products by Shop Type

# Random product for a shop type
product = fake.product("pizza place")  # "pepperoni pizza" (en_US)
product_fr = fake_fr.product("pizzeria")  # "margherita" (fr_FR)

# Product with specific category
pizza = fake.product("pizza place", "pizzas")  # "margherita"
bread = fake.product("bakery", "breads")  # "sourdough"

# Random product category for a shop type
category = fake.product_category("bakery")  # "breads", "pastries", "viennoiseries"

🍰 Specific Product Helpers

Pizzas

# Pizza name
pizza = fake.pizza()  # "pepperoni" (en_US), "margherita" (fr_FR), "diavola" (it_IT)

# Pizza size
size = fake.pizza_size()  # "large" (en_US), "grande" (fr_FR), "media" (it_IT)

# Dough type
dough = fake.pizza_dough()  # "thin" (en_US), "fine" (fr_FR), "sottile" (it_IT)

Bakery

bread = fake.bread()  # "sourdough" (en_US), "baguette tradition" (fr_FR)
pastry = fake.pastry()  # "croissant" (en_US/fr_FR), "sfogliatella" (it_IT)

Kebab

meat = fake.kebab_meat()  # "beef" (en_US), "viande d'agneau" (fr_FR)
sauce = fake.kebab_sauce()  # "garlic sauce" (en_US), "blanche" (fr_FR)

Crepes

sweet = fake.sweet_crepe()  # "Nutella" (en_US/fr_FR), "nutella" (it_IT)
savory = fake.savory_crepe()  # "ham and cheese" (en_US), "complète" (fr_FR)

Other Products

sandwich = fake.sandwich()  # "BLT" (en_US), "jambon beurre" (fr_FR)
burger = fake.burger()  # "cheeseburger" (en_US), "hamburger" (fr_FR)
ice_cream = fake.ice_cream()  # "vanilla" (en_US), "vanille" (fr_FR)
sorbet = fake.sorbet()  # "lemon" (en_US), "citron" (fr_FR)
cheese = fake.cheese()  # "cheddar" (en_US), "camembert" (fr_FR)
cold_meat = fake.cold_meat()  # "ham" (en_US), "jambon cru" (fr_FR)
fish = fake.fish()  # "salmon" (en_US), "saumon" (fr_FR)
meat = fake.meat()  # "beef" (en_US), "boeuf" (fr_FR)
meat_cut = fake.meat_cut()  # "steak" (en_US), "entrecôte" (fr_FR)

💰 Quantities & Prices

# Random quantity
quantity = fake.quantity()  # 1, 2, 3, ..., 100

# Random price (default: 1.0 to 50.0)
price = fake.price()  # 12.99

# Price by category
pizza_price = fake.price(category="pizza")  # 8.0 to 25.0 (en_US), 6.0 to 20.0 (it_IT)
bread_price = fake.price(category="bread")  # 2.0 to 8.0 (en_US)
drink_price = fake.price(category="drink")  # 2.0 to 15.0 (en_US)

# Custom price range
custom_price = fake.price(min_price=10.0, max_price=20.0)  # 15.45

🛒 Orders

# Single order item
item = fake.order_item("pizza place")
# {'product': 'pepperoni', 'category': 'pizzas', 'quantity': 2, 'unit_price': 12.5, 'total': 25.0}

# Full order with multiple items
order = fake.order("bakery", min_items=3, max_items=5)
# {
#     'shop_type': 'bakery',
#     'shop_name': 'Wonder Bread',
#     'items': [
#         {'product': 'sourdough', 'category': 'breads', 'quantity': 2, 'unit_price': 3.5, 'total': 7.0},
#         {'product': 'croissant', 'category': 'pastries', 'quantity': 3, 'unit_price': 2.0, 'total': 6.0},
#         ...
#     ],
#     'subtotal': 20.5,
#     'tax_rate': 8.25,
#     'tax_amount': 1.69,
#     'total': 22.19
# }

🌎 Locale-Specific Examples

English (en_US)

from faker import Faker
from faker_food_shop import FoodShopProvider

fake = Faker('en_US')
fake.add_provider(FoodShopProvider)

print(fake.shop_name())  # "Pizza Hut"
print(fake.drink())       # "coffee"
print(fake.pizza())       # "pepperoni"

French (fr_FR)

fake_fr = Faker('fr_FR')
fake_fr.add_provider(FoodShopProvider)

print(fake_fr.shop_name())  # "Boulangerie Martin"
print(fake_fr.drink())       # "café"
print(fake_fr.pizza())       # "margherita"

Italian (it_IT)

fake_it = Faker('it_IT')
fake_it.add_provider(FoodShopProvider)

print(fake_it.shop_name())  # "Pizzeria da Michele"
print(fake_it.drink())       # "caffè"
print(fake_it.pizza())       # "margherita"

Spanish (es_ES)

fake_es = Faker('es_ES')
fake_es.add_provider(FoodShopProvider)

print(fake_es.shop_name())  # "Panadería La Ideal"
print(fake_es.drink())       # "café con leche"
print(fake_es.pizza())       # "margarita"

🎯 Demo

Run a full demo to see all features:

python -c "
from faker import Faker
from faker_food_shop import FoodShopProvider

for locale in ['en_US', 'fr_FR', 'it_IT', 'es_ES']:
    fake = Faker(locale)
    fake.add_provider(FoodShopProvider)
    print(f'\n=== {locale} ===')
    print(f'Shop: {fake.shop_name()}')
    print(f'Drink: {fake.drink()}')
    print(f'Pizza: {fake.pizza()}')
    print(f'Bread: {fake.bread()}')
"

🤝 Contributing

Contributions are welcome! Open a PR or issue to suggest improvements, add new locales, or fix bugs.


📜 License

MIT License. See LICENSE for 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_food_shop-0.5.3.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

faker_food_shop-0.5.3-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file faker_food_shop-0.5.3.tar.gz.

File metadata

  • Download URL: faker_food_shop-0.5.3.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for faker_food_shop-0.5.3.tar.gz
Algorithm Hash digest
SHA256 819ac04e02c6a082001dda5a574bc98756e5f6e930739b077c546e581e95acf7
MD5 c155c52843f959788f334fa011a5ee34
BLAKE2b-256 019680d554255f927c6e494d293c196ae5f7eefe6e18ff2ce5251cda4151c6c6

See more details on using hashes here.

File details

Details for the file faker_food_shop-0.5.3-py3-none-any.whl.

File metadata

File hashes

Hashes for faker_food_shop-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 851d71f1bbd5dab355fdeeef8a9f496980697580c9ca8690eb13a83595b2e2cf
MD5 55f9248a79022cbb5339dd617b50eb9b
BLAKE2b-256 f4dfebb369ca1460882ad48920fbdcf860e17ba61b0b721429a1659757906046

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

2 files

0.6.0

2 files

This release

0.5.3 This release

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page