grocery_store.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright 2021-2025 Avaiga Private Limited
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  4. # the License. You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  9. # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  10. # specific language governing permissions and limitations under the License.
  11. # -----------------------------------------------------------------------------------------
  12. # Entry point for the example on Page Modules.
  13. # -----------------------------------------------------------------------------------------
  14. # To execute this script, make sure that the taipy-gui package is installed in your
  15. # Python environment and run:
  16. # python <script>
  17. # -----------------------------------------------------------------------------------------
  18. from grocery_store.sales import SalesPage
  19. from grocery_store.stock import page as StockPage
  20. from taipy.gui import Gui
  21. # Define sample data for grocery store sales and stock
  22. data = {
  23. "Items": ["Apples", "Bananas", "Oranges", "Grapes", "Strawberries"],
  24. "Purchase": [1.36, 0.73, 1.09, 2.27, 2.73],
  25. "Price $": [1.50, 0.80, 1.20, 2.50, 3.00],
  26. "Price €": [1.38, 0.74, 1.10, 2.30, 2.76],
  27. "Sales Q1": [120, 200, 90, 50, 75],
  28. "Sales Q2": [140, 180, 110, 60, 85],
  29. "Sales Q3": [100, 190, 95, 55, 80],
  30. "Stock": [500, 600, 400, 300, 250],
  31. }
  32. # Initialize and run the GUI application with Sales and Stock pages
  33. if __name__ == "__main__":
  34. Gui(pages={"sales": SalesPage(), "stock": StockPage}).run(title="Grocery Store")