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.6.0.tar.gz (29.7 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.6.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: faker_food_shop-0.6.0.tar.gz
  • Upload date:
  • Size: 29.7 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.6.0.tar.gz
Algorithm Hash digest
SHA256 1b0a038ee9567ba7000bd093b3fd37d7ad138975b14cde8aa631373cfa330a9a
MD5 8ebd5c7e3111d5bca3656d64a6d71332
BLAKE2b-256 a7a0359acd05f79a2afbf6ab65de7e499838f07cac1324c52f3f12b4a40e427a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for faker_food_shop-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73711941a26cb88c7ab7fe0bbd15aead00ca03a0b28e82b3435a990e74aec590
MD5 635235f63fb2f7b523c56d9b1caae4ec
BLAKE2b-256 74adbac69acd033a645a17e741249f2a86e4d32ab91d2bfca33398001ea33b34

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

2 files

This release

0.6.0 This release

2 files

0.5.3

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