Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/event-logger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,32 @@ jobs:
- name: Log pull request opened
if: github.event_name == 'pull_request' && github.event.action == 'opened'
run: |
if [ -z "$COMMIT_LOG_API" ]; then
echo "COMMIT_LOG_API is not set"; exit 1
fi
pipenv run gitcommitlogger -r $(echo $REPOSITORY_URL) -t pull_request_opened -d $(echo $PR_CREATED_AT) -un $(echo $GITHUB_LOGIN) -o commit_stats.csv -u $(echo $COMMIT_LOG_API) -v
- name: Log pull request closed and merged
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
if [ -z "$COMMIT_LOG_API" ]; then
echo "COMMIT_LOG_API is not set"; exit 1
fi
echo $COMMITS > commits.json
cat commits.json # debugging
pipenv run gitcommitlogger -r $(echo $REPOSITORY_URL) -t pull_request_merged -d $(echo $PR_CLOSED_AT) -un $(echo $GITHUB_LOGIN) -i commits.json -o commit_stats.csv -u $(echo $COMMIT_LOG_API) -v
- name: Log pull request closed without merge
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == false
run: |
if [ -z "$COMMIT_LOG_API" ]; then
echo "COMMIT_LOG_API is not set"; exit 1
fi
pipenv run gitcommitlogger -r $(echo $REPOSITORY_URL) -t pull_request_closed -d $(echo $PR_CLOSED_AT) -un $(echo $GITHUB_LOGIN) -o commit_stats.csv -u $(echo $COMMIT_LOG_API) -v
- name: Log push
if: github.event_name == 'push'
run: |
if [ -z "$COMMIT_LOG_API" ]; then
echo "COMMIT_LOG_API is not set"; exit 1
fi
echo $COMMITS > commits.json
cat commits.json # debugging
pipenv run gitcommitlogger -r $(echo $REPOSITORY_URL) -t $(echo $EVENT_TYPE) -i commits.json -o commit_stats.csv -u $(echo $COMMIT_LOG_API) -v
11 changes: 11 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.13"
20 changes: 20 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bloomsays/art.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#load beard ASCII
32 changes: 32 additions & 0 deletions bloomsays/bloomberg/black.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&%%%##(##&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%#%%%%%%%%%#######%@&@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@%%#%%&%%%###%%####(#%&&&%%%%&&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%&&&&&#((///((((////**////(#&&&&&&%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&&&&%#(////***************////(#@@&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&@&#(///***************,*****///(&@&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&&#(///********,,,,,,,,,,,****///(&&&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&%(////*****,*,*,,,,,,,,,,,,****//#&&@&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&&&&%(////*******,,,,,,,,,,********//(&&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@&&&%////**********,,,,,,,,,,******//(%&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@@&&%(///*******,,,,,,,,,,,,,,******//#&@&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&@@&%(///(#(####(/****,**//(%%%%##(///(&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&(//%###%##%%###(/***/(((%&&&&%###((&@&//@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@(((#&&(//(#%#(*##,/(/(/***///(**#*/(((///&%#((/@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(//&&(//***//*////////****/*****/******/#(**/*@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(/(%&(//***/*******//**,,*/*******,,**//##(*/@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@/(#(&(///*********///*,,,,*//*********//%%(*#@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@///&%(//********/////****///*******///(&%//&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@(/&&##((///**//((#&##%####(//***//(###&#/&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@(&&&&%#(/(%%###%%%##%##%%%((##(((##%&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&&&&%##%&%&&%###%##((###%%%%#%%%%%&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@&&&&&&%&%%#//(////////////%&&&#&&&&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@(%&@&&&&%#((((###%##((((((%&&&&@&%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@,#%/#&&&&&&&&%##%%#%%%##(#%&&%&&@&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@..(&//(&&&&&&&&&%%%%#%%(%%&&@&&@%(@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@....,///(%&&&&@&&&&%%%%%&&&&@@@&(/..@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.......////((#%&&&&&&@&&&@&@&&@%(//*,../@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@............//(((((((##&&@@@@@&&#/////#,,......(@@@@@@@@@@@@@@@@
@@@@@@@@@@@@%.......... ...*///////(((((((//////*//&(.......... *@@@@@@@@@@@@
@@@@@@@@@%. ..,..//**///////////****//%/*. ............ .&@@@@@@
30 changes: 30 additions & 0 deletions bloomsays/bloomberg/color.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@@@@@@@@@@@@@@@@@@@@@@@@@&%%%##(##&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%#%%%%%%%%%#######%@&@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@%%#%%&%%%%##%%####(#%&&&%%%%&&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%&&&&&#((///((((/////*////(#&&&&&&&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&&&&%#(/////**************////(#@@&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&@&#(///***************,*****///(&@&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&&#(////*******,,,,,,,,,,,****///(&&&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&%((////****,*,*,,,,,,,,,,,,***///#&&@&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&&&&%(/////******,,,,,,,,,,********//(&&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@&&&%//////********,,,,,,,,,,******//(%&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@@&&%((///******,,,,,,,,,,,,,,******//#&@&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&@@@%(///(#(####(/****,**//(%%%%##(///(&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&(//%######%%###(/***/(((#&&&&%###((&@&//@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@(((#&&(//(#%#(*##,/(/(/****//(**(**(((///&%#/(/@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(//&&(//**///*///*////*,**/*****/******/#(**/*@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(/(%&(//***/*******//**,,*********,,**//##(**@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@//#(&#(//*********///*,,,,*//*********//%#(*#@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@///&%(////******/////****///*******///(&%/*&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@//&&##((///**//((#&##%####(//***//(###&#/&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@(&&&&%#(/(%%%##%%%##%##%%%((###((##%&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&&&&&%#%&%&&%%#####((#(#%%%%%%%%%%&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&%%#//(///*////////%&&&#&&&&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@(%&@&&&&%#((((######((((((%&&&&@&%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@,#%/#&&&&&&&&%##%%#%%%##(#%&&%&&@&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@..(&//(&&&&&&&&&%%%%#%%(%%&&@&&@%(@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@....,///(%&&&&@&&&&%%%%%&&&&&@@&(/..@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.......////((#%@&&&&&@&&&@&@&&@%(//,.../@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@............//(((((((##&&@@@@@&&#/////#,, .. ..(@@@@@@@@@@@@@@@@
@@@@@@@@@@@@%..... .... .*///////(((((((//////*//&(.......... *@@@@@@@@@@@@
@@@@@@@@@%. .,..//*////////////****//%/*. ........... .&@@@@@@
1 change: 1 addition & 0 deletions bloomsays/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#command line implementations
Empty file added bloomsays/main.py
Empty file.
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "bloomsays"
description = "A package that gives quotes from the professor"
version = "0.1.0"
license = { file = "LICENSE" }
readme = "README.md"
keywords = ["python", "package", "build", "lighthearted"]
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"Intended Audience :: Education",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
]

[project.optional-dependencies]
dev = ["pytest"]

[project.urls]
"Repository" = "https://github.com/swe-students-fall2025/3-python-package-team_orchid.git"


[project.scripts]
bloomsays = "bloomsayspackage.__main__:main"
8 changes: 8 additions & 0 deletions src/bloomsayspackage/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from .bubble import wrap_text, make_bubble

from . import wisdom
__all__ = [
"wrap_text",
"make_bubble",
"wisdom",
]
30 changes: 30 additions & 0 deletions src/bloomsayspackage/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import sys
import wisdom

def main():
args = sys.argv[1:]
if not args:
print("Usage: bloomsays randomQuote [n] | bloomsays avg num1 num2 ...")
return

command = args[0]

if command == "randomQuote":
n = int(args[1]) if len(args) > 1 else 1
randomQuote(n)
elif command == "avg":
if len(args) < 2:
print("Usage: bloomsays avg num1 num2 ...")
return
try:
numbers = [float(x) for x in args[1:]]
except ValueError:
print("All arguments for avg must be numbers.")
return
print(f"Your average grade is {avg(*numbers):.2f}")
else:
print(f"Unknown command: {command}")
print("Usage: bloomsays randomQuote [n] | bloomsays avg num1 num2 ...")

if __name__ == "__main__":
main()
66 changes: 66 additions & 0 deletions src/bloomsayspackage/bubble.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
from __future__ import annotations
from typing import List


def wrap_text(text: str, width: int) -> List[str]:
"""
Pure text wrapper (no printing).
- Splits on whitespace.
- If a single word is longer than width, it is put on its own line (no hyphenation).
"""
if width is None or width < 1:
raise ValueError("width must be >= 1")

words = text.split()
if not words:
return [""]

lines: List[str] = []
cur = words[0]
for w in words[1:]:
if len(cur) + 1 + len(w) <= width:
cur += " " + w
else:
lines.append(cur)
cur = w
lines.append(cur)
return lines


def make_bubble(text: str, width: int | None = None) -> str:
"""
Build a speech bubble as a single string.
- If width is provided, wrap the text to that width.
- Supports multi-line input already containing '\n' (each line is treated as a paragraph).
"""
if text is None:
raise ValueError("text must be a string")

# split paragraphs first
paragraphs = text.split("\n")
if width is not None:
if width < 1:
raise ValueError("width must be >= 1")
lines = []
for p in paragraphs:
if p.strip() == "":
lines.append("") # preserve empty line
else:
lines.extend(wrap_text(p, width))
else:
lines = paragraphs

# compute max visible width
maxw = max((len(line) for line in lines), default=0)

top = " " + "_" * (maxw + 2)
body = "\n".join(f"| {line.ljust(maxw)} |" for line in lines)
bottom = " " + "=" * (maxw + 2)
tail = " \\\n \\"

return f"{top}\n {body}\n{bottom}\n{tail}"

#test - run: python3 -m bloomsays.bubble
if __name__ == "__main__":
print(make_bubble("Ask Bloombot!"))

67 changes: 67 additions & 0 deletions src/bloomsayspackage/wisdom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import random;
import textwrap


ascii_art = r"""
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&%%%##(##&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%#%%%%%%%%%#######%@&@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@%%#%%&%%%###%%####(#%&&&%%%%&&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%&&&&&#((///((((////**////(#&&&&&&%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&&&&%#(////***************////(#@@&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&@&#(///***************,*****///(&@&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&&#(///********,,,,,,,,,,,****///(&&&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&%(////*****,*,*,,,,,,,,,,,,****//#&&@&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&&&&%(////*******,,,,,,,,,,********//(&&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@&&&%////**********,,,,,,,,,,******//(%&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@@&&%(///*******,,,,,,,,,,,,,,******//#&@&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&@@&%(///(#(####(/****,**//(%%%%##(///(&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&(//%###%##%%###(/***/(((%&&&&%###((&@&//@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@(((#&&(//(#%#(*##,/(/(/***///(**#*/(((///&%#((/@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(//&&(//***//*////////****/*****/******/#(**/*@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(/(%&(//***/*******//**,,*/*******,,**//##(*/@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@/(#(&(///*********///*,,,,*//*********//%%(*#@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@///&%(//********/////****///*******///(&%//&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@(/&&##((///**//((#&##%####(//***//(###&#/&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@(&&&&%#(/(%%###%%%##%##%%%((##(((##%&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&&&&%##%&%&&%###%##((###%%%%#%%%%%&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@&&&&&&%&%%#//(////////////%&&&#&&&&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@(%&@&&&&%#((((###%##((((((%&&&&@&%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@,#%/#&&&&&&&&%##%%#%%%##(#%&&%&&@&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@..(&//(&&&&&&&&&%%%%#%%(%%&&@&&@%(@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@....,///(%&&&&@&&&&%%%%%&&&&@@@&(/..@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.......////((#%&&&&&&@&&&@&@&&@%(//*,../@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@............//(((((((##&&@@@@@&&#/////#,,......(@@@@@@@@@@@@@@@@
@@@@@@@@@@@@%.......... ...*///////(((((((//////*//&(.......... *@@@@@@@@@@@@
@@@@@@@@@%. ..,..//**///////////****//%/*. ............ .&@@@@@@
"""


def avg(*grades):

average = sum(grades)/ len(grades)
message = f"Your average grade is {average:.2f}"

border = "-" * (len(message) + 2)
bubble = f" {border}\n< {message} >\n {border}"


print(f"{bubble}\n{ascii_art}")



def randomQuote(n=1):
profLines = ["everything is due at class time", "ask Bloombot", "Quizzes: 25%", "Exercises & Projects: 75%", "Discord is our main source of communitcation"]
selected_quotes = [random.choice(profLines) for _ in range(n)]

max_length = max(len(quote) for quote in selected_quotes)

border = "-" * (max_length + 2)
bubble_lines = [f" {border}"]
for quote in selected_quotes:
bubble_lines.append(f"< {quote.ljust(max_length)} >")
bubble_lines.append(f" {border}")

print("\n".join(bubble_lines))
print(ascii_art)
Empty file added tests/__init__.py
Empty file.
Loading
Loading