Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
740a07c
added sample hello world
kazisean Nov 3, 2025
271029c
Merge pull request #1 from swe-students-fall2025/core-functions
TawhidZGit Nov 3, 2025
61aefd3
added bloomberg as ascii
kazisean Nov 3, 2025
38e54b9
improved quality ascii
kazisean Nov 3, 2025
54ad013
Merge pull request #2 from swe-students-fall2025/feature/ascii
hna2019 Nov 3, 2025
9dbf01c
added necessary files
lunasuzuki Nov 4, 2025
f310b8d
Merge pull request #3 from swe-students-fall2025/files
hna2019 Nov 4, 2025
edc7be5
Started us off with a pipfile and code that shows ASCII art and message
hna2019 Nov 4, 2025
4dcab1f
Merge pull request #4 from swe-students-fall2025/start
lunasuzuki Nov 4, 2025
aef1b8a
added bubble.py
lunasuzuki Nov 4, 2025
4b9256b
Merge pull request #6 from swe-students-fall2025/bubble-file
lunasuzuki Nov 5, 2025
19be87b
added new avg function and gave random function a parameter
hna2019 Nov 5, 2025
098d64c
Merge pull request #7 from swe-students-fall2025/feature/function1
lunasuzuki Nov 5, 2025
0f202ae
Added coding_wisdom function and tests
Nov 6, 2025
ede2b9d
added helper function wrap_text
a247686991 Nov 6, 2025
11776eb
added tests for bubble
a247686991 Nov 6, 2025
27783e8
added compute_avg and random_quote
a247686991 Nov 6, 2025
1a0c9bd
fixed test_wisdom.py
a247686991 Nov 6, 2025
6d8438e
added init.py
a247686991 Nov 6, 2025
fa75526
added test for wrap_texgt
a247686991 Nov 6, 2025
f96f883
fixed yml
a247686991 Nov 6, 2025
d47271e
fixed yml
a247686991 Nov 6, 2025
a74bca5
Merge pull request #8 from swe-students-fall2025/feature/coding_wisdo…
kazisean Nov 6, 2025
803c6cc
Merge branch 'pipfile-experiment' into bubble
kazisean Nov 6, 2025
322ae47
Merge pull request #10 from a247686991/bubble
kazisean Nov 6, 2025
fbf9b39
QOL updates, small refactors and update to test cases
kazisean Nov 6, 2025
5ba9b02
Merge pull request #11 from swe-students-fall2025/bugfixes
lunasuzuki Nov 7, 2025
75cb747
small updates to readme
lunasuzuki Nov 7, 2025
bf9236f
Merge pull request #12 from swe-students-fall2025/readme
lunasuzuki Nov 7, 2025
2b2b36f
added more to readme
lunasuzuki Nov 7, 2025
315d5b9
Merge pull request #13 from swe-students-fall2025/readme2
kazisean Nov 7, 2025
ad1d5e2
Added example output to README.md
lunasuzuki Nov 7, 2025
8b74134
Merge pull request #14 from swe-students-fall2025/exampleoutput
lunasuzuki Nov 8, 2025
7c801ce
added funny jokes + test cases + small bug fixes
kazisean Nov 8, 2025
92b663a
Merge pull request #15 from swe-students-fall2025/feature/jokes
TawhidZGit Nov 8, 2025
75e2021
Added study_tip() function
Nov 8, 2025
d97ba4d
Completed test cases for studytip() func
Nov 8, 2025
907259d
Added study_tip func
Nov 8, 2025
787e8bb
Updated the main to incorporate missing functions
Nov 8, 2025
f2e9455
Merge pull request #16 from swe-students-fall2025/feature/study_tip
kazisean Nov 8, 2025
db484e9
Merge pull request #17 from swe-students-fall2025/feature/updated_main
kazisean Nov 8, 2025
39be926
Changed some meta data files
hna2019 Nov 8, 2025
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; skipping logging step."; exit 0
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; skipping logging step."; exit 0
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; skipping logging step."; exit 0
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; skipping logging step."; exit 0
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
17 changes: 17 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
bloomsays = {file = ".", editable = true}

[dev-packages]
build = "*"
pytest = "*"
coverage = "*"
pytest-cov = "*"
twine = "*"

[requires]
python_version = "3"
66 changes: 66 additions & 0 deletions Pipfile.lock

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

79 changes: 77 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
# Python Package Exercise
# Bloomsays

## What is Bloomsays?
Bloomsays is a fun python package with some of our favorite lines from Professor Bloomberg.

## Instructions
pip install -e .

run python: python

## Usage
Ater installation, you can import and call the functions from the package
```python
from bloomsays.wisdom import avg, random_quote, coding_wisdom

#Get your average grade
avg(90, 80, 100)

#Get a random quote from Professor Bloomberg!
random_quote()

#Get some coding wisdom with your specified language
coding_wisdom("Python")

```

## Functions

## Example Output
______________
| ask Bloombot |
==============
\
\

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&%%%##(##&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%#%%%%%%%%%#######%@&@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@%%#%%&%%%###%%####(#%&&&%%%%&&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%&&&&&#((///((((////**////(#&&&&&&%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&&&&%#(////***************////(#@@&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@&&&@&#(///***************,*****///(&@&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&&#(///********,,,,,,,,,,,****///(&&&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&%(////*****,*,*,,,,,,,,,,,,****//#&&@&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&&&&%(////*******,,,,,,,,,,********//(&&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@&&&%////**********,,,,,,,,,,******//(%&&&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&@@&&%(///*******,,,,,,,,,,,,,,******//#&@&&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@&&@@&%(///(#(####(/****,**//(%%%%##(///(&&&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@&&&&(//%###%##%%###(/***/(((%&&&&%###((&@&//@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@(((#&&(//(#%#(*##,/(/(/***///(**#*/(((///&%#((/@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(//&&(//***//*////////****/*****/******/#(**/*@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@/(/(%&(//***/*******//**,,*/*******,,**//##(*/@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@/(#(&(///*********///*,,,,*//*********//%%(*#@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@///&%(//********/////****///*******///(&%//&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@(/&&##((///**//((#&##%####(//***//(###&#/&@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@(&&&&%#(/(%%###%%%##%##%%%((##(((##%&&&@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&&&&%##%&%&&%###%##((###%%%%#%%%%%&&&@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@&&&&&&%&%%#//(////////////%&&&#&&&&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@(%&@&&&&%#((((###%##((((((%&&&&@&%@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@,#%/#&&&&&&&&%##%%#%%%##(#%&&%&&@&@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@..(&//(&&&&&&&&&%%%%#%%(%%&&@&&@%(@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@....,///(%&&&&@&&&&%%%%%&&&&@@@&(/..@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.......////((#%&&&&&&@&&&@&@&&@%(//*,../@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@............//(((((((##&&@@@@@&&#/////#,,......(@@@@@@@@@@@@@@@@
@@@@@@@@@@@@%.......... ...*///////(((((((//////*//&(.......... *@@@@@@@@@@@@
@@@@@@@@@%. ..,..//**///////////****//%/*. ............ .&@@@@@@

['ask Bloombot']

## Contributors
- Luna Suzuki - [github](https://github.com/lunasuzuki)
- Kazi Hossain - [github](https://github.com/kazisean)
- Tawhid Zaman [github](https://github.com/TawhidZGit)
- Jack Chen - [github]()
- Howard Appel - [github](https://github.com/hna2019)


An exercise to create a Python package, build it, test it, distribute it, and use it. See [instructions](./instructions.md) for details.
17 changes: 17 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[] At least four functions that accept arguments which influence their behavior
[] The package must be distributed in the PyPI repository and installable via pip.
[] Use pipenv to manage the package dependencies and virtual environments with a Pipfile.
[] Use pytest to test this should be no fewer than three tests per package function.
[] Use build to create the package artifacts.
[] Use twine to upload the package to PyPI.
[] Use GitHub Actions to build your package and run your tests on two different recent versions of Python with every pull request to the main branch of your GitHub repository.
[] delete the feature branch
[] beautiful read-me file on
[] description
[] clear instructions
[] code examples
[] include doc for all the functions and how to use + import
[] how to contribute + build + test + run
[] Include a badge at the top of the README.md file showing the result of the latest build/test workflow run.
[] Include the names of all teammates as links to their GitHub profiles in the README.md file.
[] Include a link to your package's page on the PyPI website.
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[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"
authors = [
{ name="Howard Appel", email="hna2019@nyu.edu" },
{ name="Kazi Hossain", email="keh8423@nyu.edu" },
{ name="Luna Suzuki", email="las9963@nyu.edu" },
{ name="Tawhid Zaman", email="tnz8738@nyu.edu" },
{ name="Jack Chen", email="jc11462@nyu.edu"}
]
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]
Homepage = "https://github.com/swe-students-fall2025/3-python-package-team_orchid"
Repository = "https://github.com/swe-students-fall2025/3-python-package-team_orchid.git"


[project.scripts]
bloomsays = "bloomsays.__main__:main"
8 changes: 8 additions & 0 deletions src/bloomsays/__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",
]
47 changes: 47 additions & 0 deletions src/bloomsays/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import sys
from bloomsays import wisdom

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

command = args[0]

if command == "randomQuote":
n = int(args[1]) if len(args) > 1 else 1
wisdom.random_quote(n)
elif command == 'joke':
n = int(args[1]) if len(args) > 1 else 1
wisdom.jokes(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
wisdom.avg(*numbers)
elif command == "codingWisdom":
language = args[1] if len(args) > 1 else "Python"
wisdom.coding_wisdom(language)
elif command == "studyTip":
if len(args) < 3:
print("Usage: bloomsays studyTip numQuestions difficulty")
return
try:
num_questions = int(args[1])
difficulty = args[2]
except ValueError:
print("numQuestions must be an integer.")
return
wisdom.study_tip(num_questions, difficulty)
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/bloomsays/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!"))

Loading