Skip to main content

Faker Food Shop Provider

Un provider personnalisé pour Faker qui permet de générer des données fictives pour simuler des points de vente alimentaires.

Types de points de vente supportés

  • Pizzeria - Pizzas de différents types et tailles
  • Boulangerie - Pains, viennoiseries, pâtisseries
  • Kebab - Viandes, sauces, accompagnements
  • Crêperie - Crêpes sucrées et salées
  • Sandwicherie - Sandwichs de différents types
  • Burger - Burgers, accompagnements, sauces
  • Restaurant - Entrées, plats principaux, desserts
  • Café - Boissons chaudes et froides, snacks
  • Bar - Boissons alcoolisées, snacks
  • Traiteur - Plats préparés, menus
  • Glacier - Glaces, sorbets
  • Chocolaterie - Chocolats de différents types
  • Fromagerie - Fromages de différentes origines
  • Charcuterie - Viandes froides, charcuteries
  • Poissonnerie - Poissons, fruits de mer
  • Boucherie - Viandes, découpes

Installation

pip install faker-food-shop

Ou installez depuis le dépôt :

cd /chemin/vers/le/depot
git clone <url-du-depot>
cd faker-food-shop
pip install -e .

Utilisation

Import et configuration

from faker import Faker
from faker_food_shop import FoodShopProvider

fake = Faker()
fake.add_provider(FoodShopProvider)

Exemples de base

Types de magasins

# Type de magasin aléatoire
shop_type = fake.shop_type()  # "pizzeria", "boulangerie", etc.

# Nom de magasin
shop_name = fake.shop_name()  # "Pizza Delight", "Boulangerie Martin", etc.

# Nom de magasin pour un type spécifique
pizzeria_name = fake.shop_name("pizzeria")  # "Pizzeria Bella Napoli"

Boissons

# Boisson aléatoire
-drink = fake.drink()  # "vin rouge", "coca cola", etc.

# Boisson par catégorie
alcoholic_drink = fake.drink("alcoholic")  # "whisky", "bière blonde", etc.
non_alcoholic = fake.drink("non_alcoholic")  # "jus d'orange", "eau plate", etc.
hot_drink = fake.drink("hot")  # "café", "thé vert", etc.

# Catégorie de boisson
-drink_category = fake.drink_category()  # "alcoholic", "non_alcoholic", "hot"

Produits

# Produit aléatoire pour un type de magasin
product = fake.product("pizzeria")  # "margherita", "quatre fromages", etc.

# Produit avec catégorie spécifique
pizza = fake.product("pizzeria", "pizzas")  # "diavola"
bread = fake.product("boulangerie", "breads")  # "baguette tradition"

# Catégorie de produit pour un type de magasin
category = fake.product_category("boulangerie")  # "breads", "pastries", "viennoiseries"

Produits spécifiques

# Pizzas
pizza = fake.pizza()  # "quatre saisons"
pizza_size = fake.pizza_size()  # "grande"
pizza_dough = fake.pizza_dough()  # "fine"

# Boulangerie
bread = fake.bread()  # "pain de campagne"
pastry = fake.pastry()  # "éclair"
viennoiserie = fake.viennoiserie()  # "croissant"

# Kebab
kebab_meat = fake.kebab_meat()  # "viande d'agneau"
kebab_sauce = fake.kebab_sauce()  # "blanche"

# Crêperie
sweet_crepe = fake.sweet_crepe()  # "Nutella"
savory_crepe = fake.savory_crepe()  # "complète"

# Autres
sandwich = fake.sandwich()  # "jambon beurre"
burger = fake.burger()  # "cheeseburger"
ice_cream = fake.ice_cream()  # "vanille"
sorbet = fake.sorbet()  # "citron"
cheese = fake.cheese()  # "camembert"
cold_meat = fake.cold_meat()  # "jambon cru"
fish = fake.fish()  # "saumon"
meat = fake.meat()  # "bœuf"
meat_cut = fake.meat_cut()  # "entrecôte"

Quantités et prix

# Quantité aléatoire
quantity = fake.quantity()  # 1, 2, 3, ..., 100

# Prix aléatoire
price = fake.price()  # 1.0 à 50.0 €

# Prix par catégorie
pizza_price = fake.price(category="pizza")  # 8.0 à 25.0 €
bread_price = fake.price(category="bread")  # 0.8 à 5.0 €
drink_price = fake.price(category="drink")  # 1.5 à 15.0 €

# Prix avec plage personnalisée
custom_price = fake.price(min_price=10.0, max_price=20.0)

Commandes

# Article de commande
item = fake.order_item("pizzeria")
# {'product': 'margherita', 'category': 'pizzas', 'quantity': 2, 'unit_price': 12.5, 'total': 25.0}

# Commande complète
order = fake.order("boulangerie", min_items=3, max_items=5)
# {
#     'shop_type': 'boulangerie',
#     'shop_name': 'Boulangerie Martin',
#     'items': [
#         {'product': 'baguette tradition', 'category': 'breads', 'quantity': 2, 'unit_price': 1.2, 'total': 2.4},
#         {'product': 'croissant', 'category': 'viennoiseries', 'quantity': 3, 'unit_price': 1.5, 'total': 4.5},
#         ...
#     ],
#     'subtotal': 15.6,
#     'tax_rate': 10.0,
#     'tax_amount': 1.56,
#     'total': 17.16
# }

Exécution de la démo

Pour voir une démonstration complète :

python -m faker_food_shop

Contribution

Les contributions sont les bienvenues ! Ouvrez une PR ou un issue pour proposer des améliorations.

Licence

MIT License

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.2.0.tar.gz (14.9 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.2.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: faker_food_shop-0.2.0.tar.gz
  • Upload date:
  • Size: 14.9 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.2.0.tar.gz
Algorithm Hash digest
SHA256 b11e00c9758a13f7a492ba480984488bf7f8487f88b656a1bad42110cfe5ce5d
MD5 2eb4ccb63429b4743b080f3d1763cab4
BLAKE2b-256 4eb5cc69207eafd5ca434f11ca364e8a28c7e8f88c090a92904963d0a43359de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for faker_food_shop-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f330b251d30e12b57f203b5327bd91d07c7328fb11cbe93634c6309809a6653b
MD5 bef14a0167a290fcaab3c4c3ee5f4bb3
BLAKE2b-256 00edc415f323312b7552cbf702f7ca2e8829ef543475991c67d83670ed90b41c

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

2 files

0.6.0

2 files

0.5.3

2 files

This release

0.2.0 This release

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