Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 126 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
fcf067a
Setting up GitHub Classroom Feedback
github-classroom[bot] Oct 30, 2023
1f5166c
Create node.js.yml
awesomeadi00 Nov 3, 2023
17dacf5
Added setup files
awesomeadi00 Nov 3, 2023
9a2392e
Update node.js.yml
awesomeadi00 Nov 3, 2023
f128cdf
Merge branch 'main' into setup
awesomeadi00 Nov 3, 2023
6e23d99
Merge pull request #3 from software-students-fall2023/setup
awesomeadi00 Nov 3, 2023
7e9379b
Update and rename node.js.yml to python.yml
awesomeadi00 Nov 3, 2023
dcb1a05
Added the Testing Badge onto the README file
awesomeadi00 Nov 3, 2023
17103ec
setup mongoDB database + added seed scripts for mongoDB + line random…
Nov 4, 2023
7efdef7
testing
zeepxnflrp Nov 4, 2023
4d5c418
modified randomize function a little bit
zeepxnflrp Nov 4, 2023
b77b9a4
Merge pull request #4 from software-students-fall2023/scripts
ccczy-czy Nov 5, 2023
c1f361d
added chatgpt functionality to get category and language-specific pic…
zeepxnflrp Nov 6, 2023
9111343
Merge pull request #5 from software-students-fall2023/scripts
annsts Nov 6, 2023
772b969
added try except to get ai line
zeepxnflrp Nov 6, 2023
868a144
updated open ai api call to the latest version released 3 HOURS AGO W…
zeepxnflrp Nov 6, 2023
541c6d9
upload_line function
annsts Nov 6, 2023
bf41472
added one test and fixed function to pass it; currently running on la…
zeepxnflrp Nov 7, 2023
42ddb55
Merge pull request #6 from software-students-fall2023/upload-line
zeepxnflrp Nov 7, 2023
23d0919
fix toml file
ccczy-czy Nov 7, 2023
3f85400
Merge remote-tracking branch 'origin' into random-generator-function
ccczy-czy Nov 7, 2023
ddd10a3
wrote tests for get_ai_line + updated pipfile + updated mongo seed sc…
zeepxnflrp Nov 7, 2023
05ae65b
fix module import issue
ccczy-czy Nov 7, 2023
d38c201
Merge pull request #7 from software-students-fall2023/random-generato…
zeepxnflrp Nov 7, 2023
1bc8f63
finetuning
zeepxnflrp Nov 7, 2023
e3152b2
added test pipeline stage
zeepxnflrp Nov 7, 2023
a627fc8
fixed pytest pipeline stage error
zeepxnflrp Nov 7, 2023
66ad643
testing fixing pytest pipeline stage
zeepxnflrp Nov 7, 2023
4a9ba62
pytest pipeline should work now shirley
zeepxnflrp Nov 7, 2023
62b3308
SHIRLEY
zeepxnflrp Nov 7, 2023
2cd3b43
SHIRLEY
zeepxnflrp Nov 7, 2023
0a035e6
SHIRLEY
zeepxnflrp Nov 7, 2023
8db8d6f
SHIRLEY
zeepxnflrp Nov 7, 2023
1e776fb
SHIRLEY
zeepxnflrp Nov 7, 2023
beb4a66
SHIRLEY
zeepxnflrp Nov 7, 2023
8a47420
SHIRLEY
zeepxnflrp Nov 7, 2023
e92d147
leaving this here
zeepxnflrp Nov 7, 2023
220b144
finish random line and random categorized line picker
ccczy-czy Nov 7, 2023
85af91b
Merge pull request #8 from software-students-fall2023/scripts
annsts Nov 7, 2023
393a177
added tests
annsts Nov 7, 2023
349d384
Commented the scripts file
awesomeadi00 Nov 7, 2023
bc70d71
Merge branch 'main' into rizzrating
awesomeadi00 Nov 7, 2023
7ce2b7d
Added pickup line rating functionality with test function
awesomeadi00 Nov 7, 2023
0c9b2d1
Merge pull request #9 from software-students-fall2023/upload_line_tests
awesomeadi00 Nov 7, 2023
4f686ea
Merge branch 'main' into rizzrating
awesomeadi00 Nov 7, 2023
4afb19a
Pulled all previous test functions from the main
awesomeadi00 Nov 7, 2023
659f732
Fixed the test function for the rizz rater
awesomeadi00 Nov 7, 2023
d6099ef
Merge pull request #10 from software-students-fall2023/rizzrating
ccczy-czy Nov 7, 2023
7c3e6dc
Fixed the main menu interface
awesomeadi00 Nov 7, 2023
f92c511
Finalized the fixes for the user interface
awesomeadi00 Nov 7, 2023
de7eb20
Formatted code
awesomeadi00 Nov 7, 2023
45493f7
Tweaked the import on the main
awesomeadi00 Nov 8, 2023
5b8639a
Merge pull request #11 from software-students-fall2023/rizzrating
zeepxnflrp Nov 8, 2023
996651d
SHIRLEY test
zeepxnflrp Nov 8, 2023
14c5cf4
SHIRLEY
zeepxnflrp Nov 8, 2023
16d4faf
hmm
zeepxnflrp Nov 8, 2023
28b360f
yes
zeepxnflrp Nov 8, 2023
74f05c2
TRY
zeepxnflrp Nov 8, 2023
97b5137
test
zeepxnflrp Nov 8, 2023
b151b38
Merge pull request #14 from software-students-fall2023/scripts
annsts Nov 8, 2023
b764fef
Forced the AI to respond to the format for testing
awesomeadi00 Nov 8, 2023
b2806e3
update readme
annsts Nov 8, 2023
b3a609d
Merge pull request #16 from software-students-fall2023/readme
awesomeadi00 Nov 8, 2023
8e7909c
finish randomizer tests
ccczy-czy Nov 8, 2023
9188fc5
fix merge conflict
ccczy-czy Nov 8, 2023
7a83904
update pipefile
ccczy-czy Nov 8, 2023
d0f425d
Merge pull request #17 from software-students-fall2023/random-generat…
awesomeadi00 Nov 8, 2023
4803ba8
Removed mongodb
awesomeadi00 Nov 8, 2023
bb47b2a
added tests
awesomeadi00 Nov 8, 2023
084cbb7
Tests...
awesomeadi00 Nov 8, 2023
c840e72
Finalized tests
awesomeadi00 Nov 8, 2023
5a66cbe
Merge pull request #20 from software-students-fall2023/removedb
annsts Nov 8, 2023
74f0367
Fixed issue with testing
awesomeadi00 Nov 8, 2023
1c738da
Merge pull request #21 from software-students-fall2023/removedb
zeepxnflrp Nov 8, 2023
1eb82a1
Changed files based on pyrizztest
awesomeadi00 Nov 9, 2023
29f794c
Fixed pytests
awesomeadi00 Nov 9, 2023
d457f8c
Fixed some lines
awesomeadi00 Nov 9, 2023
f1eca0f
Updated version
awesomeadi00 Nov 9, 2023
de66536
Update README.md
awesomeadi00 Nov 9, 2023
de3a4a0
Merge pull request #22 from software-students-fall2023/changes
annsts Nov 9, 2023
027eb1c
ascii art
annsts Nov 9, 2023
273c48f
dependencies
annsts Nov 9, 2023
ec2c90c
f
annsts Nov 9, 2023
d6f4da8
ff
annsts Nov 9, 2023
7609aca
don't merge yet, but this is the ai code
Nov 9, 2023
e1b9134
fff
annsts Nov 9, 2023
4a6736e
Merge pull request #23 from software-students-fall2023/create-line
annsts Nov 9, 2023
a2289e3
Revert "ascii art"
annsts Nov 9, 2023
070dcc5
Merge pull request #24 from software-students-fall2023/revert-23-crea…
annsts Nov 9, 2023
e77fb86
test now
Nov 9, 2023
ecc283b
Added ascii art
annsts Nov 9, 2023
ff7b958
Merge pull request #25 from software-students-fall2023/create_ascii
awesomeadi00 Nov 9, 2023
7f5ac6b
Update README.md
awesomeadi00 Nov 9, 2023
4205c31
testing, 19/20 seem to pass
Nov 9, 2023
0b025a9
gon pr after this commit
Nov 9, 2023
d35c12b
trying testing fighting
Nov 9, 2023
1c7ce79
Merge branch 'main' into api_testtoo
zeepxnflrp Nov 9, 2023
9e2a237
Merge pull request #28 from software-students-fall2023/api_testtoo
annsts Nov 9, 2023
256d2a7
fixes
annsts Nov 9, 2023
233b0e0
f
annsts Nov 9, 2023
566a3cc
ff
annsts Nov 9, 2023
ce3a368
add to readme
annsts Nov 9, 2023
5bf8e0f
fix typo in readme
annsts Nov 9, 2023
107e727
Merge pull request #29 from software-students-fall2023/fixes
zeepxnflrp Nov 9, 2023
594e924
Update README.md
awesomeadi00 Nov 9, 2023
9f49ebc
menu fix
annsts Nov 9, 2023
6566ae4
menu fix
annsts Nov 9, 2023
d17b79d
Merge pull request #30 from software-students-fall2023/fixes
awesomeadi00 Nov 9, 2023
ff79f56
init func for api client + minor menu changes
Nov 10, 2023
d4018dc
init api key func + minor menu changes
Nov 10, 2023
76c9b06
Merge pull request #31 from software-students-fall2023/api_testtoo
awesomeadi00 Nov 10, 2023
2afbb5d
Made pickup lines and menu interface consistent
awesomeadi00 Nov 10, 2023
08e16c3
Merge pull request #32 from software-students-fall2023/menufix
zeepxnflrp Nov 10, 2023
0696b6b
Added tests
annsts Nov 10, 2023
04a5d8c
remove lines
annsts Nov 10, 2023
f2dc259
Merge pull request #33 from software-students-fall2023/fixes
awesomeadi00 Nov 10, 2023
597a3d2
Update README.md
awesomeadi00 Nov 10, 2023
59707cf
Edited pyproject.toml, updated the version
awesomeadi00 Nov 10, 2023
7115c35
Update README.md
awesomeadi00 Nov 10, 2023
5beb68b
Updated version on pyproject.toml
awesomeadi00 Nov 10, 2023
e997fdb
Added pypi badge to the readme
awesomeadi00 Nov 10, 2023
6dd0ee2
Updated version
awesomeadi00 Nov 10, 2023
95c57f0
Update README.md
awesomeadi00 Nov 10, 2023
f90267e
Updated version
awesomeadi00 Nov 10, 2023
1b7ca3b
Update README.md
awesomeadi00 Nov 10, 2023
b13bceb
Updated version
awesomeadi00 Nov 10, 2023
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
38 changes: 38 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI / CD
on: [push]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
matrix:
python-version: ["3.7", "3.9", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --user pipenv
pipenv --python ${{ matrix.python-version }}
pipenv install pytest
pipenv install

- name: Turn on 'editable' mode
run: |
pipenv install -e .

- name: Testing with pytest
run: |
pipenv run python -m pytest
env:
MONGO_DBNAME: ${{ secrets.MONGO_DBNAME }}
MONGO_URI: ${{ secrets.MONGO_URI }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include src/pyrizz/data *
19 changes: 19 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://test.pypi.org/simple/"
verify_ssl = true
name = "testpypi"

[packages]
python-dotenv = "==0.16.0"
openai = "==0.28.1"
pytest = "*"

[dev-packages]

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

Large diffs are not rendered by default.

219 changes: 217 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,218 @@
# Python Package Exercise
![Workflow Status](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/actions/workflows/python.yml/badge.svg)
[![PyPI version](https://badge.fury.io/py/pyrizz.svg)](https://badge.fury.io/py/pyrizz)

A little exercise to create a Python package, build it, test it, distribute it, and use it. See [instructions](./instructions.md) for details.
# PyRizz: Your Source for Playful Pickup Lines

[PyRizz PyPi Link](https://pypi.org/project/pyrizz/)

[PyRizz GitHub Link](https://github.com/software-students-fall2023/3-python-package-exercise-experientia)

```
pip install pyrizz
```

Looking to add a dash of humor to your day or spark some laughter in your conversations? PyRizz is here to help! PyRizz is a delightful Python package that provides a collection of randomly generated pickup lines in various categories. Whether you're looking for a clever one-liner, a cheesy quip, or a charming compliment, PyRizz has you covered.

# Contributors
- [Aditya Pandhare](https://github.com/awesomeadi00)
- [Anzhelika Nastashchuk](https://github.com/annsts)
- [Baani Pasrija](https://github.com/zeepxnflrp)
- [Zander Chen](https://github.com/ccczy-czy)

# Key Features

In our package we have 5 special functions which you can use to enhance your dating life:

### get_random_line()

In this function, you can retreive any random pickup line amongst all the categories that we have:

```
from pyrizz import pyrizz

print(pyrizz.get_random_line())
```

### get_random_category_line(category)

In this function, you can retreive any random pickup line from a specific category. We have 4 main categories to choose from:
- 'romantic': Will output a random romantic pickup line
- 'clever': Will output a random clever pickup line
- 'geeky': Will output a random geeky pickup line
- 'dev': Will output a random specially handselected pickup line from the developers
- 'all': Will output a random pickup line across ALL categories (basically get_random_line())

```
from pyrizz import pyrizz

print(pyrizz.get_random_category_line('romantic'))
print(pyrizz.get_random_category_line('clever'))
print(pyrizz.get_random_category_line('geeky'))
print(pyrizz.get_random_category_line('dev'))
print(pyrizz.get_random_category_line('all'))
```

### create_line(template_number, words)

In this function, if you're new to pickup lines, you can create your very own pickup using some of our templates!
- **template_number** - You need to input a template number (0-39). You can find out the templates by calling the list_templates() function: `templates = pyrizz.list_templates()`. This way you can see how the templates look like, how many words you need to include and which one you like! You can print these templates like this:
```
for idx, template in enumerate(templates, 1):
print(f"Template {idx}: {template}")
```
- **words** - You need to input a list of all the words, for example if you need to input 2 words: `words = ["word1", "word2"]`

This function returns your line with some lovely ASCII art as well! Enjoy!
Here is an example:
```
from pyrizz import pyrizz

words_to_use = ["sun"]
output = pyrizz.create_line(1, words_to_use)
print(output)
```

## Use AI to spice up your pickup lines!

In order to access these two bottom functions, you need to have an openai api key! You can set up it as shown in the bottom two examples:

### get_ai_line(keyword, your_openai_key)

In this function, you can retreive a generated pickup line using openai gpt-3.5 model based on any keyword that you suggest. In this example, it would output a Shakespearean pickup line:

```
from pyrizz import pyrizz
import openai

client = pyrizz.init_openai("your_api_key")
print(pyrizz.get_ai_line("shakespeare", client))
```

### rate_line(pickup_line, your_openai_key)

In this function, you can rate your very own pickup line out of 10 using openai gpt-3.5 model. Simply type your pickup line and a rating will output:

```
from pyrizz import pyrizz
import openai

client = pyrizz.init_openai("your_api_key")
print(pyrizz.rate_line('Are you from Tennesse? Cause you're the only 10 I see.', client))
```

Note: Please make sure you are using `openai==0.28.1`.


### Accessing an Example:
You can access our example file which utilizes all of these functions with an awesome user interface:
[Example File](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/blob/main/src/pyrizz/__main__.py)

To run our main file simply run: `python3 -m pyrizz` on the terminal.

# Contributing

We love contributions from everyone. By participating in this project, you agree to abide by the [code of conduct](https://github.com/eads/generic-code-of-conduct.git).

### Setting Up the Development Environment

1. **Clone the repository**:

Use the following command to clone the Pyrizz repository:

```shell
git clone https://github.com/software-students-fall2023/3-python-package-exercise-experientia
```

2. **Navigate to the project directory**:

Change into the cloned directory:

```shell
cd 3-python-package-exercise-experientia
```

3. **Install pipenv**:

If you don't have pipenv installed, use pip to install it:

```shell
pip install pipenv
```

4. **Install dependencies**:

Use pipenv to create a virtual environment and install the necessary packages:

```shell
pipenv install --dev
```

5. **Activate the virtual environment**:

Enter the virtual environment using:

```shell
pipenv shell
```

6. **Make your changes**:

Make the changes you want to contribute to the project.

7. **Run tests**:

Ensure your changes pass all tests using pytest:

```shell
pipenv run python -m pytest
```

8. **Submit a Pull Request**:

After making your changes and verifying the functionality, commit your changes and push your branch to GitHub. Then, submit a pull request to the main branch for review.

## Testing your __main__.py file locally:

If you wish to test and run the `__main__.py` file locally (not test and run the `__main__.py` from the package), all you have to do is uncomment the bottom imports from the `pyrizz.py` and `__main__.py` file and comment the top ones as shown below:

**pyrizz.py:**
```
# Uncomment when using pytest and uploading the package to PyPi
# from pyrizz.pickuplines import pickuplines
# from pyrizz.templates import templates

# Uncomment when testing the __main__.py file locally
from pickuplines import pickuplines
from templates import templates
```

**__main__.py**:
```
# Uncomment when using pytest and uploading the package to PyPi
# import pyrizz.pyrizz as pyrizz

# Uncomment when testing the __main__.py file locally
import pyrizz as pyrizz
```
Then you can run the command: `python3 src/pyrizz/__main__.py` to execute the main file locally.

As always, when you wish to finally test the program and repackage it, you must comment the imports you just uncommented to run the main locally, and uncomment the top imports as they are necessary for testing and packaging.

### Reporting Bugs

Report bugs at [Issues](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/issues).

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

### Submitting Enhancements

If you're proposing enhancements or new features:

* Open a new issue [here](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/issues), describing the enhancement.
* Include the 'enhancement' label on the issue.

Thank you for your interest in rizz!
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "pyrizz"
description = "A package where users can receive pick up lines, rate pickup lines and add pickup lines"
version = "1.1.2"
authors = [
{ name="Aditya Pandhare", email="[email protected]" },
{ name="Anzhelika Nastashchuk", email="[email protected]" },
{ name="Baani Pasrsija", email="[email protected]" },
{ name="Zander Chen", email="[email protected]" }
]
license = { file = "LICENSE" }
readme = "README.md"
keywords = ["python", "package", "build", "pyrizz", "pickup-line"]
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/software-students-fall2023/3-python-package-exercise-experientia"
"Repository" = "https://github.com/software-students-fall2023/3-python-package-exercise-experientia.git"
"Bug Tracker" = "https://github.com/software-students-fall2023/3-python-package-exercise-experientia/issues"

[project.scripts]
pyrizz = "pyrizz.__main__:main"

[tool.setuptools.package-data]
"pyrizz" = ["data/*"]
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python-dotenv==0.16.0
openai==0.28.1
pytest==7.4.3
Empty file added src/pyrizz/__init__.py
Empty file.
Loading