Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d41e3f5
Create __init__.py
kylin1209 Oct 26, 2025
093cb0c
Created "study tips" functionality
kylin1209 Oct 26, 2025
0d6c410
Merge pull request #1 from swe-students-fall2025/kylie-dev
plant445 Oct 27, 2025
fe02865
Created core 4 functions
kylin1209 Oct 27, 2025
4b79315
Used PyPI to publish base things
kylin1209 Oct 28, 2025
6bca047
Merge pull request #2 from swe-students-fall2025/kylie-dev
plant445 Oct 28, 2025
35a1c8e
feat(cli): add studybuddy CLI tried adding sarcastic
chzzznn Oct 29, 2025
d12fa9a
Merge pull request #3 from swe-students-fall2025/feat/cli-and-extras
chzzznn Oct 30, 2025
5cadca6
Edited and republished to PyPI with functionalities
kylin1209 Oct 30, 2025
80fdc24
Merge pull request #4 from swe-students-fall2025/kylie-dev
plant445 Nov 1, 2025
1fbaf16
added affirm/challenge and fixed cli
sean9129 Nov 1, 2025
55829dd
Merge pull request #5 from swe-students-fall2025/sean-dev
kylin1209 Nov 2, 2025
c1bf744
feat(core): add allocate_time and tests
GavinGuoSZ Nov 2, 2025
4bde659
Merge pull request #6 from swe-students-fall2025/feat/allocate-time
kylin1209 Nov 3, 2025
a84fc10
Reuploaded to PyPI
kylin1209 Nov 3, 2025
df6c0b5
Merge pull request #7 from swe-students-fall2025/kylie-dev
chzzznn Nov 3, 2025
de03318
docs: improve README with clearer usage and contribution sections
chzzznn Nov 3, 2025
e2dc20e
Merge pull request #8 from swe-students-fall2025/docs/update-readme
chzzznn Nov 3, 2025
daf13b8
docs: improve README more complete
chzzznn Nov 3, 2025
e6417eb
docs: improve README more complete
chzzznn Nov 3, 2025
6fe8d13
Merge pull request #9 from swe-students-fall2025/docs/update-readme
chzzznn Nov 3, 2025
56d6056
docs: improve README more complete
chzzznn Nov 3, 2025
80e8ebd
Merge pull request #10 from swe-students-fall2025/docs/update-readme
chzzznn Nov 3, 2025
95ce6f4
docs: improve README more complete
chzzznn Nov 3, 2025
9b6226d
Merge pull request #11 from swe-students-fall2025/docs/update-readme
chzzznn Nov 3, 2025
78418d3
docs: improve README more complete
chzzznn Nov 3, 2025
83eaee9
Merge pull request #12 from swe-students-fall2025/docs/update-readme
chzzznn Nov 3, 2025
b29d237
docs: improve README more complete
chzzznn Nov 3, 2025
c42f0c0
Merge pull request #13 from swe-students-fall2025/docs/update-readme
chzzznn Nov 3, 2025
4427667
feat(cli): clearer --help with examples; add allocate command; show h…
GavinGuoSZ Nov 3, 2025
f4dbe5d
Finished the tests
kylin1209 Nov 3, 2025
64f6d7f
Merge pull request #14 from swe-students-fall2025/kylie-dev
plant445 Nov 3, 2025
4fc39d6
added workflow badge and fixed example.py
sean9129 Nov 4, 2025
db3cd55
Merge pull request #15 from swe-students-fall2025/fix-example
kylin1209 Nov 4, 2025
bf1df8d
Add roast feature to core module
Jeanmarck12 Nov 4, 2025
cb73e18
Add new roast to _ROASTS list
Jeanmarck12 Nov 4, 2025
ad9dc3b
Add compliment feature to core module
Jeanmarck12 Nov 4, 2025
e64ef9c
Fix list formatting and add new compliments
Jeanmarck12 Nov 4, 2025
c95b6e4
Add pomodoro_plan function for session planning
Jeanmarck12 Nov 4, 2025
c9b0543
Add break tips feature to core module
Jeanmarck12 Nov 4, 2025
bedba14
Add weighted 'mixed' style to motivate function
Jeanmarck12 Nov 4, 2025
a632326
Add typing imports to core.py
Jeanmarck12 Nov 4, 2025
112d294
Add _VALID_CAFFEINE set to core module
Jeanmarck12 Nov 4, 2025
75e2361
Refactor and expand StudyBuddy core API
Jeanmarck12 Nov 4, 2025
b94b46a
Add playlist suggestion feature with vibes
Jeanmarck12 Nov 4, 2025
5fd1006
Add 'hype' playlist category to _PLAYLISTS
Jeanmarck12 Nov 4, 2025
659b63f
Add classical playlists to _PLAYLISTS dictionary
Jeanmarck12 Nov 4, 2025
608a6ca
Add ambient playlist to _PLAYLISTS
Jeanmarck12 Nov 4, 2025
8c2d1b5
Update imports in cli.py for new features
Jeanmarck12 Nov 4, 2025
d228893
Refactor CLI argument parsing and add new commands
Jeanmarck12 Nov 4, 2025
4f5bff6
Refactor CLI command handling and add new commands
Jeanmarck12 Nov 4, 2025
14ddc4a
Expand core imports in __init__.py
Jeanmarck12 Nov 4, 2025
1ec928c
Expand __all__ exports in __init__.py
Jeanmarck12 Nov 4, 2025
315de06
reuploaded to PyPI and inserted link
kylin1209 Nov 4, 2025
69e3222
Merge pull request #16 from swe-students-fall2025/feat/cli-help
kylin1209 Nov 4, 2025
71ff15e
Merge branch 'pipfile-experiment' into kylie-dev
kylin1209 Nov 4, 2025
834ed97
reuploaded to PyPI for changed cli.py
kylin1209 Nov 4, 2025
20a8259
Update python-package.yml
kylin1209 Nov 4, 2025
6c37cd9
Changed for better testing
kylin1209 Nov 4, 2025
1a32098
Fixed syntax error
kylin1209 Nov 4, 2025
0757bfc
Update Pipfile
kylin1209 Nov 4, 2025
d882c7c
Update python-package.yml
kylin1209 Nov 4, 2025
46b79c4
Fixed testing errors
kylin1209 Nov 4, 2025
17186a4
fixed tests
kylin1209 Nov 4, 2025
f09403f
Update test_deadline_reminder.py
kylin1209 Nov 4, 2025
0da16a3
helped with exception group error
kylin1209 Nov 4, 2025
ce3de6e
trying to fix the pipfile errors
kylin1209 Nov 4, 2025
091309a
trying to fix testing problems
kylin1209 Nov 4, 2025
e16ee23
Update python-package.yml
kylin1209 Nov 4, 2025
483d6a1
Update README.md
kylin1209 Nov 4, 2025
29a0fd4
Merge pull request #18 from swe-students-fall2025/kylie-dev
kylin1209 Nov 5, 2025
7de6782
Update README.md
kylin1209 Nov 5, 2025
a4869fe
Merge pull request #19 from swe-students-fall2025/kylie-dev
kylin1209 Nov 5, 2025
8d8385d
Merge branch 'pipfile-experiment' into Jeanmarck
Jeanmarck12 Nov 5, 2025
59d23b4
Revamp CLI commands and add new features
Jeanmarck12 Nov 5, 2025
31f4fb1
Update README.md
kylin1209 Nov 5, 2025
190e0d3
Merge pull request #20 from swe-students-fall2025/kylie-dev
kylin1209 Nov 5, 2025
8e36000
Update test_affirmation_challenge.py
kylin1209 Nov 5, 2025
2e1c282
Merge pull request #21 from swe-students-fall2025/kylie-dev
kylin1209 Nov 5, 2025
e28cb72
Merge branch 'pipfile-experiment' into Jeanmarck
Jeanmarck12 Nov 17, 2025
9b35472
Add affirmation and challenge utility functions
Jeanmarck12 Nov 17, 2025
0c67889
Add playlist and utility functions to core module
Jeanmarck12 Nov 17, 2025
4716168
Refactor and export affirmation and challenge helpers
Jeanmarck12 Nov 17, 2025
121814e
Add new study utilities and update roast function
Jeanmarck12 Nov 17, 2025
f8c5fd3
Refine study utilities and improve output formatting
Jeanmarck12 Nov 17, 2025
920b7d1
Fix output formatting and allocation logic in core.py
Jeanmarck12 Nov 17, 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
28 changes: 28 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
pull_request:
branches: [pipfile-experiment]
push:
branches: [pipfile-experiment]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pipenv
run: python -m pip install --upgrade pip pipenv
- name: Install dev dependencies
run: pipenv --python $(which python) install --dev --deploy
- name: Run tests
run: pipenv run pytest -q
- name: Build package
run: pipenv run python -m build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
.vscode/
.vscode/settings.json

# Pycharm junk
.idea/

# emacs backups
*~

Expand Down
18 changes: 18 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest = "*"
build = "*"
twine = "*"
tomli = "*"
typing_extensions = "*"
exceptiongroup = "*"

[packages]
twine = "*"

[requires]
python_version = "3.10"
779 changes: 779 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

304 changes: 302 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,303 @@
# Python Package Exercise
# StudyBuddy — Your (Unhelpfully) Helpful Study Companion

An exercise to create a Python package, build it, test it, distribute it, and use it. See [instructions](./instructions.md) for details.
[![log github events](https://github.com/swe-students-fall2025/3-python-package-team_cedar/actions/workflows/event-logger.yml/badge.svg)](https://github.com/swe-students-fall2025/3-python-package-team_cedar/actions/workflows/event-logger.yml)

---

**StudyBuddy** is a lighthearted Python package that adds sarcasm, pep talks, and playful structure to your study routine. It gives you randomized study tips, motivational messages, funny excuses, and silly study plans to make your academic life a bit more entertaining.

- **PyPI:** https://pypi.org/project/studybuddy-teamcedar/0.8.0/
- **Example app:** [`example.py`](./example.py)

---

## Installation

From PyPI (recommended):
```bash
pip install studybuddy_teamcedar
```

From source:
```bash
git clone https://github.com/swe-students-fall2025/3-python-package-team_cedar.git
cd 3-python-package-team_cedar
pip install -e .
```

---

## Quick Start (Import & Use)
```python
from studybuddy import study_tip, motivate, excuse, study_plan

# Get a humorous study tip
print(study_tip("physics", "chaotic"))

# Get some motivation (sarcastic or genuine)
print(motivate("sarcastic"))

# Get a funny excuse
print(excuse("homework"))

# Generate a study plan
for step in study_plan(3, "high", seed=4):
print(step)
```

---

## API Reference (All Functions)

All functions accept an optional `seed` parameter for reproducible randomness.

### `study_tip(topic="math", mood="chaotic", seed=None) -> str`
Returns a humorous study tip for the given topic.

**Parameters:**
- `topic` (str): The subject area. Options: `"math"`, `"physics"`, `"history"`. Unknown topics default to `"math"`.
- `mood` (str): Currently unused, reserved for future expansion. Default: `"chaotic"`.
- `seed` (int | None): Optional seed for reproducible results.

**Returns:** A string containing a humorous study tip.

**Example:**
```python
from studybuddy import study_tip

print(study_tip("physics", "chaotic"))
# Output: "If it moves, it's probably physics. If not, hit it again."

print(study_tip("math", seed=42))
# Output: "If it's too complex, assume x = 0. Problem solved."
```

---

### `motivate(style="sarcastic", seed=None) -> str`
Returns a motivational or sarcastic message to keep you going.

**Parameters:**
- `style` (str): The tone of motivation. Options: `"sarcastic"`, `"genuine"`. Unknown styles default to `"sarcastic"`.
- `seed` (int | None): Optional seed for reproducible results.

**Returns:** A string containing a motivational message.

**Example:**
```python
from studybuddy import motivate

print(motivate("sarcastic"))
# Output: "Remember: diamonds are made under pressure. So start panicking."

print(motivate("genuine"))
# Output: "One page at a time — just keep going."
```

---

### `excuse(reason="homework", seed=None) -> str`
Returns a funny excuse for various academic mishaps.

**Parameters:**
- `reason` (str): The situation needing an excuse. Options: `"homework"`, `"late"`, `"exam"`. Unknown reasons default to `"homework"`.
- `seed` (int | None): Optional seed for reproducible results.

**Returns:** A string containing a humorous excuse.

**Example:**
```python
from studybuddy import excuse

print(excuse("homework"))
# Output: "My cat deleted my assignment. She's learning cybersecurity."

print(excuse("exam"))
# Output: "I didn't fail. I just found 99 ways that didn't work."

print(excuse("late"))
# Output: "My Wi-Fi connected to another dimension."
```

---

### `study_plan(hours=3, caffeine_level="high", seed=None) -> list[str]`
Generates a humorous study plan with steps.

**Parameters:**
- `hours` (int): Number of hours to plan for. Range: 1–5 (values above 5 are clamped to 5). Default: 3.
- `caffeine_level` (str): Caffeine consumption level. Options: `"low"`, `"high"`. When `"high"`, adds coffee-related steps. Default: `"high"`.
- `seed` (int | None): Optional seed for reproducible results.

**Returns:** A list of strings, each representing a study step.

**Example:**
```python
from studybuddy import study_plan

plan = study_plan(3, "high", seed=4)
for step in plan:
print(step)
# Output:
# Step 1: Drink more coffee. Make coffee.
# Step 2: Drink more coffee. Open your notes.
# Step 3: Panic productively for 90 minutes.

# With low caffeine
plan = study_plan(2, "low", seed=10)
for step in plan:
print(step)
# Output:
# Step 1: Reward yourself with a snack break.
# Step 2: Google half the material.
```

---

## Example Program

See the complete working example at [`example.py`](./example.py):
```python
from studybuddy import study_tip, motivate, excuse, study_plan

def main():
print("=== StudyBuddy Demo ===")
print("\nStudy Tip:", study_tip("physics", "chaotic"))
print("\nMotivation:", motivate("sarcastic"))
print("\nExcuse:", excuse("homework"))
print("\nStudy Plan:")
for step in study_plan(3, "high", seed=4):
print(" -", step)

if __name__ == "__main__":
main()
```

**Run it:**
```bash
python example.py
```

**Sample output:**
```
=== StudyBuddy Demo ===

Study Tip: If it moves, it's probably physics. If not, hit it again.

Motivation: Remember: diamonds are made under pressure. So start panicking.

Excuse: My cat deleted my assignment. She's learning cybersecurity.

Study Plan:
- Step 1: Drink more coffee. Make coffee.
- Step 2: Drink more coffee. Open your notes.
- Step 3: Panic productively for 90 minutes.
```

---

## Contributing

We welcome contributions! Follow this workflow to contribute to the project.

### Set up your development environment

Clone the repository:
```bash
git clone https://github.com/swe-students-fall2025/3-python-package-team_cedar.git
cd 3-python-package-team_cedar
```

Create a virtual environment:
```bash
# Option 1: venv (recommended)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate

# Option 2: Pipenv
pip install pipenv
pipenv install --dev
pipenv shell
```

Install dependencies:
```bash
pip install -U pip
pip install -e . pytest build twine
```

### Run tests
```bash
pytest -q
```

All tests should pass before submitting a pull request.

### Build the package
```bash
python -m build
```

This creates distribution files in the `./dist` directory.

### Publish to PyPI (maintainer only)
```bash
twine upload dist/*
```

### Git workflow for new features

1. **Create a feature branch:**
```bash
git switch -c feat/your-feature-name
```

2. **Make changes and add tests** for any new functionality

3. **Commit your changes:**
```bash
git add -A
git commit -m "feat(core): add your feature description"
```

4. **Push to GitHub:**
```bash
git push -u origin feat/your-feature-name
```

5. **Open a Pull Request** on GitHub
6. **Request a teammate review**
7. **After approval, merge** into `main`
8. **Delete your feature branch**


## Continuous Integration

Every pull request triggers automated testing via GitHub Actions on **Python 3.10** and **3.11**.

The CI badge at the top of this README shows the current build status.

**Workflow file:** [`.github/workflows/event-logger.yml`](.github/workflows/event-logger.yml)

---

## Team Cedar

| Name | GitHub |
|------|--------|
| Nicole Zhang | [@chzzznn](https://github.com/chzzznn) |
| Kylie Lin | [@kylin1209](https://github.com/kylin1209) |
| Sean Tang | [@plant445](https://github.com/plant445) |
| Jeaanmarck Ceant | [@jrc9921](https://github.com/Jeanmarck12) |

---

## PyPI Package

**https://pypi.org/project/studybuddy-teamcedar/0.8.0/**

---

## License

MIT — do cool things responsibly (and sarcastically).
Loading