Skip to main content

A simple program that predicts the number of cookies necessary to bake.

Project description

Bake Forecast CI/CD

Overview

This repository contains a Python project that predicts the number of cookies to bake based on historical sales data. It also implements DevOps best practices including CI/CD, linting, type checking, security checks, testing, and package publishing.

Features

  • Predicts daily cookie bake quantities from CSV data.
  • Built-in logging to track processing steps and potential issues.
  • Fully typed Python code.
  • Includes automated testing and validation.
  • Implements CI/CD pipelines with GitHub Actions.
  • Linting with ruff and formatting with black.
  • Build automation for Python packages.
  • Optional publishing to TestPyPI or PyPI on release.

CI/CD

  • The project includes GitHub Actions workflows to:
  • Run tests on every push and pull request.
  • Check code formatting, types, and security.
  • Build Python distributions automatically.
  • Optionally publish packages on release.

Usage Example

Install the package from PyPI and try it with prepared .csv file in this repo:

pip install bake-forecast-cicd
get_average_bakes sold_items_1.csv

## Example Output (Verbose Mode)

[2025-11-30 15:17:29] DEBUG bake_forecast.cli: Verbose logging enabled. [2025-11-30 15:17:29] DEBUG bake_forecast.cli: Received verbose flag: True [2025-11-30 15:17:29] DEBUG bake_forecast.cli: Received file path: sold_items_1.csv [2025-11-30 15:17:29] INFO bake_forecast.cli: Starting processing file 'sold_items_1.csv' [2025-11-30 15:17:29] INFO bake_forecast: Processed 21 rows.

--RESULT-- [2025-11-30 15:17:29] DEBUG bake_forecast.cli: Process finished with success. [2025-11-30 15:17:29] INFO bake_forecast.cli: Recommended number of cookies to bake today is: 67.3


## Example Output (Verbose Mode)

$ get_average_bakes nonexistent.csv -v [2025-11-30 15:20:01] DEBUG bake_forecast.cli: Verbose logging enabled. [2025-11-30 15:20:01] WARNING bake_forecast.cli: File not found error. Double check file path.


## About the Calculation

The application calculates the average number of cookies sold based on the content of the provided CSV file and uses this value as the recommended amount to bake.

## Notes

* Use the `-v` flag to enable verbose logging.

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

bake_forecast_cicd-1.2.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

bake_forecast_cicd-1.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bake_forecast_cicd-1.2.0.tar.gz
Algorithm Hash digest
SHA256 07eb3fa617f5d0562b66eed587243474928965a7df39ddd38fcd5516e589bf38
MD5 ae3f4d61f8d7b312d9af4bd7ea2ca3ae
BLAKE2b-256 94295cfa80de74d6e28e57cf918ccf893e8bc71c8478c3f2c4b5aafbd43615b8

See more details on using hashes here.

Provenance

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

Publisher: publish.yaml on ca5ual/bake-forecast-cicd

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

File details

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

File metadata

File hashes

Hashes for bake_forecast_cicd-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f09c77f4704154d4c253aaab409c57d3b6bd77750715b1fa3a7914f95cdb769f
MD5 f7257127e9139c9128cac16a790a08fc
BLAKE2b-256 f47348187b45ce04b099a227025d91f09006a45ddac28e8218b7ed43438ebe2c

See more details on using hashes here.

Provenance

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

Publisher: publish.yaml on ca5ual/bake-forecast-cicd

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