From fcf067a08ef01bf0caea9166043946276957ffd1 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:20:50 +0000 Subject: [PATCH 01/95] Setting up GitHub Classroom Feedback From 1f5166c01612236ed35f782635ae67a9eb3a0c6b Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Fri, 3 Nov 2023 10:28:33 -0400 Subject: [PATCH 02/95] Create node.js.yml --- .github/workflows/node.js.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..c5d3d97 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: pyrizz_tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm test From 17dacf5f6c4d3f15ec8aa904fa0bc7856667a573 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Fri, 3 Nov 2023 10:30:11 -0400 Subject: [PATCH 03/95] Added setup files --- Pipfile | 13 +++++++ Pipfile.lock | 88 ++++++++++++++++++++++++++++++++++++++++++ myproject.toml | 35 +++++++++++++++++ src/pyrizz/__init__.py | 0 src/pyrizz/__main__.py | 0 src/pyrizz/pyrizz.py | 0 tests/__init__.py | 0 tests/test_pyrizz.py | 13 +++++++ 8 files changed, 149 insertions(+) create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 myproject.toml create mode 100644 src/pyrizz/__init__.py create mode 100644 src/pyrizz/__main__.py create mode 100644 src/pyrizz/pyrizz.py create mode 100644 tests/__init__.py create mode 100644 tests/test_pyrizz.py diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..7b214a0 --- /dev/null +++ b/Pipfile @@ -0,0 +1,13 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +pytest = "*" +pyrizz = {editable = true, path = "."} + +[dev-packages] + +[requires] +python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..588d2d9 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,88 @@ +{ + "_meta": { + "hash": { + "sha256": "e38cb2ff7dbae6efff334b2b10aebdcddcd9d3949e8b8ceb7d03a8c0f402a693" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.9" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "attrs": { + "hashes": [ + "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6", + "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c" + ], + "markers": "python_version >= '3.5'", + "version": "==22.1.0" + }, + "pyrizz": { + "editable": true, + "path": "." + }, + "exceptiongroup": { + "hashes": [ + "sha256:2ac84b496be68464a2da60da518af3785fff8b7ec0d090a581604bc870bdee41", + "sha256:affbabf13fb6e98988c38d9c5650e701569fe3c1de3233cfb61c5f33774690ad" + ], + "markers": "python_version < '3.11'", + "version": "==1.0.0" + }, + "iniconfig": { + "hashes": [ + "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", + "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32" + ], + "version": "==1.1.1" + }, + "packaging": { + "hashes": [ + "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", + "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" + ], + "markers": "python_version >= '3.6'", + "version": "==21.3" + }, + "pluggy": { + "hashes": [ + "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", + "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" + ], + "markers": "python_version >= '3.6'", + "version": "==1.0.0" + }, + "pyparsing": { + "hashes": [ + "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", + "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc" + ], + "markers": "python_full_version >= '3.6.8'", + "version": "==3.0.9" + }, + "pytest": { + "hashes": [ + "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71", + "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59" + ], + "index": "pypi", + "version": "==7.2.0" + }, + "tomli": { + "hashes": [ + "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" + ], + "markers": "python_version < '3.11'", + "version": "==2.0.1" + } + }, + "develop": {} +} diff --git a/myproject.toml b/myproject.toml new file mode 100644 index 0000000..4707f56 --- /dev/null +++ b/myproject.toml @@ -0,0 +1,35 @@ +[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 one at a time." +version = "0.0.1" +authors = [ + { name="Aditya Pandhare", email="adityapandhare44@gmail.com", + name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com", + name="Baani Pasrija", email="baanipasrija25@gmail.com", + name="Zander Chen", email="ccczy2002@gmail.com", + }, +] +license = { file = "LICENSE" } +readme = "README.md" +keywords = ["python", "package", "build", "tutorial"] +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/awesomeadi00/Python_Package_Example" +"Repository" = "https://github.com/awesomeadi00/Python_Package_Example.git" + +[project.scripts] +pyrizz = "pyrizz.__main__:main" diff --git a/src/pyrizz/__init__.py b/src/pyrizz/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py new file mode 100644 index 0000000..de7d4e0 --- /dev/null +++ b/tests/test_pyrizz.py @@ -0,0 +1,13 @@ +import pytest + +class Tests: + # An example of a pytest fixture - a function that can be used for setup and teardown before and after test functions are run. + @pytest.fixture + def example_fixture(self): + yield + + # Test debugging... making sure that we can run a simple test that always passes. + def test_sanity_check(self, example_fixture): + expected = True + actual = True + assert actual == expected, "Expected True to be equal to True!" \ No newline at end of file From 9a2392e425b17cf7cb3ddf4d571b6e46c60ed220 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Fri, 3 Nov 2023 10:42:30 -0400 Subject: [PATCH 04/95] Update node.js.yml --- .github/workflows/node.js.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c5d3d97..840f1d7 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -27,5 +27,4 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm ci - - run: npm run build --if-present - run: npm test From 7e9379b8ee1d1baa1d86d31b3890aee3bd247ba7 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Fri, 3 Nov 2023 10:51:16 -0400 Subject: [PATCH 05/95] Update and rename node.js.yml to python.yml --- .github/workflows/{node.js.yml => python.yml} | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) rename .github/workflows/{node.js.yml => python.yml} (51%) diff --git a/.github/workflows/node.js.yml b/.github/workflows/python.yml similarity index 51% rename from .github/workflows/node.js.yml rename to .github/workflows/python.yml index 840f1d7..394e272 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/python.yml @@ -11,20 +11,15 @@ on: jobs: build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x, 16.x, 18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm test + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x # Specify the Python version you need + - name: Install dependencies + run: | + pip install pipenv + pipenv install --dev + # Add more steps for your tests and other tasks + From dcb1a05a0a6643996da50d132b2b5e376fc67cc1 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Fri, 3 Nov 2023 11:05:41 -0400 Subject: [PATCH 06/95] Added the Testing Badge onto the README file --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 038fbed..ca45a04 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![Workflow Status](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/actions/workflows/python.yml/badge.svg) + # Python Package Exercise A little exercise to create a Python package, build it, test it, distribute it, and use it. See [instructions](./instructions.md) for details. From 17103ec7755eb0020db74e26f8a207429128d81f Mon Sep 17 00:00:00 2001 From: zeep Date: Sat, 4 Nov 2023 05:25:34 -0400 Subject: [PATCH 07/95] setup mongoDB database + added seed scripts for mongoDB + line randomizer --- requirements.txt | 2 + src/data/lines.json | 106 ++++++++++++++++++++++++++++++++++++++ src/data/lines.txt | 102 ++++++++++++++++++++++++++++++++++++ src/pyrizz/pyrizz.py | 27 ++++++++++ src/scripts/extract.py | 25 +++++++++ src/scripts/mongo-seed.py | 36 +++++++++++++ 6 files changed, 298 insertions(+) create mode 100644 requirements.txt create mode 100644 src/data/lines.json create mode 100644 src/data/lines.txt create mode 100644 src/scripts/extract.py create mode 100644 src/scripts/mongo-seed.py diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a76eb79 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pymongo==4.6.0 +python-dotenv==0.16.0 \ No newline at end of file diff --git a/src/data/lines.json b/src/data/lines.json new file mode 100644 index 0000000..645e2c6 --- /dev/null +++ b/src/data/lines.json @@ -0,0 +1,106 @@ +{ + "lines": [ + "Is it okay if I walk you home? My heart seems to follow wherever you go.\n", + "If beauty were a moment, you'd be an eternity.\n", + "Did we just share an elevator? Because I believe we have some serious uplifted chemistry.\n", + "I must be a snowflake because I've fallen for you.\n", + "Every time I see you, it feels like I've discovered a new shade of color.\n", + "If stars would shine every time I thought of you, the night sky would never be dark.\n", + "Do you believe in love at first sight, or should I walk by again?\n", + "Your voice is my favorite sound, and your name is my favorite noun.\n", + "If I were to rewrite the alphabet, I'd put U and I together.\n", + "Have you been to the doctor recently? Because I think you've got a case of being mesmerizing.\n", + "I wouldn't need a camera to savor this moment; I just need you.\n", + "Is it hot in here, or is it just the aura of warmth you radiate?\n", + "I tried finding the perfect line to make you smile, but then I realized you are the line.\n", + "If you were a vegetable, you'd be a 'cute-cumber.'\n", + "If life was a song, your smile would be the melody that gets stuck in my head.\n", + "I'm not a photographer, but I can surely picture us together.\n", + "If you were a fruit, you'd be a fine-apple.\n", + "I'm not sure if it was the sparkle in your eyes or your radiant smile, but something just lit up my world.\n", + "Do you mind holding my hand? I want to be sure I'm not dreaming.\n", + "I've been trying to tie my shoes, but I can't stop tripping over my thoughts of you.\n", + "Is there a rainbow today? Because I've just found my pot of gold in you.\n", + "Do you have a map? I keep getting lost in your eyes.\n", + "If you were a star, you'd outshine the entire galaxy.\n", + "I'm not a wishful thinker, but with you, I believe in fairy tales.\n", + "I thought happiness started with an H, but mine starts with U.\n", + "Your smile must be a black hole because it's irresistibly attractive.\n", + "Are you Wi-fi? Because I'm feeling a connection.\n", + "If kisses were snowflakes, I'd send you a blizzard.\n", + "Do you have a Band-Aid? I just scraped my knee falling for you.\n", + "Your presence makes my heart race, but it's a marathon I never want to finish.\n", + "If beauty were a crime, you'd be serving a life sentence.\n", + "Did it hurt? When you fell from the stars and landed in my world?\n", + " I'm not a genie, but I can make your dreams come true.\n", + "Every song I hear reminds me of you, even the ones I haven't heard yet.\n", + "I never believed in magic until I saw you.\n", + "If you were words on a page, you'd be the fine print.\n", + " Are you made of copper and tellurium? Because you're Cu-Te.\n", + "Can I follow you? Because my mom told me to follow my dreams.\n", + "Your beauty could inspire poets and artists for generations.\n", + "Do you believe in destiny? Because I think ours just intertwined.\n", + "Are you a calculator? Because every time I look at you, things start adding up.\n", + "Is your name Google? Because you have everything I've been searching for.\n", + "Do you have a name, or can I call you mine?\n", + "Are you a magician? Every time I look at you, everyone else disappears.\n", + "Do you like basketball? Because when I saw you, my heart did a slam dunk.\n", + "Are you a library book? Because I can't help but check you out.\n", + "If you were a vegetable, you'd be a cutecumber.\n", + "Do you have a sunburn or are you always this hot?\n", + "Is your dad a boxer? Because you're a knockout.\n", + "Are you a loan from a bank? Because you have my interest.\n", + "Are you a campfire? Because you're hot and I want s'more.\n", + "Do you have a pencil? Because I want to erase your past and write our future.\n", + "Are you a parking ticket? Because you've got 'FINE' written all over you.\n", + "If I could rearrange the alphabet, I would put U and I together.\n", + "Are you a snowstorm? Because you make my heart race.\n", + "Do you have a Band-Aid? Because I just scraped my knee falling for you.\n", + "Is your dad a baker? Because you're a cutie pie.\n", + "Are you a time traveler? Because I can see you in my future.\n", + "Are you a candle? Because you light up my world.\n", + "Are you a string? Because I can't stop finding myself attached to you.\n", + "If you were a function, I'd call you every day.\n", + "Are you a loop? Because I can't stop thinking about you again and again.\n", + "You're the 'key' to my 'value'.\n", + "If beauty were data, you'd be an overflow error.\n", + "Are you a variable? Because I feel the need to declare my intentions.\n", + "I think you've just incremented my heart's counter.\n", + "You're the API to my application.\n", + "If relationships were algorithms, ours would be a perfect match.\n", + "Your presence makes my system run at optimal efficiency.\n", + "If you were an exception, I'd catch you.\n", + "You must be a compiler because every time I see you, my code becomes runnable.\n", + "I'm not a photographer, but I can picture us in an endless loop together.\n", + "In the world of binary, you are the one for me.\n", + "I've got a lot of lines of code, but none as intriguing as the story of us.\n", + "Forget the cloud, you've taken up all the storage in my heart.\n", + "I don't need version control to know you're my final commit.\n", + "Let's merge our branches and build a beautiful codebase together.\n", + "Do you believe in parallel universes? Because in every one I've imagined, it's always been you and me.\n", + "You must be a packet because I can't help but sniff you out in a crowd.\n", + "Are you an algorithm? Because every part of me wants to solve you.\n", + "Do you know JavaScript? Because you make my heart race asynchronously.\n", + "If I were to traverse the nodes of my heart, every path would lead to you.\n", + "In the Git of life, I'd never want to revert our commit.\n", + "Are you a CSS file? Because without you, my life would be unstyled.\n", + "You must be a bug, because I just can't shake you off my mind.\n", + "If hearts had firewalls, you'd have bypassed mine ages ago.\n", + "Are you a Boolean? Because true or false, my heart points to you.\n", + "In the world of objects, you are my favorite instance.\n", + "If attraction were a programming language, ours would be high-level.\n", + "Are you a kernel? Because my heart feels an urge to dive deeper into you.\n", + "Do you like Java? Because you've Objectified my affections.\n", + "I'd never put our relationship in a try-catch block, because I never want to handle an exception with us. \n", + "You're not just a semicolon; you're the statement that completes me.\n", + "In the IDE of life, you've just become my favorite extension.\n", + "If I were a coder, I'd refactor my life to include more of you.\n", + "You're like the most elegant code I've ever seen; concise, beautiful, and effective.\n", + "You've stolen the ASCII to my heart.\n", + "You must be an exception, because I can't handle you properly.\n", + "You must be an algorithm, because you have my heart running in O(1) time.\n", + "Are you a piece of code? Because you're turning my software into hardware!\n", + "Are you a compressed file? Because when I see you, my heart wants to unzip.\n", + "I'm the RizzLord." + ] +} \ No newline at end of file diff --git a/src/data/lines.txt b/src/data/lines.txt new file mode 100644 index 0000000..b537045 --- /dev/null +++ b/src/data/lines.txt @@ -0,0 +1,102 @@ +Is it okay if I walk you home? My heart seems to follow wherever you go. +If beauty were a moment, you'd be an eternity. +Did we just share an elevator? Because I believe we have some serious uplifted chemistry. +I must be a snowflake because I've fallen for you. +Every time I see you, it feels like I've discovered a new shade of color. +If stars would shine every time I thought of you, the night sky would never be dark. +Do you believe in love at first sight, or should I walk by again? +Your voice is my favorite sound, and your name is my favorite noun. +If I were to rewrite the alphabet, I'd put U and I together. +Have you been to the doctor recently? Because I think you've got a case of being mesmerizing. +I wouldn't need a camera to savor this moment; I just need you. +Is it hot in here, or is it just the aura of warmth you radiate? +I tried finding the perfect line to make you smile, but then I realized you are the line. +If you were a vegetable, you'd be a 'cute-cumber.' +If life was a song, your smile would be the melody that gets stuck in my head. +I'm not a photographer, but I can surely picture us together. +If you were a fruit, you'd be a fine-apple. +I'm not sure if it was the sparkle in your eyes or your radiant smile, but something just lit up my world. +Do you mind holding my hand? I want to be sure I'm not dreaming. +I've been trying to tie my shoes, but I can't stop tripping over my thoughts of you. +Is there a rainbow today? Because I've just found my pot of gold in you. +Do you have a map? I keep getting lost in your eyes. +If you were a star, you'd outshine the entire galaxy. +I'm not a wishful thinker, but with you, I believe in fairy tales. +I thought happiness started with an H, but mine starts with U. +Your smile must be a black hole because it's irresistibly attractive. +Are you Wi-fi? Because I'm feeling a connection. +If kisses were snowflakes, I'd send you a blizzard. +Do you have a Band-Aid? I just scraped my knee falling for you. +Your presence makes my heart race, but it's a marathon I never want to finish. +If beauty were a crime, you'd be serving a life sentence. +Did it hurt? When you fell from the stars and landed in my world? + I'm not a genie, but I can make your dreams come true. +Every song I hear reminds me of you, even the ones I haven't heard yet. +I never believed in magic until I saw you. +If you were words on a page, you'd be the fine print. + Are you made of copper and tellurium? Because you're Cu-Te. +Can I follow you? Because my mom told me to follow my dreams. +Your beauty could inspire poets and artists for generations. +Do you believe in destiny? Because I think ours just intertwined. +Are you a calculator? Because every time I look at you, things start adding up. +Is your name Google? Because you have everything I've been searching for. +Do you have a name, or can I call you mine? +Are you a magician? Every time I look at you, everyone else disappears. +Do you like basketball? Because when I saw you, my heart did a slam dunk. +Are you a library book? Because I can't help but check you out. +If you were a vegetable, you'd be a cutecumber. +Do you have a sunburn or are you always this hot? +Is your dad a boxer? Because you're a knockout. +Are you a loan from a bank? Because you have my interest. +Are you a campfire? Because you're hot and I want s'more. +Do you have a pencil? Because I want to erase your past and write our future. +Are you a parking ticket? Because you've got 'FINE' written all over you. +If I could rearrange the alphabet, I would put U and I together. +Are you a snowstorm? Because you make my heart race. +Do you have a Band-Aid? Because I just scraped my knee falling for you. +Is your dad a baker? Because you're a cutie pie. +Are you a time traveler? Because I can see you in my future. +Are you a candle? Because you light up my world. +Are you a string? Because I can't stop finding myself attached to you. +If you were a function, I'd call you every day. +Are you a loop? Because I can't stop thinking about you again and again. +You're the 'key' to my 'value'. +If beauty were data, you'd be an overflow error. +Are you a variable? Because I feel the need to declare my intentions. +I think you've just incremented my heart's counter. +You're the API to my application. +If relationships were algorithms, ours would be a perfect match. +Your presence makes my system run at optimal efficiency. +If you were an exception, I'd catch you. +You must be a compiler because every time I see you, my code becomes runnable. +I'm not a photographer, but I can picture us in an endless loop together. +In the world of binary, you are the one for me. +I've got a lot of lines of code, but none as intriguing as the story of us. +Forget the cloud, you've taken up all the storage in my heart. +I don't need version control to know you're my final commit. +Let's merge our branches and build a beautiful codebase together. +Do you believe in parallel universes? Because in every one I've imagined, it's always been you and me. +You must be a packet because I can't help but sniff you out in a crowd. +Are you an algorithm? Because every part of me wants to solve you. +Do you know JavaScript? Because you make my heart race asynchronously. +If I were to traverse the nodes of my heart, every path would lead to you. +In the Git of life, I'd never want to revert our commit. +Are you a CSS file? Because without you, my life would be unstyled. +You must be a bug, because I just can't shake you off my mind. +If hearts had firewalls, you'd have bypassed mine ages ago. +Are you a Boolean? Because true or false, my heart points to you. +In the world of objects, you are my favorite instance. +If attraction were a programming language, ours would be high-level. +Are you a kernel? Because my heart feels an urge to dive deeper into you. +Do you like Java? Because you've Objectified my affections. +I'd never put our relationship in a try-catch block, because I never want to handle an exception with us. +You're not just a semicolon; you're the statement that completes me. +In the IDE of life, you've just become my favorite extension. +If I were a coder, I'd refactor my life to include more of you. +You're like the most elegant code I've ever seen; concise, beautiful, and effective. +You’ve stolen the ASCII to my heart. +You must be an exception, because I can’t handle you properly. +You must be an algorithm, because you have my heart running in O(1) time. +Are you a piece of code? Because you’re turning my software into hardware! +Are you a compressed file? Because when I see you, my heart wants to unzip. +I'm the RizzLord. \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index e69de29..c69b186 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -0,0 +1,27 @@ +from pymongo import MongoClient +import os +from dotenv import load_dotenv +from random import randint + +load_dotenv() + +client = MongoClient(os.getenv('MONGO_URI')) + +# Checks if the connection has been made, else make an error printout +try: + client.admin.command('ping') + database = client[os.getenv('MONGO_DBNAME')] + print('* Connected to MongoDB!') + +except Exception as err: + print('* "Failed to connect to MongoDB at', os.getenv('MONGO_URI')) + print('Database connection error:', err) + +collection = database['lines'] + +size = len(collection.find_one({})["lines"]) +random_number = randint(0, size - 1) + +line = collection.find_one({})["lines"][random_number] + +print(line) \ No newline at end of file diff --git a/src/scripts/extract.py b/src/scripts/extract.py new file mode 100644 index 0000000..8cb7763 --- /dev/null +++ b/src/scripts/extract.py @@ -0,0 +1,25 @@ +import json +import pathlib + +PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." + +file_lines = [] + +with open(f'{PROJECT_ROOT}/src/data/lines.txt', 'r') as file: + file_lines = file.readlines() + +d = { + 'lines': [] +} + +for line in file_lines: + d['lines'].append(line) + +with open(f'{PROJECT_ROOT}/src/data/lines.json', 'w') as file: + json.dump(d, file) + +# with open('data/lines.json', 'r') as file: +# data = json.load(file) + +# for line in data['lines']: +# print(line) \ No newline at end of file diff --git a/src/scripts/mongo-seed.py b/src/scripts/mongo-seed.py new file mode 100644 index 0000000..e0800c2 --- /dev/null +++ b/src/scripts/mongo-seed.py @@ -0,0 +1,36 @@ +from pymongo import MongoClient +import os +from dotenv import load_dotenv +import json +import pathlib + +load_dotenv() + +PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." + +# Establish a database connection with the MONGO_URI (MongoDB Atlas connection) +client = MongoClient(os.getenv('MONGO_URI')) + +# Checks if the connection has been made, else make an error printout +try: + client.admin.command('ping') + database = client[os.getenv('MONGO_DBNAME')] + print('* Connected to MongoDB!') + +except Exception as err: + print('* "Failed to connect to MongoDB at', os.getenv('MONGO_URI')) + print('Database connection error:', err) + +lines = [] + +with open(f'{PROJECT_ROOT}/src/data/lines.json', 'r') as file: + data = json.load(file) + lines = data['lines'] + +collection = database['lines'] + +collection.insert_one({ + 'lines': lines +}) + +client.close() \ No newline at end of file From 7efdef7a007a1bb157f9fbfb03b79c35582e46e3 Mon Sep 17 00:00:00 2001 From: zeep Date: Sat, 4 Nov 2023 05:30:26 -0400 Subject: [PATCH 08/95] testing --- src/data/lines.txt | 3 +-- src/scripts/extract.py | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/data/lines.txt b/src/data/lines.txt index b537045..04bb178 100644 --- a/src/data/lines.txt +++ b/src/data/lines.txt @@ -98,5 +98,4 @@ You’ve stolen the ASCII to my heart. You must be an exception, because I can’t handle you properly. You must be an algorithm, because you have my heart running in O(1) time. Are you a piece of code? Because you’re turning my software into hardware! -Are you a compressed file? Because when I see you, my heart wants to unzip. -I'm the RizzLord. \ No newline at end of file +Are you a compressed file? Because when I see you, my heart wants to unzip. \ No newline at end of file diff --git a/src/scripts/extract.py b/src/scripts/extract.py index 8cb7763..f400697 100644 --- a/src/scripts/extract.py +++ b/src/scripts/extract.py @@ -18,8 +18,3 @@ with open(f'{PROJECT_ROOT}/src/data/lines.json', 'w') as file: json.dump(d, file) -# with open('data/lines.json', 'r') as file: -# data = json.load(file) - -# for line in data['lines']: -# print(line) \ No newline at end of file From 4d5c41872d5db8b8756cc866f6d8e11703a86620 Mon Sep 17 00:00:00 2001 From: zeep Date: Sat, 4 Nov 2023 05:54:42 -0400 Subject: [PATCH 09/95] modified randomize function a little bit --- src/pyrizz/pyrizz.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index c69b186..94558e8 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -19,9 +19,10 @@ collection = database['lines'] -size = len(collection.find_one({})["lines"]) -random_number = randint(0, size - 1) +def get_random_line() -> None: + size = len(collection.find_one({})["lines"]) + random_number = randint(0, size - 1) -line = collection.find_one({})["lines"][random_number] + line = collection.find_one({})["lines"][random_number] -print(line) \ No newline at end of file + print(line) \ No newline at end of file From c1f361de1a582080bc66caa09e523b6b6d546c23 Mon Sep 17 00:00:00 2001 From: zeep Date: Sun, 5 Nov 2023 23:02:43 -0500 Subject: [PATCH 10/95] added chatgpt functionality to get category and language-specific pick up lines + set up a dummy main menu + added gpt generated pick-up lines to database as a separate collection --- requirements.txt | 3 ++- src/pyrizz/__main__.py | 49 +++++++++++++++++++++++++++++++++++++++ src/pyrizz/pyrizz.py | 28 ++++++++++++++++++++-- src/scripts/extract.py | 3 +-- src/scripts/mongo-seed.py | 9 +++++-- 5 files changed, 85 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index a76eb79..12de76b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ pymongo==4.6.0 -python-dotenv==0.16.0 \ No newline at end of file +python-dotenv==0.16.0 +openai==0.28.1 \ No newline at end of file diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index e69de29..5886f03 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -0,0 +1,49 @@ +import pyrizz + +"""Main function for PyRizz.""" + +#ASCII art + +print(" __ " + " ____ _ ") +print("|__) " + " / __ \(_)_______ ") +print("| \/ " + " / /_/ / /_ /_ / ") +print(" / " + " / _, _/ / / /_/ /_ ") +print(" " + "/_/ |_/_/ /___/___/ ") + +print("\n\n") + +def main(): + print("Welcome to PyRizz! Your journey to getting a date begins here...\n") + + while True: + + print("What would you like to do today?\n") + print("1. Get a random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") + print("2. Get a category-specific random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") + print("3. Have AI generate a pick-up line in your chosen category / language with a 50% success rate.") + print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") + print("5. Insert your own pick-up line to our database.\n") + print("!! Type Q to quit !!\n") + + print("Enter your choice: ") + user_input = input("> ") + + if user_input == "3": + print("Enter a category / language: ") + category = input("> ") + print("\n" + pyrizz.get_ai_line(category), end = "\n\n") + + elif user_input == "q" or user_input == "Q": + break + + print("Would you like to do something else? (y/n)") + user_cont = input("> ") + + if user_cont == "n": + break + + if user_cont == "y": + continue + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 94558e8..ea8e2f2 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -2,16 +2,18 @@ import os from dotenv import load_dotenv from random import randint +import openai load_dotenv() client = MongoClient(os.getenv('MONGO_URI')) +openai.api_key = os.getenv('OPENAI_API_KEY') # Checks if the connection has been made, else make an error printout try: client.admin.command('ping') database = client[os.getenv('MONGO_DBNAME')] - print('* Connected to MongoDB!') + print('*****') except Exception as err: print('* "Failed to connect to MongoDB at', os.getenv('MONGO_URI')) @@ -25,4 +27,26 @@ def get_random_line() -> None: line = collection.find_one({})["lines"][random_number] - print(line) \ No newline at end of file + print(line) + +def get_ai_line(category) -> str: + response = openai.ChatCompletion.create( + model = os.getenv('OPENAI_MODEL'), + messages = + [{"role": "user", "content": f"I need a {category} pick-up line."},] + ) + + message = response.choices[0]['message'] + ai_line = "{}".format(message['content']) + + collection = database['ai_generated'] + + lines = collection.find_one({})["lines"] + + lines.append(ai_line) + + collection.insert_one({ + 'lines': lines + }) + + return ai_line \ No newline at end of file diff --git a/src/scripts/extract.py b/src/scripts/extract.py index f400697..a0254ed 100644 --- a/src/scripts/extract.py +++ b/src/scripts/extract.py @@ -16,5 +16,4 @@ d['lines'].append(line) with open(f'{PROJECT_ROOT}/src/data/lines.json', 'w') as file: - json.dump(d, file) - + json.dump(d, file) \ No newline at end of file diff --git a/src/scripts/mongo-seed.py b/src/scripts/mongo-seed.py index e0800c2..2092a74 100644 --- a/src/scripts/mongo-seed.py +++ b/src/scripts/mongo-seed.py @@ -27,10 +27,15 @@ data = json.load(file) lines = data['lines'] -collection = database['lines'] +collection_dev_lines = database['dev_lines'] +collection_ai_generated = database['ai_generated'] -collection.insert_one({ +collection_dev_lines.insert_one({ 'lines': lines }) +collection_ai_generated.insert_one({ + 'lines': [] +}) + client.close() \ No newline at end of file From 772b969eff9839d4b29af71a275e70841e1fbe9e Mon Sep 17 00:00:00 2001 From: zeep Date: Mon, 6 Nov 2023 14:42:05 -0500 Subject: [PATCH 11/95] added try except to get ai line --- src/pyrizz/pyrizz.py | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index ea8e2f2..a4bb9f2 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -30,23 +30,27 @@ def get_random_line() -> None: print(line) def get_ai_line(category) -> str: - response = openai.ChatCompletion.create( - model = os.getenv('OPENAI_MODEL'), - messages = - [{"role": "user", "content": f"I need a {category} pick-up line."},] - ) + try: + response = openai.ChatCompletion.create( + model = os.getenv('OPENAI_MODEL'), + messages = + [{"role": "user", "content": f"I need a {category} pick-up line."},] + ) - message = response.choices[0]['message'] - ai_line = "{}".format(message['content']) + message = response.choices[0]['message'] + ai_line = "{}".format(message['content']) - collection = database['ai_generated'] + collection = database['ai_generated'] - lines = collection.find_one({})["lines"] - - lines.append(ai_line) + lines = collection.find_one({})["lines"] + + lines.append(ai_line) - collection.insert_one({ - 'lines': lines - }) + collection.insert_one({ + 'lines': lines + }) - return ai_line \ No newline at end of file + return ai_line + + except Exception as err: + print(err) \ No newline at end of file From 868a144702f24a895bd4d4ecd7a23982073c9e28 Mon Sep 17 00:00:00 2001 From: zeep Date: Mon, 6 Nov 2023 15:19:50 -0500 Subject: [PATCH 12/95] updated open ai api call to the latest version released 3 HOURS AGO WITHIMPERFECT / INCORRECT OFFICIAL DOCUMENTATION :CCCC --- requirements.txt | 2 +- src/pyrizz/pyrizz.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 12de76b..4134913 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pymongo==4.6.0 python-dotenv==0.16.0 -openai==0.28.1 \ No newline at end of file +openai==1.0.1 \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index a4bb9f2..5ec2153 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -2,12 +2,13 @@ import os from dotenv import load_dotenv from random import randint -import openai +from openai import OpenAI load_dotenv() client = MongoClient(os.getenv('MONGO_URI')) -openai.api_key = os.getenv('OPENAI_API_KEY') +ai_client = OpenAI() +ai_client.api_key = os.getenv('OPENAI_API_KEY') # Checks if the connection has been made, else make an error printout try: @@ -31,14 +32,14 @@ def get_random_line() -> None: def get_ai_line(category) -> str: try: - response = openai.ChatCompletion.create( + response = ai_client.chat.completions.create( model = os.getenv('OPENAI_MODEL'), messages = - [{"role": "user", "content": f"I need a {category} pick-up line."},] + [{"role": "user", "content": f"I need a {category} pick-up line."}] ) - message = response.choices[0]['message'] - ai_line = "{}".format(message['content']) + ai_message = response.choices[0].message.content + ai_line = "{}".format(ai_message) collection = database['ai_generated'] @@ -53,4 +54,4 @@ def get_ai_line(category) -> str: return ai_line except Exception as err: - print(err) \ No newline at end of file + return str(err) \ No newline at end of file From 541c6d99fe1d0d80e0e80d031f82523250484c15 Mon Sep 17 00:00:00 2001 From: annsts Date: Mon, 6 Nov 2023 16:36:06 -0500 Subject: [PATCH 13/95] upload_line function --- src/data/templates.json | 25 ++++++++++ src/pyrizz/__main__.py | 5 +- src/pyrizz/pyrizz.py | 101 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 src/data/templates.json diff --git a/src/data/templates.json b/src/data/templates.json new file mode 100644 index 0000000..c0b7ee1 --- /dev/null +++ b/src/data/templates.json @@ -0,0 +1,25 @@ +{ + "templates": [ + "Do you have a {}? Because whenever I look at you, everyone else disappears.", + "Are you a {}? Because every time I think of you, I smile.", + "Do you have a map? I keep getting lost in your {}.", + "If beauty were time, you'd be an {}.", + "I'm not a photographer, but I can picture us together in a {}.", + "Can I follow you home? Cause my parents always told me to follow my {}.", + "Is your name Google? Because you have everything I've been searching for in the {}.", + "Are you made of copper and tellurium? Because you're {}.", + "Do you like Star Wars? Because Yoda only one for me in the {}.", + "If you were a {} on a McDonald's menu, you'd be a McGorgeous.", + "Do you have a Band-Aid? Because I just scraped my knee falling for {}.", + "Is it hot in here or is it just the {} we have together?", + "If you were a vegetable, you'd be a {}.", + "I must be a {} because I am attracted to your magnetic field.", + "Is there an airport nearby or is that just my heart taking {}?", + "You must be a magician because whenever I look at you, everyone else {}.", + "If I could rearrange the alphabet, I'd put {} and {} together.", + "Are you a {}? Because you're so fine you blow my mind.", + "Do you have a pencil? Cause I want to erase your past and write our {}.", + "Do you know what my shirt is made of? It's made of boyfriend {}." + ] + } + \ No newline at end of file diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 5886f03..6526a0b 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -27,11 +27,14 @@ def main(): print("Enter your choice: ") user_input = input("> ") - + if user_input == "3": print("Enter a category / language: ") category = input("> ") print("\n" + pyrizz.get_ai_line(category), end = "\n\n") + + if user_input == "5": + pyrizz.add_user_line() elif user_input == "q" or user_input == "Q": break diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index ea8e2f2..4239cc7 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -3,11 +3,14 @@ from dotenv import load_dotenv from random import randint import openai +import pathlib +import json load_dotenv() client = MongoClient(os.getenv('MONGO_URI')) openai.api_key = os.getenv('OPENAI_API_KEY') +PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." # Checks if the connection has been made, else make an error printout try: @@ -49,4 +52,100 @@ def get_ai_line(category) -> str: 'lines': lines }) - return ai_line \ No newline at end of file + return ai_line + +def add_user_line(): + templates_file_path = PROJECT_ROOT + '/src/data/templates.json' + + try: + with open(templates_file_path, 'r', encoding='utf-8') as file: + templates = json.load(file)["templates"] + except json.JSONDecodeError as e: + print(f"Error decoding JSON: {e}") + return + except FileNotFoundError: + print(f"The file {templates_file_path} was not found.") + return + except Exception as e: + print(f"An unexpected error occurred: {e}") + return + + print("Choose a template number (1-20):") + try: + template_number = int(input("> ")) - 1 + if not (0 <= template_number < len(templates)): + print("Template number out of range. Please choose between 1 and 20.") + return + except ValueError: + print("Please enter a valid number.") + return + + template_to_show = templates[template_number] + placeholders_count = template_to_show.count("{}") + placeholder_representation = ['______'] * placeholders_count + print("Fill in the blanks for the following template:") + print(template_to_show.format(*placeholder_representation)) + + print(f"Enter {placeholders_count} word(s) separated by a comma to fill into the template:") + words = input("> ").split(',') + words = [word.strip() for word in words] + + try: + user_line = templates[template_number].format(*words) + except IndexError: + print("Not enough words provided for the placeholders.") + return + except Exception as e: + print(f"An unexpected formatting error occurred: {e}") + return + + if is_line_valid(user_line): + try: + collection = database['user_lines'] + insert_result = collection.insert_one({'line': user_line}) + + if insert_result.inserted_id: + print("Here's your custom pick-up line:") + print(user_line) + print("Line added to the database successfully!") + else: + print("Failed to add line to the database.") + + except Exception as e: + print(f"An error occurred while inserting the line into the database: {e}") + else: + print("Your pick-up line doesn't pass our checks.") + +def is_line_valid(user_line): + if len(user_line) > 140: + print("Your pick-up line is too long.") + return False + + if is_offensive(user_line): + print("Your pick-up line may be offensive.") + return False + + return True + +def is_offensive(text): + try: + response = openai.Completion.create( + model="content-filter-alpha", + prompt="<|endoftext|>"+text+"\n--\nLabel:", + temperature=0, + max_tokens=1 + ) + content_filter_response = response["choices"][0]["text"].strip() + + if content_filter_response in ("2", "1"): + return True + else: + return False + except openai.error.OpenAIError as e: + print(f"OpenAIError occurred: {e}") + return False + except Exception as e: + print(f"An unexpected error occurred when checking for offensive content: {e}") + return False + + From bf41472cd03bb5fe8a8d826e6f3caf7b5c162910 Mon Sep 17 00:00:00 2001 From: zeep Date: Mon, 6 Nov 2023 23:16:37 -0500 Subject: [PATCH 14/95] added one test and fixed function to pass it; currently running on latest version of openai, might have to change acc to team later --- requirements.txt | 3 ++- src/pyrizz/pyrizz.py | 33 ++++++++++++++++++--------------- tests/test_pyrizz.py | 9 ++++++++- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4134913..0c3987d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ pymongo==4.6.0 python-dotenv==0.16.0 -openai==1.0.1 \ No newline at end of file +openai==1.0.1 +pytest==7.4.3 \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 5ec2153..1427cb9 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -32,26 +32,29 @@ def get_random_line() -> None: def get_ai_line(category) -> str: try: - response = ai_client.chat.completions.create( - model = os.getenv('OPENAI_MODEL'), - messages = - [{"role": "user", "content": f"I need a {category} pick-up line."}] - ) + if (category != None): + response = ai_client.chat.completions.create( + model = os.getenv('OPENAI_MODEL'), + messages = + [{"role": "user", "content": f"I need a {category} pick-up line."}] + ) - ai_message = response.choices[0].message.content - ai_line = "{}".format(ai_message) + ai_message = response.choices[0].message.content + ai_line = "{}".format(ai_message) - collection = database['ai_generated'] + collection = database['ai_generated'] - lines = collection.find_one({})["lines"] - - lines.append(ai_line) + lines = collection.find_one({})["lines"] + + lines.append(ai_line) - collection.insert_one({ - 'lines': lines - }) + collection.insert_one({ + 'lines': lines + }) - return ai_line + return ai_line + else: + return "Please specify a category." except Exception as err: return str(err) \ No newline at end of file diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index de7d4e0..cf8c6f7 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -1,4 +1,5 @@ import pytest +from pyrizz import pyrizz class Tests: # An example of a pytest fixture - a function that can be used for setup and teardown before and after test functions are run. @@ -10,4 +11,10 @@ def example_fixture(self): def test_sanity_check(self, example_fixture): expected = True actual = True - assert actual == expected, "Expected True to be equal to True!" \ No newline at end of file + assert actual == expected, "Expected True to be equal to True!" + + def test_get_ai_line_empty(self): + expected = "Please specify a category." + actual = pyrizz.get_ai_line(None) + assert actual == expected, "Expected 'Please specify a category.' to be returned when no category is specified." + \ No newline at end of file From 23d09198942643ad6d76c18c7afdb3a6ab694c1c Mon Sep 17 00:00:00 2001 From: ccczy-czy Date: Tue, 7 Nov 2023 00:25:35 -0500 Subject: [PATCH 15/95] fix toml file --- Pipfile | 3 + Pipfile.lock | 640 ++++++++++++++++++++++++++++++++++++++++--- myproject.toml | 35 --- pyproject.toml | 35 +++ src/pyrizz/pyrizz.py | 3 + 5 files changed, 643 insertions(+), 73 deletions(-) delete mode 100644 myproject.toml create mode 100644 pyproject.toml diff --git a/Pipfile b/Pipfile index 7b214a0..82d7c37 100644 --- a/Pipfile +++ b/Pipfile @@ -6,6 +6,9 @@ name = "pypi" [packages] pytest = "*" pyrizz = {editable = true, path = "."} +pymongo = "*" +python-dotenv = "==0.16.0" +openai = "==0.28.1" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 588d2d9..b5ad20b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "e38cb2ff7dbae6efff334b2b10aebdcddcd9d3949e8b8ceb7d03a8c0f402a693" + "sha256": "f4bb19f4239d45fc262e548b93f4e812962f1af3ee7454a3f0a785e6c3e6fc86" }, "pipfile-spec": 6, "requires": { - "python_version": "3.9" + "python_version": "3" }, "sources": [ { @@ -16,72 +16,636 @@ ] }, "default": { + "aiohttp": { + "hashes": [ + "sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c", + "sha256:01770d8c04bd8db568abb636c1fdd4f7140b284b8b3e0b4584f070180c1e5c62", + "sha256:0912ed87fee967940aacc5306d3aa8ba3a459fcd12add0b407081fbefc931e53", + "sha256:0cccd1de239afa866e4ce5c789b3032442f19c261c7d8a01183fd956b1935349", + "sha256:0fa375b3d34e71ccccf172cab401cd94a72de7a8cc01847a7b3386204093bb47", + "sha256:13da35c9ceb847732bf5c6c5781dcf4780e14392e5d3b3c689f6d22f8e15ae31", + "sha256:14cd52ccf40006c7a6cd34a0f8663734e5363fd981807173faf3a017e202fec9", + "sha256:16d330b3b9db87c3883e565340d292638a878236418b23cc8b9b11a054aaa887", + "sha256:1bed815f3dc3d915c5c1e556c397c8667826fbc1b935d95b0ad680787896a358", + "sha256:1d84166673694841d8953f0a8d0c90e1087739d24632fe86b1a08819168b4566", + "sha256:1f13f60d78224f0dace220d8ab4ef1dbc37115eeeab8c06804fec11bec2bbd07", + "sha256:229852e147f44da0241954fc6cb910ba074e597f06789c867cb7fb0621e0ba7a", + "sha256:253bf92b744b3170eb4c4ca2fa58f9c4b87aeb1df42f71d4e78815e6e8b73c9e", + "sha256:255ba9d6d5ff1a382bb9a578cd563605aa69bec845680e21c44afc2670607a95", + "sha256:2817b2f66ca82ee699acd90e05c95e79bbf1dc986abb62b61ec8aaf851e81c93", + "sha256:2b8d4e166e600dcfbff51919c7a3789ff6ca8b3ecce16e1d9c96d95dd569eb4c", + "sha256:2d5b785c792802e7b275c420d84f3397668e9d49ab1cb52bd916b3b3ffcf09ad", + "sha256:3161ce82ab85acd267c8f4b14aa226047a6bee1e4e6adb74b798bd42c6ae1f80", + "sha256:33164093be11fcef3ce2571a0dccd9041c9a93fa3bde86569d7b03120d276c6f", + "sha256:39a312d0e991690ccc1a61f1e9e42daa519dcc34ad03eb6f826d94c1190190dd", + "sha256:3b2ab182fc28e7a81f6c70bfbd829045d9480063f5ab06f6e601a3eddbbd49a0", + "sha256:3c68330a59506254b556b99a91857428cab98b2f84061260a67865f7f52899f5", + "sha256:3f0e27e5b733803333bb2371249f41cf42bae8884863e8e8965ec69bebe53132", + "sha256:3f5c7ce535a1d2429a634310e308fb7d718905487257060e5d4598e29dc17f0b", + "sha256:3fd194939b1f764d6bb05490987bfe104287bbf51b8d862261ccf66f48fb4096", + "sha256:41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321", + "sha256:41d55fc043954cddbbd82503d9cc3f4814a40bcef30b3569bc7b5e34130718c1", + "sha256:42c89579f82e49db436b69c938ab3e1559e5a4409eb8639eb4143989bc390f2f", + "sha256:45ad816b2c8e3b60b510f30dbd37fe74fd4a772248a52bb021f6fd65dff809b6", + "sha256:4ac39027011414dbd3d87f7edb31680e1f430834c8cef029f11c66dad0670aa5", + "sha256:4d4cbe4ffa9d05f46a28252efc5941e0462792930caa370a6efaf491f412bc66", + "sha256:4fcf3eabd3fd1a5e6092d1242295fa37d0354b2eb2077e6eb670accad78e40e1", + "sha256:5d791245a894be071d5ab04bbb4850534261a7d4fd363b094a7b9963e8cdbd31", + "sha256:6c43ecfef7deaf0617cee936836518e7424ee12cb709883f2c9a1adda63cc460", + "sha256:6c5f938d199a6fdbdc10bbb9447496561c3a9a565b43be564648d81e1102ac22", + "sha256:6e2f9cc8e5328f829f6e1fb74a0a3a939b14e67e80832975e01929e320386b34", + "sha256:713103a8bdde61d13490adf47171a1039fd880113981e55401a0f7b42c37d071", + "sha256:71783b0b6455ac8f34b5ec99d83e686892c50498d5d00b8e56d47f41b38fbe04", + "sha256:76b36b3124f0223903609944a3c8bf28a599b2cc0ce0be60b45211c8e9be97f8", + "sha256:7bc88fc494b1f0311d67f29fee6fd636606f4697e8cc793a2d912ac5b19aa38d", + "sha256:7ee912f7e78287516df155f69da575a0ba33b02dd7c1d6614dbc9463f43066e3", + "sha256:86f20cee0f0a317c76573b627b954c412ea766d6ada1a9fcf1b805763ae7feeb", + "sha256:89341b2c19fb5eac30c341133ae2cc3544d40d9b1892749cdd25892bbc6ac951", + "sha256:8a9b5a0606faca4f6cc0d338359d6fa137104c337f489cd135bb7fbdbccb1e39", + "sha256:8d399dade330c53b4106160f75f55407e9ae7505263ea86f2ccca6bfcbdb4921", + "sha256:8e31e9db1bee8b4f407b77fd2507337a0a80665ad7b6c749d08df595d88f1cf5", + "sha256:90c72ebb7cb3a08a7f40061079817133f502a160561d0675b0a6adf231382c92", + "sha256:918810ef188f84152af6b938254911055a72e0f935b5fbc4c1a4ed0b0584aed1", + "sha256:93c15c8e48e5e7b89d5cb4613479d144fda8344e2d886cf694fd36db4cc86865", + "sha256:96603a562b546632441926cd1293cfcb5b69f0b4159e6077f7c7dbdfb686af4d", + "sha256:99c5ac4ad492b4a19fc132306cd57075c28446ec2ed970973bbf036bcda1bcc6", + "sha256:9c19b26acdd08dd239e0d3669a3dddafd600902e37881f13fbd8a53943079dbc", + "sha256:9de50a199b7710fa2904be5a4a9b51af587ab24c8e540a7243ab737b45844543", + "sha256:9e2ee0ac5a1f5c7dd3197de309adfb99ac4617ff02b0603fd1e65b07dc772e4b", + "sha256:a2ece4af1f3c967a4390c284797ab595a9f1bc1130ef8b01828915a05a6ae684", + "sha256:a3628b6c7b880b181a3ae0a0683698513874df63783fd89de99b7b7539e3e8a8", + "sha256:ad1407db8f2f49329729564f71685557157bfa42b48f4b93e53721a16eb813ed", + "sha256:b04691bc6601ef47c88f0255043df6f570ada1a9ebef99c34bd0b72866c217ae", + "sha256:b0cf2a4501bff9330a8a5248b4ce951851e415bdcce9dc158e76cfd55e15085c", + "sha256:b2fe42e523be344124c6c8ef32a011444e869dc5f883c591ed87f84339de5976", + "sha256:b30e963f9e0d52c28f284d554a9469af073030030cef8693106d918b2ca92f54", + "sha256:bb54c54510e47a8c7c8e63454a6acc817519337b2b78606c4e840871a3e15349", + "sha256:bd111d7fc5591ddf377a408ed9067045259ff2770f37e2d94e6478d0f3fc0c17", + "sha256:bdf70bfe5a1414ba9afb9d49f0c912dc524cf60141102f3a11143ba3d291870f", + "sha256:ca80e1b90a05a4f476547f904992ae81eda5c2c85c66ee4195bb8f9c5fb47f28", + "sha256:caf486ac1e689dda3502567eb89ffe02876546599bbf915ec94b1fa424eeffd4", + "sha256:ccc360e87341ad47c777f5723f68adbb52b37ab450c8bc3ca9ca1f3e849e5fe2", + "sha256:d25036d161c4fe2225d1abff2bd52c34ed0b1099f02c208cd34d8c05729882f0", + "sha256:d52d5dc7c6682b720280f9d9db41d36ebe4791622c842e258c9206232251ab2b", + "sha256:d67f8baed00870aa390ea2590798766256f31dc5ed3ecc737debb6e97e2ede78", + "sha256:d76e8b13161a202d14c9584590c4df4d068c9567c99506497bdd67eaedf36403", + "sha256:d95fc1bf33a9a81469aa760617b5971331cdd74370d1214f0b3109272c0e1e3c", + "sha256:de6a1c9f6803b90e20869e6b99c2c18cef5cc691363954c93cb9adeb26d9f3ae", + "sha256:e1d8cb0b56b3587c5c01de3bf2f600f186da7e7b5f7353d1bf26a8ddca57f965", + "sha256:e2a988a0c673c2e12084f5e6ba3392d76c75ddb8ebc6c7e9ead68248101cd446", + "sha256:e3f1e3f1a1751bb62b4a1b7f4e435afcdade6c17a4fd9b9d43607cebd242924a", + "sha256:e6a00ffcc173e765e200ceefb06399ba09c06db97f401f920513a10c803604ca", + "sha256:e827d48cf802de06d9c935088c2924e3c7e7533377d66b6f31ed175c1620e05e", + "sha256:ebf3fd9f141700b510d4b190094db0ce37ac6361a6806c153c161dc6c041ccda", + "sha256:ec00c3305788e04bf6d29d42e504560e159ccaf0be30c09203b468a6c1ccd3b2", + "sha256:ec4fd86658c6a8964d75426517dc01cbf840bbf32d055ce64a9e63a40fd7b771", + "sha256:efd2fcf7e7b9d7ab16e6b7d54205beded0a9c8566cb30f09c1abe42b4e22bdcb", + "sha256:f0f03211fd14a6a0aed2997d4b1c013d49fb7b50eeb9ffdf5e51f23cfe2c77fa", + "sha256:f628dbf3c91e12f4d6c8b3f092069567d8eb17814aebba3d7d60c149391aee3a", + "sha256:f8ef51e459eb2ad8e7a66c1d6440c808485840ad55ecc3cafefadea47d1b1ba2", + "sha256:fc37e9aef10a696a5a4474802930079ccfc14d9f9c10b4662169671ff034b7df", + "sha256:fdee8405931b0615220e5ddf8cd7edd8592c606a8e4ca2a00704883c396e4479" + ], + "markers": "python_version >= '3.6'", + "version": "==3.8.6" + }, + "aiosignal": { + "hashes": [ + "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc", + "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17" + ], + "markers": "python_version >= '3.7'", + "version": "==1.3.1" + }, + "async-timeout": { + "hashes": [ + "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f", + "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028" + ], + "markers": "python_version >= '3.7'", + "version": "==4.0.3" + }, "attrs": { "hashes": [ - "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6", - "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c" + "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04", + "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015" ], - "markers": "python_version >= '3.5'", - "version": "==22.1.0" + "markers": "python_version >= '3.7'", + "version": "==23.1.0" }, - "pyrizz": { - "editable": true, - "path": "." + "certifi": { + "hashes": [ + "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", + "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" + ], + "markers": "python_version >= '3.6'", + "version": "==2023.7.22" }, - "exceptiongroup": { + "charset-normalizer": { "hashes": [ - "sha256:2ac84b496be68464a2da60da518af3785fff8b7ec0d090a581604bc870bdee41", - "sha256:affbabf13fb6e98988c38d9c5650e701569fe3c1de3233cfb61c5f33774690ad" + "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027", + "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087", + "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786", + "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8", + "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09", + "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185", + "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574", + "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e", + "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519", + "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898", + "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269", + "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3", + "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f", + "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6", + "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8", + "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a", + "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73", + "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc", + "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714", + "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2", + "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc", + "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce", + "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d", + "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e", + "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6", + "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269", + "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96", + "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d", + "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a", + "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4", + "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77", + "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d", + "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0", + "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed", + "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068", + "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac", + "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25", + "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8", + "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab", + "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26", + "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2", + "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db", + "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f", + "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5", + "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99", + "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c", + "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d", + "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811", + "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa", + "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a", + "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03", + "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b", + "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04", + "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c", + "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001", + "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458", + "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389", + "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99", + "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985", + "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537", + "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238", + "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f", + "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d", + "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796", + "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a", + "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143", + "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8", + "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c", + "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5", + "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5", + "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711", + "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4", + "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6", + "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c", + "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7", + "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4", + "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b", + "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae", + "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12", + "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c", + "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae", + "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8", + "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887", + "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b", + "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4", + "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f", + "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5", + "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33", + "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519", + "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561" ], - "markers": "python_version < '3.11'", - "version": "==1.0.0" + "markers": "python_full_version >= '3.7.0'", + "version": "==3.3.2" + }, + "dnspython": { + "hashes": [ + "sha256:57c6fbaaeaaf39c891292012060beb141791735dbb4004798328fc2c467402d8", + "sha256:8dcfae8c7460a2f84b4072e26f1c9f4101ca20c071649cb7c34e8b6a93d58984" + ], + "markers": "python_version >= '3.8' and python_version < '4.0'", + "version": "==2.4.2" + }, + "frozenlist": { + "hashes": [ + "sha256:007df07a6e3eb3e33e9a1fe6a9db7af152bbd8a185f9aaa6ece10a3529e3e1c6", + "sha256:008eb8b31b3ea6896da16c38c1b136cb9fec9e249e77f6211d479db79a4eaf01", + "sha256:09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251", + "sha256:0c7c1b47859ee2cac3846fde1c1dc0f15da6cec5a0e5c72d101e0f83dcb67ff9", + "sha256:0e5c8764c7829343d919cc2dfc587a8db01c4f70a4ebbc49abde5d4b158b007b", + "sha256:10ff5faaa22786315ef57097a279b833ecab1a0bfb07d604c9cbb1c4cdc2ed87", + "sha256:17ae5cd0f333f94f2e03aaf140bb762c64783935cc764ff9c82dff626089bebf", + "sha256:19488c57c12d4e8095a922f328df3f179c820c212940a498623ed39160bc3c2f", + "sha256:1a0848b52815006ea6596c395f87449f693dc419061cc21e970f139d466dc0a0", + "sha256:1e78fb68cf9c1a6aa4a9a12e960a5c9dfbdb89b3695197aa7064705662515de2", + "sha256:261b9f5d17cac914531331ff1b1d452125bf5daa05faf73b71d935485b0c510b", + "sha256:2b8bcf994563466db019fab287ff390fffbfdb4f905fc77bc1c1d604b1c689cc", + "sha256:38461d02d66de17455072c9ba981d35f1d2a73024bee7790ac2f9e361ef1cd0c", + "sha256:490132667476f6781b4c9458298b0c1cddf237488abd228b0b3650e5ecba7467", + "sha256:491e014f5c43656da08958808588cc6c016847b4360e327a62cb308c791bd2d9", + "sha256:515e1abc578dd3b275d6a5114030b1330ba044ffba03f94091842852f806f1c1", + "sha256:556de4430ce324c836789fa4560ca62d1591d2538b8ceb0b4f68fb7b2384a27a", + "sha256:5833593c25ac59ede40ed4de6d67eb42928cca97f26feea219f21d0ed0959b79", + "sha256:6221d84d463fb110bdd7619b69cb43878a11d51cbb9394ae3105d082d5199167", + "sha256:6918d49b1f90821e93069682c06ffde41829c346c66b721e65a5c62b4bab0300", + "sha256:6c38721585f285203e4b4132a352eb3daa19121a035f3182e08e437cface44bf", + "sha256:71932b597f9895f011f47f17d6428252fc728ba2ae6024e13c3398a087c2cdea", + "sha256:7211ef110a9194b6042449431e08c4d80c0481e5891e58d429df5899690511c2", + "sha256:764226ceef3125e53ea2cb275000e309c0aa5464d43bd72abd661e27fffc26ab", + "sha256:7645a8e814a3ee34a89c4a372011dcd817964ce8cb273c8ed6119d706e9613e3", + "sha256:76d4711f6f6d08551a7e9ef28c722f4a50dd0fc204c56b4bcd95c6cc05ce6fbb", + "sha256:7f4f399d28478d1f604c2ff9119907af9726aed73680e5ed1ca634d377abb087", + "sha256:88f7bc0fcca81f985f78dd0fa68d2c75abf8272b1f5c323ea4a01a4d7a614efc", + "sha256:8d0edd6b1c7fb94922bf569c9b092ee187a83f03fb1a63076e7774b60f9481a8", + "sha256:901289d524fdd571be1c7be054f48b1f88ce8dddcbdf1ec698b27d4b8b9e5d62", + "sha256:93ea75c050c5bb3d98016b4ba2497851eadf0ac154d88a67d7a6816206f6fa7f", + "sha256:981b9ab5a0a3178ff413bca62526bb784249421c24ad7381e39d67981be2c326", + "sha256:9ac08e601308e41eb533f232dbf6b7e4cea762f9f84f6357136eed926c15d12c", + "sha256:a02eb8ab2b8f200179b5f62b59757685ae9987996ae549ccf30f983f40602431", + "sha256:a0c6da9aee33ff0b1a451e867da0c1f47408112b3391dd43133838339e410963", + "sha256:a6c8097e01886188e5be3e6b14e94ab365f384736aa1fca6a0b9e35bd4a30bc7", + "sha256:aa384489fefeb62321b238e64c07ef48398fe80f9e1e6afeff22e140e0850eef", + "sha256:ad2a9eb6d9839ae241701d0918f54c51365a51407fd80f6b8289e2dfca977cc3", + "sha256:b206646d176a007466358aa21d85cd8600a415c67c9bd15403336c331a10d956", + "sha256:b826d97e4276750beca7c8f0f1a4938892697a6bcd8ec8217b3312dad6982781", + "sha256:b89ac9768b82205936771f8d2eb3ce88503b1556324c9f903e7156669f521472", + "sha256:bd7bd3b3830247580de99c99ea2a01416dfc3c34471ca1298bccabf86d0ff4dc", + "sha256:bdf1847068c362f16b353163391210269e4f0569a3c166bc6a9f74ccbfc7e839", + "sha256:c11b0746f5d946fecf750428a95f3e9ebe792c1ee3b1e96eeba145dc631a9672", + "sha256:c5374b80521d3d3f2ec5572e05adc94601985cc526fb276d0c8574a6d749f1b3", + "sha256:ca265542ca427bf97aed183c1676e2a9c66942e822b14dc6e5f42e038f92a503", + "sha256:ce31ae3e19f3c902de379cf1323d90c649425b86de7bbdf82871b8a2a0615f3d", + "sha256:ceb6ec0a10c65540421e20ebd29083c50e6d1143278746a4ef6bcf6153171eb8", + "sha256:d081f13b095d74b67d550de04df1c756831f3b83dc9881c38985834387487f1b", + "sha256:d5655a942f5f5d2c9ed93d72148226d75369b4f6952680211972a33e59b1dfdc", + "sha256:d5a32087d720c608f42caed0ef36d2b3ea61a9d09ee59a5142d6070da9041b8f", + "sha256:d6484756b12f40003c6128bfcc3fa9f0d49a687e171186c2d85ec82e3758c559", + "sha256:dd65632acaf0d47608190a71bfe46b209719bf2beb59507db08ccdbe712f969b", + "sha256:de343e75f40e972bae1ef6090267f8260c1446a1695e77096db6cfa25e759a95", + "sha256:e29cda763f752553fa14c68fb2195150bfab22b352572cb36c43c47bedba70eb", + "sha256:e41f3de4df3e80de75845d3e743b3f1c4c8613c3997a912dbf0229fc61a8b963", + "sha256:e66d2a64d44d50d2543405fb183a21f76b3b5fd16f130f5c99187c3fb4e64919", + "sha256:e74b0506fa5aa5598ac6a975a12aa8928cbb58e1f5ac8360792ef15de1aa848f", + "sha256:f0ed05f5079c708fe74bf9027e95125334b6978bf07fd5ab923e9e55e5fbb9d3", + "sha256:f61e2dc5ad442c52b4887f1fdc112f97caeff4d9e6ebe78879364ac59f1663e1", + "sha256:fec520865f42e5c7f050c2a79038897b1c7d1595e907a9e08e3353293ffc948e" + ], + "markers": "python_version >= '3.8'", + "version": "==1.4.0" + }, + "idna": { + "hashes": [ + "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", + "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" + ], + "markers": "python_version >= '3.5'", + "version": "==3.4" }, "iniconfig": { "hashes": [ - "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", - "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32" + "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", + "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374" ], - "version": "==1.1.1" + "markers": "python_version >= '3.7'", + "version": "==2.0.0" + }, + "multidict": { + "hashes": [ + "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9", + "sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8", + "sha256:0dfad7a5a1e39c53ed00d2dd0c2e36aed4650936dc18fd9a1826a5ae1cad6f03", + "sha256:11bdf3f5e1518b24530b8241529d2050014c884cf18b6fc69c0c2b30ca248710", + "sha256:1502e24330eb681bdaa3eb70d6358e818e8e8f908a22a1851dfd4e15bc2f8161", + "sha256:16ab77bbeb596e14212e7bab8429f24c1579234a3a462105cda4a66904998664", + "sha256:16d232d4e5396c2efbbf4f6d4df89bfa905eb0d4dc5b3549d872ab898451f569", + "sha256:21a12c4eb6ddc9952c415f24eef97e3e55ba3af61f67c7bc388dcdec1404a067", + "sha256:27c523fbfbdfd19c6867af7346332b62b586eed663887392cff78d614f9ec313", + "sha256:281af09f488903fde97923c7744bb001a9b23b039a909460d0f14edc7bf59706", + "sha256:33029f5734336aa0d4c0384525da0387ef89148dc7191aae00ca5fb23d7aafc2", + "sha256:3601a3cece3819534b11d4efc1eb76047488fddd0c85a3948099d5da4d504636", + "sha256:3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49", + "sha256:36c63aaa167f6c6b04ef2c85704e93af16c11d20de1d133e39de6a0e84582a93", + "sha256:39ff62e7d0f26c248b15e364517a72932a611a9b75f35b45be078d81bdb86603", + "sha256:43644e38f42e3af682690876cff722d301ac585c5b9e1eacc013b7a3f7b696a0", + "sha256:4372381634485bec7e46718edc71528024fcdc6f835baefe517b34a33c731d60", + "sha256:458f37be2d9e4c95e2d8866a851663cbc76e865b78395090786f6cd9b3bbf4f4", + "sha256:45e1ecb0379bfaab5eef059f50115b54571acfbe422a14f668fc8c27ba410e7e", + "sha256:4b9d9e4e2b37daddb5c23ea33a3417901fa7c7b3dee2d855f63ee67a0b21e5b1", + "sha256:4ceef517eca3e03c1cceb22030a3e39cb399ac86bff4e426d4fc6ae49052cc60", + "sha256:4d1a3d7ef5e96b1c9e92f973e43aa5e5b96c659c9bc3124acbbd81b0b9c8a951", + "sha256:4dcbb0906e38440fa3e325df2359ac6cb043df8e58c965bb45f4e406ecb162cc", + "sha256:509eac6cf09c794aa27bcacfd4d62c885cce62bef7b2c3e8b2e49d365b5003fe", + "sha256:52509b5be062d9eafc8170e53026fbc54cf3b32759a23d07fd935fb04fc22d95", + "sha256:52f2dffc8acaba9a2f27174c41c9e57f60b907bb9f096b36b1a1f3be71c6284d", + "sha256:574b7eae1ab267e5f8285f0fe881f17efe4b98c39a40858247720935b893bba8", + "sha256:5979b5632c3e3534e42ca6ff856bb24b2e3071b37861c2c727ce220d80eee9ed", + "sha256:59d43b61c59d82f2effb39a93c48b845efe23a3852d201ed2d24ba830d0b4cf2", + "sha256:5a4dcf02b908c3b8b17a45fb0f15b695bf117a67b76b7ad18b73cf8e92608775", + "sha256:5cad9430ab3e2e4fa4a2ef4450f548768400a2ac635841bc2a56a2052cdbeb87", + "sha256:5fc1b16f586f049820c5c5b17bb4ee7583092fa0d1c4e28b5239181ff9532e0c", + "sha256:62501642008a8b9871ddfccbf83e4222cf8ac0d5aeedf73da36153ef2ec222d2", + "sha256:64bdf1086b6043bf519869678f5f2757f473dee970d7abf6da91ec00acb9cb98", + "sha256:64da238a09d6039e3bd39bb3aee9c21a5e34f28bfa5aa22518581f910ff94af3", + "sha256:666daae833559deb2d609afa4490b85830ab0dfca811a98b70a205621a6109fe", + "sha256:67040058f37a2a51ed8ea8f6b0e6ee5bd78ca67f169ce6122f3e2ec80dfe9b78", + "sha256:6748717bb10339c4760c1e63da040f5f29f5ed6e59d76daee30305894069a660", + "sha256:6b181d8c23da913d4ff585afd1155a0e1194c0b50c54fcfe286f70cdaf2b7176", + "sha256:6ed5f161328b7df384d71b07317f4d8656434e34591f20552c7bcef27b0ab88e", + "sha256:7582a1d1030e15422262de9f58711774e02fa80df0d1578995c76214f6954988", + "sha256:7d18748f2d30f94f498e852c67d61261c643b349b9d2a581131725595c45ec6c", + "sha256:7d6ae9d593ef8641544d6263c7fa6408cc90370c8cb2bbb65f8d43e5b0351d9c", + "sha256:81a4f0b34bd92df3da93315c6a59034df95866014ac08535fc819f043bfd51f0", + "sha256:8316a77808c501004802f9beebde51c9f857054a0c871bd6da8280e718444449", + "sha256:853888594621e6604c978ce2a0444a1e6e70c8d253ab65ba11657659dcc9100f", + "sha256:99b76c052e9f1bc0721f7541e5e8c05db3941eb9ebe7b8553c625ef88d6eefde", + "sha256:a2e4369eb3d47d2034032a26c7a80fcb21a2cb22e1173d761a162f11e562caa5", + "sha256:ab55edc2e84460694295f401215f4a58597f8f7c9466faec545093045476327d", + "sha256:af048912e045a2dc732847d33821a9d84ba553f5c5f028adbd364dd4765092ac", + "sha256:b1a2eeedcead3a41694130495593a559a668f382eee0727352b9a41e1c45759a", + "sha256:b1e8b901e607795ec06c9e42530788c45ac21ef3aaa11dbd0c69de543bfb79a9", + "sha256:b41156839806aecb3641f3208c0dafd3ac7775b9c4c422d82ee2a45c34ba81ca", + "sha256:b692f419760c0e65d060959df05f2a531945af31fda0c8a3b3195d4efd06de11", + "sha256:bc779e9e6f7fda81b3f9aa58e3a6091d49ad528b11ed19f6621408806204ad35", + "sha256:bf6774e60d67a9efe02b3616fee22441d86fab4c6d335f9d2051d19d90a40063", + "sha256:c048099e4c9e9d615545e2001d3d8a4380bd403e1a0578734e0d31703d1b0c0b", + "sha256:c5cb09abb18c1ea940fb99360ea0396f34d46566f157122c92dfa069d3e0e982", + "sha256:cc8e1d0c705233c5dd0c5e6460fbad7827d5d36f310a0fadfd45cc3029762258", + "sha256:d5e3fc56f88cc98ef8139255cf8cd63eb2c586531e43310ff859d6bb3a6b51f1", + "sha256:d6aa0418fcc838522256761b3415822626f866758ee0bc6632c9486b179d0b52", + "sha256:d6c254ba6e45d8e72739281ebc46ea5eb5f101234f3ce171f0e9f5cc86991480", + "sha256:d6d635d5209b82a3492508cf5b365f3446afb65ae7ebd755e70e18f287b0adf7", + "sha256:dcfe792765fab89c365123c81046ad4103fcabbc4f56d1c1997e6715e8015461", + "sha256:ddd3915998d93fbcd2566ddf9cf62cdb35c9e093075f862935573d265cf8f65d", + "sha256:ddff9c4e225a63a5afab9dd15590432c22e8057e1a9a13d28ed128ecf047bbdc", + "sha256:e41b7e2b59679edfa309e8db64fdf22399eec4b0b24694e1b2104fb789207779", + "sha256:e69924bfcdda39b722ef4d9aa762b2dd38e4632b3641b1d9a57ca9cd18f2f83a", + "sha256:ea20853c6dbbb53ed34cb4d080382169b6f4554d394015f1bef35e881bf83547", + "sha256:ee2a1ece51b9b9e7752e742cfb661d2a29e7bcdba2d27e66e28a99f1890e4fa0", + "sha256:eeb6dcc05e911516ae3d1f207d4b0520d07f54484c49dfc294d6e7d63b734171", + "sha256:f70b98cd94886b49d91170ef23ec5c0e8ebb6f242d734ed7ed677b24d50c82cf", + "sha256:fc35cb4676846ef752816d5be2193a1e8367b4c1397b74a565a9d0389c433a1d", + "sha256:ff959bee35038c4624250473988b24f846cbeb2c6639de3602c073f10410ceba" + ], + "markers": "python_version >= '3.7'", + "version": "==6.0.4" + }, + "openai": { + "hashes": [ + "sha256:4be1dad329a65b4ce1a660fe6d5431b438f429b5855c883435f0f7fcb6d2dcc8", + "sha256:d18690f9e3d31eedb66b57b88c2165d760b24ea0a01f150dd3f068155088ce68" + ], + "index": "pypi", + "markers": "python_full_version >= '3.7.1'", + "version": "==0.28.1" }, "packaging": { "hashes": [ - "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", - "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" + "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", + "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" ], - "markers": "python_version >= '3.6'", - "version": "==21.3" + "markers": "python_version >= '3.7'", + "version": "==23.2" }, "pluggy": { "hashes": [ - "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", - "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" + "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12", + "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7" ], - "markers": "python_version >= '3.6'", - "version": "==1.0.0" + "markers": "python_version >= '3.8'", + "version": "==1.3.0" }, - "pyparsing": { + "pymongo": { "hashes": [ - "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", - "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc" + "sha256:014e7049dd019a6663747ca7dae328943e14f7261f7c1381045dfc26a04fa330", + "sha256:055f5c266e2767a88bb585d01137d9c7f778b0195d3dbf4a487ef0638be9b651", + "sha256:05c30fd35cc97f14f354916b45feea535d59060ef867446b5c3c7f9b609dd5dc", + "sha256:0634994b026336195778e5693583c060418d4ab453eff21530422690a97e1ee8", + "sha256:09c7de516b08c57647176b9fc21d929d628e35bcebc7422220c89ae40b62126a", + "sha256:107a234dc55affc5802acb3b6d83cbb8c87355b38a9457fcd8806bdeb8bce161", + "sha256:10a379fb60f1b2406ae57b8899bacfe20567918c8e9d2d545e1b93628fcf2050", + "sha256:128b1485753106c54af481789cdfea12b90a228afca0b11fb3828309a907e10e", + "sha256:1394c4737b325166a65ae7c145af1ebdb9fb153ebedd37cf91d676313e4a67b8", + "sha256:1c63e3a2e8fb815c4b1f738c284a4579897e37c3cfd95fdb199229a1ccfb638a", + "sha256:1e4ed21029d80c4f62605ab16398fe1ce093fff4b5f22d114055e7d9fbc4adb0", + "sha256:1ec71ac633b126c0775ed4604ca8f56c3540f5c21a1220639f299e7a544b55f9", + "sha256:21812453354b151200034750cd30b0140e82ec2a01fd4357390f67714a1bfbde", + "sha256:256c503a75bd71cf7fb9ebf889e7e222d49c6036a48aad5a619f98a0adf0e0d7", + "sha256:2703a9f8f5767986b4f51c259ff452cc837c5a83c8ed5f5361f6e49933743b2f", + "sha256:288c21ab9531b037f7efa4e467b33176bc73a0c27223c141b822ab4a0e66ff2a", + "sha256:2972dd1f1285866aba027eff2f4a2bbf8aa98563c2ced14cb34ee5602b36afdf", + "sha256:2973f113e079fb98515722cd728e1820282721ec9fd52830e4b73cabdbf1eb28", + "sha256:2ca0ba501898b2ec31e6c3acf90c31910944f01d454ad8e489213a156ccf1bda", + "sha256:2d2be5c9c3488fa8a70f83ed925940f488eac2837a996708d98a0e54a861f212", + "sha256:2f8c04277d879146eacda920476e93d520eff8bec6c022ac108cfa6280d84348", + "sha256:325701ae7b56daa5b0692305b7cb505ca50f80a1288abb32ff420a8a209b01ca", + "sha256:3729b8db02063da50eeb3db88a27670d85953afb9a7f14c213ac9e3dca93034b", + "sha256:3919708594b86d0f5cdc713eb6fccd3f9b9532af09ea7a5d843c933825ef56c4", + "sha256:39a1cd5d383b37285641d5a7a86be85274466ae336a61b51117155936529f9b3", + "sha256:3ec6c20385c5a58e16b1ea60c5e4993ea060540671d7d12664f385f2fb32fe79", + "sha256:47aa128be2e66abd9d1a9b0437c62499d812d291f17b55185cb4aa33a5f710a4", + "sha256:49f2af6cf82509b15093ce3569229e0d53c90ad8ae2eef940652d4cf1f81e045", + "sha256:4a0269811661ba93c472c8a60ea82640e838c2eb148d252720a09b5123f2c2fe", + "sha256:518c90bdd6e842c446d01a766b9136fec5ec6cc94f3b8c3f8b4a332786ee6b64", + "sha256:5717a308a703dda2886a5796a07489c698b442f5e409cf7dc2ac93de8d61d764", + "sha256:5802acc012bbb4bce4dff92973dff76482f30ef35dd4cb8ab5b0e06aa8f08c80", + "sha256:5e63146dbdb1eac207464f6e0cfcdb640c9c5ff0f57b754fa96fe252314a1dc6", + "sha256:6695d7136a435c1305b261a9ddb9b3ecec9863e05aab3935b96038145fd3a977", + "sha256:680fa0fc719e1a3dcb81130858368f51d83667d431924d0bcf249644bce8f303", + "sha256:6b18276f14b4b6d92e707ab6db19b938e112bd2f1dc3f9f1a628df58e4fd3f0d", + "sha256:6bafea6061d63059d8bc2ffc545e2f049221c8a4457d236c5cd6a66678673eab", + "sha256:6d6a1b1361f118e7fefa17ae3114e77f10ee1b228b20d50c47c9f351346180c8", + "sha256:747c84f4e690fbe6999c90ac97246c95d31460d890510e4a3fa61b7d2b87aa34", + "sha256:79f41576b3022c2fe9780ae3e44202b2438128a25284a8ddfa038f0785d87019", + "sha256:7b0e6361754ac596cd16bfc6ed49f69ffcd9b60b7bc4bcd3ea65c6a83475e4ff", + "sha256:7e3b0127b260d4abae7b62203c4c7ef0874c901b55155692353db19de4b18bc4", + "sha256:7fc2bb8a74dcfcdd32f89528e38dcbf70a3a6594963d60dc9595e3b35b66e414", + "sha256:806e094e9e85d8badc978af8c95b69c556077f11844655cb8cd2d1758769e521", + "sha256:81dd1308bd5630d2bb5980f00aa163b986b133f1e9ed66c66ce2a5bc3572e891", + "sha256:82e620842e12e8cb4050d2643a81c8149361cd82c0a920fa5a15dc4ca8a4000f", + "sha256:85f2cdc400ee87f5952ebf2a117488f2525a3fb2e23863a8efe3e4ee9e54e4d1", + "sha256:8ab6bcc8e424e07c1d4ba6df96f7fb963bcb48f590b9456de9ebd03b88084fe8", + "sha256:8adf014f2779992eba3b513e060d06f075f0ab2fb3ad956f413a102312f65cdf", + "sha256:9b0f98481ad5dc4cb430a60bbb8869f05505283b9ae1c62bdb65eb5e020ee8e3", + "sha256:9bea9138b0fc6e2218147e9c6ce1ff76ff8e29dc00bb1b64842bd1ca107aee9f", + "sha256:a09bfb51953930e7e838972ddf646c5d5f984992a66d79da6ba7f6a8d8a890cd", + "sha256:a0be99b599da95b7a90a918dd927b20c434bea5e1c9b3efc6a3c6cd67c23f813", + "sha256:a49aca4d961823b2846b739380c847e8964ff7ae0f0a683992b9d926054f0d6d", + "sha256:a4dc1319d0c162919ee7f4ee6face076becae2abbd351cc14f1fe70af5fb20d9", + "sha256:a8273e1abbcff1d7d29cbbb1ea7e57d38be72f1af3c597c854168508b91516c2", + "sha256:a8f7f9feecae53fa18d6a3ea7c75f9e9a1d4d20e5c3f9ce3fba83f07bcc4eee2", + "sha256:ad4f66fbb893b55f96f03020e67dcab49ffde0177c6565ccf9dec4fdf974eb61", + "sha256:af425f323fce1b07755edd783581e7283557296946212f5b1a934441718e7528", + "sha256:b14dd73f595199f4275bed4fb509277470d9b9059310537e3b3daba12b30c157", + "sha256:b4ad70d7cac4ca0c7b31444a0148bd3af01a2662fa12b1ad6f57cd4a04e21766", + "sha256:b80a4ee19b3442c57c38afa978adca546521a8822d663310b63ae2a7d7b13f3a", + "sha256:ba51129fcc510824b6ca6e2ce1c27e3e4d048b6e35d3ae6f7e517bed1b8b25ce", + "sha256:c011bd5ad03cc096f99ffcfdd18a1817354132c1331bed7a837a25226659845f", + "sha256:cc94f9fea17a5af8cf1a343597711a26b0117c0b812550d99934acb89d526ed2", + "sha256:ccd785fafa1c931deff6a7116e9a0d402d59fabe51644b0d0c268295ff847b25", + "sha256:d16a534da0e39785687b7295e2fcf9a339f4a20689024983d11afaa4657f8507", + "sha256:d3077a31633beef77d057c6523f5de7271ddef7bde5e019285b00c0cc9cac1e3", + "sha256:d603edea1ff7408638b2504905c032193b7dcee7af269802dbb35bc8c3310ed5", + "sha256:db082f728160369d9a6ed2e722438291558fc15ce06d0a7d696a8dad735c236b", + "sha256:ddef295aaf80cefb0c1606f1995899efcb17edc6b327eb6589e234e614b87756", + "sha256:e16ade71c93f6814d095d25cd6d28a90d63511ea396bd96e9ffcb886b278baaa", + "sha256:e3db7d833a7c38c317dc95b54e27f1d27012e031b45a7c24e360b53197d5f6e7", + "sha256:e5e193f89f4f8c1fe273f9a6e6df915092c9f2af6db2d1afb8bd53855025c11f", + "sha256:eb438a8bf6b695bf50d57e6a059ff09652a07968b2041178b3744ea785fcef9b", + "sha256:ebf02c32afa6b67e5861a27183dd98ed88419a94a2ab843cc145fb0bafcc5b28", + "sha256:ecd9e1fa97aa11bf67472220285775fa15e896da108f425e55d23d7540a712ce", + "sha256:ef67fedd863ffffd4adfd46d9d992b0f929c7f61a8307366d664d93517f2c78e", + "sha256:f28ae33dc5a0b9cee06e95fd420e42155d83271ab75964baf747ce959cac5f52", + "sha256:fb1c56d891f9e34303c451998ef62ba52659648bb0d75b03c5e4ac223a3342c2", + "sha256:fe03bf25fae4b95d8afe40004a321df644400fdcba4c8e5e1a19c1085b740888" ], - "markers": "python_full_version >= '3.6.8'", - "version": "==3.0.9" + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==4.6.0" + }, + "pyrizz": { + "editable": true, + "path": "." }, "pytest": { "hashes": [ - "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71", - "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59" + "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac", + "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5" ], "index": "pypi", - "version": "==7.2.0" + "markers": "python_version >= '3.7'", + "version": "==7.4.3" + }, + "python-dotenv": { + "hashes": [ + "sha256:31d752f5b748f4e292448c9a0cac6a08ed5e6f4cefab85044462dcad56905cec", + "sha256:9fa413c37d4652d3fa02fea0ff465c384f5db75eab259c4fc5d0c5b8bf20edd4" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==0.16.0" + }, + "requests": { + "hashes": [ + "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", + "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" + ], + "markers": "python_version >= '3.7'", + "version": "==2.31.0" + }, + "tqdm": { + "hashes": [ + "sha256:d302b3c5b53d47bce91fea46679d9c3c6508cf6332229aa1e7d8653723793386", + "sha256:d88e651f9db8d8551a62556d3cff9e3034274ca5d66e93197cf2490e2dcb69c7" + ], + "markers": "python_version >= '3.7'", + "version": "==4.66.1" + }, + "urllib3": { + "hashes": [ + "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84", + "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e" + ], + "markers": "python_version >= '3.7'", + "version": "==2.0.7" }, - "tomli": { + "yarl": { "hashes": [ - "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" + "sha256:04ab9d4b9f587c06d801c2abfe9317b77cdf996c65a90d5e84ecc45010823571", + "sha256:066c163aec9d3d073dc9ffe5dd3ad05069bcb03fcaab8d221290ba99f9f69ee3", + "sha256:13414591ff516e04fcdee8dc051c13fd3db13b673c7a4cb1350e6b2ad9639ad3", + "sha256:149ddea5abf329752ea5051b61bd6c1d979e13fbf122d3a1f9f0c8be6cb6f63c", + "sha256:159d81f22d7a43e6eabc36d7194cb53f2f15f498dbbfa8edc8a3239350f59fe7", + "sha256:1b1bba902cba32cdec51fca038fd53f8beee88b77efc373968d1ed021024cc04", + "sha256:22a94666751778629f1ec4280b08eb11815783c63f52092a5953faf73be24191", + "sha256:2a96c19c52ff442a808c105901d0bdfd2e28575b3d5f82e2f5fd67e20dc5f4ea", + "sha256:2b0738fb871812722a0ac2154be1f049c6223b9f6f22eec352996b69775b36d4", + "sha256:2c315df3293cd521033533d242d15eab26583360b58f7ee5d9565f15fee1bef4", + "sha256:32f1d071b3f362c80f1a7d322bfd7b2d11e33d2adf395cc1dd4df36c9c243095", + "sha256:3458a24e4ea3fd8930e934c129b676c27452e4ebda80fbe47b56d8c6c7a63a9e", + "sha256:38a3928ae37558bc1b559f67410df446d1fbfa87318b124bf5032c31e3447b74", + "sha256:3da8a678ca8b96c8606bbb8bfacd99a12ad5dd288bc6f7979baddd62f71c63ef", + "sha256:494053246b119b041960ddcd20fd76224149cfea8ed8777b687358727911dd33", + "sha256:50f33040f3836e912ed16d212f6cc1efb3231a8a60526a407aeb66c1c1956dde", + "sha256:52a25809fcbecfc63ac9ba0c0fb586f90837f5425edfd1ec9f3372b119585e45", + "sha256:53338749febd28935d55b41bf0bcc79d634881195a39f6b2f767870b72514caf", + "sha256:5415d5a4b080dc9612b1b63cba008db84e908b95848369aa1da3686ae27b6d2b", + "sha256:5610f80cf43b6202e2c33ba3ec2ee0a2884f8f423c8f4f62906731d876ef4fac", + "sha256:566185e8ebc0898b11f8026447eacd02e46226716229cea8db37496c8cdd26e0", + "sha256:56ff08ab5df8429901ebdc5d15941b59f6253393cb5da07b4170beefcf1b2528", + "sha256:59723a029760079b7d991a401386390c4be5bfec1e7dd83e25a6a0881859e716", + "sha256:5fcd436ea16fee7d4207c045b1e340020e58a2597301cfbcfdbe5abd2356c2fb", + "sha256:61016e7d582bc46a5378ffdd02cd0314fb8ba52f40f9cf4d9a5e7dbef88dee18", + "sha256:63c48f6cef34e6319a74c727376e95626f84ea091f92c0250a98e53e62c77c72", + "sha256:646d663eb2232d7909e6601f1a9107e66f9791f290a1b3dc7057818fe44fc2b6", + "sha256:662e6016409828ee910f5d9602a2729a8a57d74b163c89a837de3fea050c7582", + "sha256:674ca19cbee4a82c9f54e0d1eee28116e63bc6fd1e96c43031d11cbab8b2afd5", + "sha256:6a5883464143ab3ae9ba68daae8e7c5c95b969462bbe42e2464d60e7e2698368", + "sha256:6e7221580dc1db478464cfeef9b03b95c5852cc22894e418562997df0d074ccc", + "sha256:75df5ef94c3fdc393c6b19d80e6ef1ecc9ae2f4263c09cacb178d871c02a5ba9", + "sha256:783185c75c12a017cc345015ea359cc801c3b29a2966c2655cd12b233bf5a2be", + "sha256:822b30a0f22e588b32d3120f6d41e4ed021806418b4c9f0bc3048b8c8cb3f92a", + "sha256:8288d7cd28f8119b07dd49b7230d6b4562f9b61ee9a4ab02221060d21136be80", + "sha256:82aa6264b36c50acfb2424ad5ca537a2060ab6de158a5bd2a72a032cc75b9eb8", + "sha256:832b7e711027c114d79dffb92576acd1bd2decc467dec60e1cac96912602d0e6", + "sha256:838162460b3a08987546e881a2bfa573960bb559dfa739e7800ceeec92e64417", + "sha256:83fcc480d7549ccebe9415d96d9263e2d4226798c37ebd18c930fce43dfb9574", + "sha256:84e0b1599334b1e1478db01b756e55937d4614f8654311eb26012091be109d59", + "sha256:891c0e3ec5ec881541f6c5113d8df0315ce5440e244a716b95f2525b7b9f3608", + "sha256:8c2ad583743d16ddbdf6bb14b5cd76bf43b0d0006e918809d5d4ddf7bde8dd82", + "sha256:8c56986609b057b4839968ba901944af91b8e92f1725d1a2d77cbac6972b9ed1", + "sha256:8ea48e0a2f931064469bdabca50c2f578b565fc446f302a79ba6cc0ee7f384d3", + "sha256:8ec53a0ea2a80c5cd1ab397925f94bff59222aa3cf9c6da938ce05c9ec20428d", + "sha256:95d2ecefbcf4e744ea952d073c6922e72ee650ffc79028eb1e320e732898d7e8", + "sha256:9b3152f2f5677b997ae6c804b73da05a39daa6a9e85a512e0e6823d81cdad7cc", + "sha256:9bf345c3a4f5ba7f766430f97f9cc1320786f19584acc7086491f45524a551ac", + "sha256:a60347f234c2212a9f0361955007fcf4033a75bf600a33c88a0a8e91af77c0e8", + "sha256:a74dcbfe780e62f4b5a062714576f16c2f3493a0394e555ab141bf0d746bb955", + "sha256:a83503934c6273806aed765035716216cc9ab4e0364f7f066227e1aaea90b8d0", + "sha256:ac9bb4c5ce3975aeac288cfcb5061ce60e0d14d92209e780c93954076c7c4367", + "sha256:aff634b15beff8902d1f918012fc2a42e0dbae6f469fce134c8a0dc51ca423bb", + "sha256:b03917871bf859a81ccb180c9a2e6c1e04d2f6a51d953e6a5cdd70c93d4e5a2a", + "sha256:b124e2a6d223b65ba8768d5706d103280914d61f5cae3afbc50fc3dfcc016623", + "sha256:b25322201585c69abc7b0e89e72790469f7dad90d26754717f3310bfe30331c2", + "sha256:b7232f8dfbd225d57340e441d8caf8652a6acd06b389ea2d3222b8bc89cbfca6", + "sha256:b8cc1863402472f16c600e3e93d542b7e7542a540f95c30afd472e8e549fc3f7", + "sha256:b9a4e67ad7b646cd6f0938c7ebfd60e481b7410f574c560e455e938d2da8e0f4", + "sha256:be6b3fdec5c62f2a67cb3f8c6dbf56bbf3f61c0f046f84645cd1ca73532ea051", + "sha256:bf74d08542c3a9ea97bb8f343d4fcbd4d8f91bba5ec9d5d7f792dbe727f88938", + "sha256:c027a6e96ef77d401d8d5a5c8d6bc478e8042f1e448272e8d9752cb0aff8b5c8", + "sha256:c0c77533b5ed4bcc38e943178ccae29b9bcf48ffd1063f5821192f23a1bd27b9", + "sha256:c1012fa63eb6c032f3ce5d2171c267992ae0c00b9e164efe4d73db818465fac3", + "sha256:c3a53ba34a636a256d767c086ceb111358876e1fb6b50dfc4d3f4951d40133d5", + "sha256:d4e2c6d555e77b37288eaf45b8f60f0737c9efa3452c6c44626a5455aeb250b9", + "sha256:de119f56f3c5f0e2fb4dee508531a32b069a5f2c6e827b272d1e0ff5ac040333", + "sha256:e65610c5792870d45d7b68c677681376fcf9cc1c289f23e8e8b39c1485384185", + "sha256:e9fdc7ac0d42bc3ea78818557fab03af6181e076a2944f43c38684b4b6bed8e3", + "sha256:ee4afac41415d52d53a9833ebae7e32b344be72835bbb589018c9e938045a560", + "sha256:f364d3480bffd3aa566e886587eaca7c8c04d74f6e8933f3f2c996b7f09bee1b", + "sha256:f3b078dbe227f79be488ffcfc7a9edb3409d018e0952cf13f15fd6512847f3f7", + "sha256:f4e2d08f07a3d7d3e12549052eb5ad3eab1c349c53ac51c209a0e5991bbada78", + "sha256:f7a3d8146575e08c29ed1cd287068e6d02f1c7bdff8970db96683b9591b86ee7" ], - "markers": "python_version < '3.11'", - "version": "==2.0.1" + "markers": "python_version >= '3.7'", + "version": "==1.9.2" } }, "develop": {} diff --git a/myproject.toml b/myproject.toml deleted file mode 100644 index 4707f56..0000000 --- a/myproject.toml +++ /dev/null @@ -1,35 +0,0 @@ -[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 one at a time." -version = "0.0.1" -authors = [ - { name="Aditya Pandhare", email="adityapandhare44@gmail.com", - name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com", - name="Baani Pasrija", email="baanipasrija25@gmail.com", - name="Zander Chen", email="ccczy2002@gmail.com", - }, -] -license = { file = "LICENSE" } -readme = "README.md" -keywords = ["python", "package", "build", "tutorial"] -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/awesomeadi00/Python_Package_Example" -"Repository" = "https://github.com/awesomeadi00/Python_Package_Example.git" - -[project.scripts] -pyrizz = "pyrizz.__main__:main" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8a4686a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,35 @@ +[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 one at a time." +version = "0.0.1" +authors = [ + { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, + { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, + { name="Baani Pasrija", email="baanipasrija25@gmail.com" }, + { name="Zander Chen", email="ccczy2002@gmail.com" } +] +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" diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index ea8e2f2..29189e8 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -29,6 +29,9 @@ def get_random_line() -> None: print(line) +def get_random_categorized_line() -> None: + print("testing") + def get_ai_line(category) -> str: response = openai.ChatCompletion.create( model = os.getenv('OPENAI_MODEL'), From ddd10a303a56798ebd39497d6ba4b945e9e8f52d Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 01:07:09 -0500 Subject: [PATCH 16/95] wrote tests for get_ai_line + updated pipfile + updated mongo seed script --- Pipfile | 6 +- Pipfile.lock | 635 +++++++++++++++++++++++++++++++++++--- requirements.txt | 2 +- src/pyrizz/__main__.py | 2 +- src/pyrizz/pyrizz.py | 22 +- src/scripts/mongo-seed.py | 4 +- tests/test_pyrizz.py | 19 +- 7 files changed, 636 insertions(+), 54 deletions(-) diff --git a/Pipfile b/Pipfile index 7b214a0..7f24c5d 100644 --- a/Pipfile +++ b/Pipfile @@ -4,8 +4,10 @@ verify_ssl = true name = "pypi" [packages] -pytest = "*" -pyrizz = {editable = true, path = "."} +pytest = "==7.4.3" +pymongo = "==4.6.0" +python-dotenv = "==0.16.0" +openai = "==0.28.1" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 588d2d9..70e1a60 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "e38cb2ff7dbae6efff334b2b10aebdcddcd9d3949e8b8ceb7d03a8c0f402a693" + "sha256": "d7c23440754bfa269f2840d46bb87f1c6479be2adb0edd314ce80156b7a760f5" }, "pipfile-spec": 6, "requires": { - "python_version": "3.9" + "python_version": "3" }, "sources": [ { @@ -16,72 +16,631 @@ ] }, "default": { + "aiohttp": { + "hashes": [ + "sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c", + "sha256:01770d8c04bd8db568abb636c1fdd4f7140b284b8b3e0b4584f070180c1e5c62", + "sha256:0912ed87fee967940aacc5306d3aa8ba3a459fcd12add0b407081fbefc931e53", + "sha256:0cccd1de239afa866e4ce5c789b3032442f19c261c7d8a01183fd956b1935349", + "sha256:0fa375b3d34e71ccccf172cab401cd94a72de7a8cc01847a7b3386204093bb47", + "sha256:13da35c9ceb847732bf5c6c5781dcf4780e14392e5d3b3c689f6d22f8e15ae31", + "sha256:14cd52ccf40006c7a6cd34a0f8663734e5363fd981807173faf3a017e202fec9", + "sha256:16d330b3b9db87c3883e565340d292638a878236418b23cc8b9b11a054aaa887", + "sha256:1bed815f3dc3d915c5c1e556c397c8667826fbc1b935d95b0ad680787896a358", + "sha256:1d84166673694841d8953f0a8d0c90e1087739d24632fe86b1a08819168b4566", + "sha256:1f13f60d78224f0dace220d8ab4ef1dbc37115eeeab8c06804fec11bec2bbd07", + "sha256:229852e147f44da0241954fc6cb910ba074e597f06789c867cb7fb0621e0ba7a", + "sha256:253bf92b744b3170eb4c4ca2fa58f9c4b87aeb1df42f71d4e78815e6e8b73c9e", + "sha256:255ba9d6d5ff1a382bb9a578cd563605aa69bec845680e21c44afc2670607a95", + "sha256:2817b2f66ca82ee699acd90e05c95e79bbf1dc986abb62b61ec8aaf851e81c93", + "sha256:2b8d4e166e600dcfbff51919c7a3789ff6ca8b3ecce16e1d9c96d95dd569eb4c", + "sha256:2d5b785c792802e7b275c420d84f3397668e9d49ab1cb52bd916b3b3ffcf09ad", + "sha256:3161ce82ab85acd267c8f4b14aa226047a6bee1e4e6adb74b798bd42c6ae1f80", + "sha256:33164093be11fcef3ce2571a0dccd9041c9a93fa3bde86569d7b03120d276c6f", + "sha256:39a312d0e991690ccc1a61f1e9e42daa519dcc34ad03eb6f826d94c1190190dd", + "sha256:3b2ab182fc28e7a81f6c70bfbd829045d9480063f5ab06f6e601a3eddbbd49a0", + "sha256:3c68330a59506254b556b99a91857428cab98b2f84061260a67865f7f52899f5", + "sha256:3f0e27e5b733803333bb2371249f41cf42bae8884863e8e8965ec69bebe53132", + "sha256:3f5c7ce535a1d2429a634310e308fb7d718905487257060e5d4598e29dc17f0b", + "sha256:3fd194939b1f764d6bb05490987bfe104287bbf51b8d862261ccf66f48fb4096", + "sha256:41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321", + "sha256:41d55fc043954cddbbd82503d9cc3f4814a40bcef30b3569bc7b5e34130718c1", + "sha256:42c89579f82e49db436b69c938ab3e1559e5a4409eb8639eb4143989bc390f2f", + "sha256:45ad816b2c8e3b60b510f30dbd37fe74fd4a772248a52bb021f6fd65dff809b6", + "sha256:4ac39027011414dbd3d87f7edb31680e1f430834c8cef029f11c66dad0670aa5", + "sha256:4d4cbe4ffa9d05f46a28252efc5941e0462792930caa370a6efaf491f412bc66", + "sha256:4fcf3eabd3fd1a5e6092d1242295fa37d0354b2eb2077e6eb670accad78e40e1", + "sha256:5d791245a894be071d5ab04bbb4850534261a7d4fd363b094a7b9963e8cdbd31", + "sha256:6c43ecfef7deaf0617cee936836518e7424ee12cb709883f2c9a1adda63cc460", + "sha256:6c5f938d199a6fdbdc10bbb9447496561c3a9a565b43be564648d81e1102ac22", + "sha256:6e2f9cc8e5328f829f6e1fb74a0a3a939b14e67e80832975e01929e320386b34", + "sha256:713103a8bdde61d13490adf47171a1039fd880113981e55401a0f7b42c37d071", + "sha256:71783b0b6455ac8f34b5ec99d83e686892c50498d5d00b8e56d47f41b38fbe04", + "sha256:76b36b3124f0223903609944a3c8bf28a599b2cc0ce0be60b45211c8e9be97f8", + "sha256:7bc88fc494b1f0311d67f29fee6fd636606f4697e8cc793a2d912ac5b19aa38d", + "sha256:7ee912f7e78287516df155f69da575a0ba33b02dd7c1d6614dbc9463f43066e3", + "sha256:86f20cee0f0a317c76573b627b954c412ea766d6ada1a9fcf1b805763ae7feeb", + "sha256:89341b2c19fb5eac30c341133ae2cc3544d40d9b1892749cdd25892bbc6ac951", + "sha256:8a9b5a0606faca4f6cc0d338359d6fa137104c337f489cd135bb7fbdbccb1e39", + "sha256:8d399dade330c53b4106160f75f55407e9ae7505263ea86f2ccca6bfcbdb4921", + "sha256:8e31e9db1bee8b4f407b77fd2507337a0a80665ad7b6c749d08df595d88f1cf5", + "sha256:90c72ebb7cb3a08a7f40061079817133f502a160561d0675b0a6adf231382c92", + "sha256:918810ef188f84152af6b938254911055a72e0f935b5fbc4c1a4ed0b0584aed1", + "sha256:93c15c8e48e5e7b89d5cb4613479d144fda8344e2d886cf694fd36db4cc86865", + "sha256:96603a562b546632441926cd1293cfcb5b69f0b4159e6077f7c7dbdfb686af4d", + "sha256:99c5ac4ad492b4a19fc132306cd57075c28446ec2ed970973bbf036bcda1bcc6", + "sha256:9c19b26acdd08dd239e0d3669a3dddafd600902e37881f13fbd8a53943079dbc", + "sha256:9de50a199b7710fa2904be5a4a9b51af587ab24c8e540a7243ab737b45844543", + "sha256:9e2ee0ac5a1f5c7dd3197de309adfb99ac4617ff02b0603fd1e65b07dc772e4b", + "sha256:a2ece4af1f3c967a4390c284797ab595a9f1bc1130ef8b01828915a05a6ae684", + "sha256:a3628b6c7b880b181a3ae0a0683698513874df63783fd89de99b7b7539e3e8a8", + "sha256:ad1407db8f2f49329729564f71685557157bfa42b48f4b93e53721a16eb813ed", + "sha256:b04691bc6601ef47c88f0255043df6f570ada1a9ebef99c34bd0b72866c217ae", + "sha256:b0cf2a4501bff9330a8a5248b4ce951851e415bdcce9dc158e76cfd55e15085c", + "sha256:b2fe42e523be344124c6c8ef32a011444e869dc5f883c591ed87f84339de5976", + "sha256:b30e963f9e0d52c28f284d554a9469af073030030cef8693106d918b2ca92f54", + "sha256:bb54c54510e47a8c7c8e63454a6acc817519337b2b78606c4e840871a3e15349", + "sha256:bd111d7fc5591ddf377a408ed9067045259ff2770f37e2d94e6478d0f3fc0c17", + "sha256:bdf70bfe5a1414ba9afb9d49f0c912dc524cf60141102f3a11143ba3d291870f", + "sha256:ca80e1b90a05a4f476547f904992ae81eda5c2c85c66ee4195bb8f9c5fb47f28", + "sha256:caf486ac1e689dda3502567eb89ffe02876546599bbf915ec94b1fa424eeffd4", + "sha256:ccc360e87341ad47c777f5723f68adbb52b37ab450c8bc3ca9ca1f3e849e5fe2", + "sha256:d25036d161c4fe2225d1abff2bd52c34ed0b1099f02c208cd34d8c05729882f0", + "sha256:d52d5dc7c6682b720280f9d9db41d36ebe4791622c842e258c9206232251ab2b", + "sha256:d67f8baed00870aa390ea2590798766256f31dc5ed3ecc737debb6e97e2ede78", + "sha256:d76e8b13161a202d14c9584590c4df4d068c9567c99506497bdd67eaedf36403", + "sha256:d95fc1bf33a9a81469aa760617b5971331cdd74370d1214f0b3109272c0e1e3c", + "sha256:de6a1c9f6803b90e20869e6b99c2c18cef5cc691363954c93cb9adeb26d9f3ae", + "sha256:e1d8cb0b56b3587c5c01de3bf2f600f186da7e7b5f7353d1bf26a8ddca57f965", + "sha256:e2a988a0c673c2e12084f5e6ba3392d76c75ddb8ebc6c7e9ead68248101cd446", + "sha256:e3f1e3f1a1751bb62b4a1b7f4e435afcdade6c17a4fd9b9d43607cebd242924a", + "sha256:e6a00ffcc173e765e200ceefb06399ba09c06db97f401f920513a10c803604ca", + "sha256:e827d48cf802de06d9c935088c2924e3c7e7533377d66b6f31ed175c1620e05e", + "sha256:ebf3fd9f141700b510d4b190094db0ce37ac6361a6806c153c161dc6c041ccda", + "sha256:ec00c3305788e04bf6d29d42e504560e159ccaf0be30c09203b468a6c1ccd3b2", + "sha256:ec4fd86658c6a8964d75426517dc01cbf840bbf32d055ce64a9e63a40fd7b771", + "sha256:efd2fcf7e7b9d7ab16e6b7d54205beded0a9c8566cb30f09c1abe42b4e22bdcb", + "sha256:f0f03211fd14a6a0aed2997d4b1c013d49fb7b50eeb9ffdf5e51f23cfe2c77fa", + "sha256:f628dbf3c91e12f4d6c8b3f092069567d8eb17814aebba3d7d60c149391aee3a", + "sha256:f8ef51e459eb2ad8e7a66c1d6440c808485840ad55ecc3cafefadea47d1b1ba2", + "sha256:fc37e9aef10a696a5a4474802930079ccfc14d9f9c10b4662169671ff034b7df", + "sha256:fdee8405931b0615220e5ddf8cd7edd8592c606a8e4ca2a00704883c396e4479" + ], + "markers": "python_version >= '3.6'", + "version": "==3.8.6" + }, + "aiosignal": { + "hashes": [ + "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc", + "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17" + ], + "markers": "python_version >= '3.7'", + "version": "==1.3.1" + }, + "async-timeout": { + "hashes": [ + "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f", + "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028" + ], + "markers": "python_version >= '3.7'", + "version": "==4.0.3" + }, "attrs": { "hashes": [ - "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6", - "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c" + "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04", + "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015" ], - "markers": "python_version >= '3.5'", - "version": "==22.1.0" + "markers": "python_version >= '3.7'", + "version": "==23.1.0" + }, + "certifi": { + "hashes": [ + "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", + "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" + ], + "markers": "python_version >= '3.6'", + "version": "==2023.7.22" + }, + "charset-normalizer": { + "hashes": [ + "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027", + "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087", + "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786", + "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8", + "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09", + "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185", + "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574", + "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e", + "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519", + "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898", + "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269", + "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3", + "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f", + "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6", + "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8", + "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a", + "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73", + "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc", + "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714", + "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2", + "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc", + "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce", + "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d", + "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e", + "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6", + "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269", + "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96", + "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d", + "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a", + "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4", + "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77", + "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d", + "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0", + "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed", + "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068", + "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac", + "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25", + "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8", + "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab", + "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26", + "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2", + "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db", + "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f", + "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5", + "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99", + "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c", + "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d", + "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811", + "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa", + "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a", + "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03", + "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b", + "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04", + "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c", + "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001", + "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458", + "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389", + "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99", + "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985", + "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537", + "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238", + "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f", + "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d", + "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796", + "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a", + "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143", + "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8", + "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c", + "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5", + "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5", + "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711", + "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4", + "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6", + "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c", + "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7", + "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4", + "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b", + "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae", + "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12", + "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c", + "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae", + "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8", + "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887", + "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b", + "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4", + "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f", + "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5", + "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33", + "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519", + "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561" + ], + "markers": "python_full_version >= '3.7.0'", + "version": "==3.3.2" }, - "pyrizz": { - "editable": true, - "path": "." + "dnspython": { + "hashes": [ + "sha256:57c6fbaaeaaf39c891292012060beb141791735dbb4004798328fc2c467402d8", + "sha256:8dcfae8c7460a2f84b4072e26f1c9f4101ca20c071649cb7c34e8b6a93d58984" + ], + "markers": "python_version >= '3.8' and python_version < '4.0'", + "version": "==2.4.2" + }, + "frozenlist": { + "hashes": [ + "sha256:007df07a6e3eb3e33e9a1fe6a9db7af152bbd8a185f9aaa6ece10a3529e3e1c6", + "sha256:008eb8b31b3ea6896da16c38c1b136cb9fec9e249e77f6211d479db79a4eaf01", + "sha256:09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251", + "sha256:0c7c1b47859ee2cac3846fde1c1dc0f15da6cec5a0e5c72d101e0f83dcb67ff9", + "sha256:0e5c8764c7829343d919cc2dfc587a8db01c4f70a4ebbc49abde5d4b158b007b", + "sha256:10ff5faaa22786315ef57097a279b833ecab1a0bfb07d604c9cbb1c4cdc2ed87", + "sha256:17ae5cd0f333f94f2e03aaf140bb762c64783935cc764ff9c82dff626089bebf", + "sha256:19488c57c12d4e8095a922f328df3f179c820c212940a498623ed39160bc3c2f", + "sha256:1a0848b52815006ea6596c395f87449f693dc419061cc21e970f139d466dc0a0", + "sha256:1e78fb68cf9c1a6aa4a9a12e960a5c9dfbdb89b3695197aa7064705662515de2", + "sha256:261b9f5d17cac914531331ff1b1d452125bf5daa05faf73b71d935485b0c510b", + "sha256:2b8bcf994563466db019fab287ff390fffbfdb4f905fc77bc1c1d604b1c689cc", + "sha256:38461d02d66de17455072c9ba981d35f1d2a73024bee7790ac2f9e361ef1cd0c", + "sha256:490132667476f6781b4c9458298b0c1cddf237488abd228b0b3650e5ecba7467", + "sha256:491e014f5c43656da08958808588cc6c016847b4360e327a62cb308c791bd2d9", + "sha256:515e1abc578dd3b275d6a5114030b1330ba044ffba03f94091842852f806f1c1", + "sha256:556de4430ce324c836789fa4560ca62d1591d2538b8ceb0b4f68fb7b2384a27a", + "sha256:5833593c25ac59ede40ed4de6d67eb42928cca97f26feea219f21d0ed0959b79", + "sha256:6221d84d463fb110bdd7619b69cb43878a11d51cbb9394ae3105d082d5199167", + "sha256:6918d49b1f90821e93069682c06ffde41829c346c66b721e65a5c62b4bab0300", + "sha256:6c38721585f285203e4b4132a352eb3daa19121a035f3182e08e437cface44bf", + "sha256:71932b597f9895f011f47f17d6428252fc728ba2ae6024e13c3398a087c2cdea", + "sha256:7211ef110a9194b6042449431e08c4d80c0481e5891e58d429df5899690511c2", + "sha256:764226ceef3125e53ea2cb275000e309c0aa5464d43bd72abd661e27fffc26ab", + "sha256:7645a8e814a3ee34a89c4a372011dcd817964ce8cb273c8ed6119d706e9613e3", + "sha256:76d4711f6f6d08551a7e9ef28c722f4a50dd0fc204c56b4bcd95c6cc05ce6fbb", + "sha256:7f4f399d28478d1f604c2ff9119907af9726aed73680e5ed1ca634d377abb087", + "sha256:88f7bc0fcca81f985f78dd0fa68d2c75abf8272b1f5c323ea4a01a4d7a614efc", + "sha256:8d0edd6b1c7fb94922bf569c9b092ee187a83f03fb1a63076e7774b60f9481a8", + "sha256:901289d524fdd571be1c7be054f48b1f88ce8dddcbdf1ec698b27d4b8b9e5d62", + "sha256:93ea75c050c5bb3d98016b4ba2497851eadf0ac154d88a67d7a6816206f6fa7f", + "sha256:981b9ab5a0a3178ff413bca62526bb784249421c24ad7381e39d67981be2c326", + "sha256:9ac08e601308e41eb533f232dbf6b7e4cea762f9f84f6357136eed926c15d12c", + "sha256:a02eb8ab2b8f200179b5f62b59757685ae9987996ae549ccf30f983f40602431", + "sha256:a0c6da9aee33ff0b1a451e867da0c1f47408112b3391dd43133838339e410963", + "sha256:a6c8097e01886188e5be3e6b14e94ab365f384736aa1fca6a0b9e35bd4a30bc7", + "sha256:aa384489fefeb62321b238e64c07ef48398fe80f9e1e6afeff22e140e0850eef", + "sha256:ad2a9eb6d9839ae241701d0918f54c51365a51407fd80f6b8289e2dfca977cc3", + "sha256:b206646d176a007466358aa21d85cd8600a415c67c9bd15403336c331a10d956", + "sha256:b826d97e4276750beca7c8f0f1a4938892697a6bcd8ec8217b3312dad6982781", + "sha256:b89ac9768b82205936771f8d2eb3ce88503b1556324c9f903e7156669f521472", + "sha256:bd7bd3b3830247580de99c99ea2a01416dfc3c34471ca1298bccabf86d0ff4dc", + "sha256:bdf1847068c362f16b353163391210269e4f0569a3c166bc6a9f74ccbfc7e839", + "sha256:c11b0746f5d946fecf750428a95f3e9ebe792c1ee3b1e96eeba145dc631a9672", + "sha256:c5374b80521d3d3f2ec5572e05adc94601985cc526fb276d0c8574a6d749f1b3", + "sha256:ca265542ca427bf97aed183c1676e2a9c66942e822b14dc6e5f42e038f92a503", + "sha256:ce31ae3e19f3c902de379cf1323d90c649425b86de7bbdf82871b8a2a0615f3d", + "sha256:ceb6ec0a10c65540421e20ebd29083c50e6d1143278746a4ef6bcf6153171eb8", + "sha256:d081f13b095d74b67d550de04df1c756831f3b83dc9881c38985834387487f1b", + "sha256:d5655a942f5f5d2c9ed93d72148226d75369b4f6952680211972a33e59b1dfdc", + "sha256:d5a32087d720c608f42caed0ef36d2b3ea61a9d09ee59a5142d6070da9041b8f", + "sha256:d6484756b12f40003c6128bfcc3fa9f0d49a687e171186c2d85ec82e3758c559", + "sha256:dd65632acaf0d47608190a71bfe46b209719bf2beb59507db08ccdbe712f969b", + "sha256:de343e75f40e972bae1ef6090267f8260c1446a1695e77096db6cfa25e759a95", + "sha256:e29cda763f752553fa14c68fb2195150bfab22b352572cb36c43c47bedba70eb", + "sha256:e41f3de4df3e80de75845d3e743b3f1c4c8613c3997a912dbf0229fc61a8b963", + "sha256:e66d2a64d44d50d2543405fb183a21f76b3b5fd16f130f5c99187c3fb4e64919", + "sha256:e74b0506fa5aa5598ac6a975a12aa8928cbb58e1f5ac8360792ef15de1aa848f", + "sha256:f0ed05f5079c708fe74bf9027e95125334b6978bf07fd5ab923e9e55e5fbb9d3", + "sha256:f61e2dc5ad442c52b4887f1fdc112f97caeff4d9e6ebe78879364ac59f1663e1", + "sha256:fec520865f42e5c7f050c2a79038897b1c7d1595e907a9e08e3353293ffc948e" + ], + "markers": "python_version >= '3.8'", + "version": "==1.4.0" }, - "exceptiongroup": { + "idna": { "hashes": [ - "sha256:2ac84b496be68464a2da60da518af3785fff8b7ec0d090a581604bc870bdee41", - "sha256:affbabf13fb6e98988c38d9c5650e701569fe3c1de3233cfb61c5f33774690ad" + "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", + "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" ], - "markers": "python_version < '3.11'", - "version": "==1.0.0" + "markers": "python_version >= '3.5'", + "version": "==3.4" }, "iniconfig": { "hashes": [ - "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", - "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32" + "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", + "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374" ], - "version": "==1.1.1" + "markers": "python_version >= '3.7'", + "version": "==2.0.0" + }, + "multidict": { + "hashes": [ + "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9", + "sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8", + "sha256:0dfad7a5a1e39c53ed00d2dd0c2e36aed4650936dc18fd9a1826a5ae1cad6f03", + "sha256:11bdf3f5e1518b24530b8241529d2050014c884cf18b6fc69c0c2b30ca248710", + "sha256:1502e24330eb681bdaa3eb70d6358e818e8e8f908a22a1851dfd4e15bc2f8161", + "sha256:16ab77bbeb596e14212e7bab8429f24c1579234a3a462105cda4a66904998664", + "sha256:16d232d4e5396c2efbbf4f6d4df89bfa905eb0d4dc5b3549d872ab898451f569", + "sha256:21a12c4eb6ddc9952c415f24eef97e3e55ba3af61f67c7bc388dcdec1404a067", + "sha256:27c523fbfbdfd19c6867af7346332b62b586eed663887392cff78d614f9ec313", + "sha256:281af09f488903fde97923c7744bb001a9b23b039a909460d0f14edc7bf59706", + "sha256:33029f5734336aa0d4c0384525da0387ef89148dc7191aae00ca5fb23d7aafc2", + "sha256:3601a3cece3819534b11d4efc1eb76047488fddd0c85a3948099d5da4d504636", + "sha256:3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49", + "sha256:36c63aaa167f6c6b04ef2c85704e93af16c11d20de1d133e39de6a0e84582a93", + "sha256:39ff62e7d0f26c248b15e364517a72932a611a9b75f35b45be078d81bdb86603", + "sha256:43644e38f42e3af682690876cff722d301ac585c5b9e1eacc013b7a3f7b696a0", + "sha256:4372381634485bec7e46718edc71528024fcdc6f835baefe517b34a33c731d60", + "sha256:458f37be2d9e4c95e2d8866a851663cbc76e865b78395090786f6cd9b3bbf4f4", + "sha256:45e1ecb0379bfaab5eef059f50115b54571acfbe422a14f668fc8c27ba410e7e", + "sha256:4b9d9e4e2b37daddb5c23ea33a3417901fa7c7b3dee2d855f63ee67a0b21e5b1", + "sha256:4ceef517eca3e03c1cceb22030a3e39cb399ac86bff4e426d4fc6ae49052cc60", + "sha256:4d1a3d7ef5e96b1c9e92f973e43aa5e5b96c659c9bc3124acbbd81b0b9c8a951", + "sha256:4dcbb0906e38440fa3e325df2359ac6cb043df8e58c965bb45f4e406ecb162cc", + "sha256:509eac6cf09c794aa27bcacfd4d62c885cce62bef7b2c3e8b2e49d365b5003fe", + "sha256:52509b5be062d9eafc8170e53026fbc54cf3b32759a23d07fd935fb04fc22d95", + "sha256:52f2dffc8acaba9a2f27174c41c9e57f60b907bb9f096b36b1a1f3be71c6284d", + "sha256:574b7eae1ab267e5f8285f0fe881f17efe4b98c39a40858247720935b893bba8", + "sha256:5979b5632c3e3534e42ca6ff856bb24b2e3071b37861c2c727ce220d80eee9ed", + "sha256:59d43b61c59d82f2effb39a93c48b845efe23a3852d201ed2d24ba830d0b4cf2", + "sha256:5a4dcf02b908c3b8b17a45fb0f15b695bf117a67b76b7ad18b73cf8e92608775", + "sha256:5cad9430ab3e2e4fa4a2ef4450f548768400a2ac635841bc2a56a2052cdbeb87", + "sha256:5fc1b16f586f049820c5c5b17bb4ee7583092fa0d1c4e28b5239181ff9532e0c", + "sha256:62501642008a8b9871ddfccbf83e4222cf8ac0d5aeedf73da36153ef2ec222d2", + "sha256:64bdf1086b6043bf519869678f5f2757f473dee970d7abf6da91ec00acb9cb98", + "sha256:64da238a09d6039e3bd39bb3aee9c21a5e34f28bfa5aa22518581f910ff94af3", + "sha256:666daae833559deb2d609afa4490b85830ab0dfca811a98b70a205621a6109fe", + "sha256:67040058f37a2a51ed8ea8f6b0e6ee5bd78ca67f169ce6122f3e2ec80dfe9b78", + "sha256:6748717bb10339c4760c1e63da040f5f29f5ed6e59d76daee30305894069a660", + "sha256:6b181d8c23da913d4ff585afd1155a0e1194c0b50c54fcfe286f70cdaf2b7176", + "sha256:6ed5f161328b7df384d71b07317f4d8656434e34591f20552c7bcef27b0ab88e", + "sha256:7582a1d1030e15422262de9f58711774e02fa80df0d1578995c76214f6954988", + "sha256:7d18748f2d30f94f498e852c67d61261c643b349b9d2a581131725595c45ec6c", + "sha256:7d6ae9d593ef8641544d6263c7fa6408cc90370c8cb2bbb65f8d43e5b0351d9c", + "sha256:81a4f0b34bd92df3da93315c6a59034df95866014ac08535fc819f043bfd51f0", + "sha256:8316a77808c501004802f9beebde51c9f857054a0c871bd6da8280e718444449", + "sha256:853888594621e6604c978ce2a0444a1e6e70c8d253ab65ba11657659dcc9100f", + "sha256:99b76c052e9f1bc0721f7541e5e8c05db3941eb9ebe7b8553c625ef88d6eefde", + "sha256:a2e4369eb3d47d2034032a26c7a80fcb21a2cb22e1173d761a162f11e562caa5", + "sha256:ab55edc2e84460694295f401215f4a58597f8f7c9466faec545093045476327d", + "sha256:af048912e045a2dc732847d33821a9d84ba553f5c5f028adbd364dd4765092ac", + "sha256:b1a2eeedcead3a41694130495593a559a668f382eee0727352b9a41e1c45759a", + "sha256:b1e8b901e607795ec06c9e42530788c45ac21ef3aaa11dbd0c69de543bfb79a9", + "sha256:b41156839806aecb3641f3208c0dafd3ac7775b9c4c422d82ee2a45c34ba81ca", + "sha256:b692f419760c0e65d060959df05f2a531945af31fda0c8a3b3195d4efd06de11", + "sha256:bc779e9e6f7fda81b3f9aa58e3a6091d49ad528b11ed19f6621408806204ad35", + "sha256:bf6774e60d67a9efe02b3616fee22441d86fab4c6d335f9d2051d19d90a40063", + "sha256:c048099e4c9e9d615545e2001d3d8a4380bd403e1a0578734e0d31703d1b0c0b", + "sha256:c5cb09abb18c1ea940fb99360ea0396f34d46566f157122c92dfa069d3e0e982", + "sha256:cc8e1d0c705233c5dd0c5e6460fbad7827d5d36f310a0fadfd45cc3029762258", + "sha256:d5e3fc56f88cc98ef8139255cf8cd63eb2c586531e43310ff859d6bb3a6b51f1", + "sha256:d6aa0418fcc838522256761b3415822626f866758ee0bc6632c9486b179d0b52", + "sha256:d6c254ba6e45d8e72739281ebc46ea5eb5f101234f3ce171f0e9f5cc86991480", + "sha256:d6d635d5209b82a3492508cf5b365f3446afb65ae7ebd755e70e18f287b0adf7", + "sha256:dcfe792765fab89c365123c81046ad4103fcabbc4f56d1c1997e6715e8015461", + "sha256:ddd3915998d93fbcd2566ddf9cf62cdb35c9e093075f862935573d265cf8f65d", + "sha256:ddff9c4e225a63a5afab9dd15590432c22e8057e1a9a13d28ed128ecf047bbdc", + "sha256:e41b7e2b59679edfa309e8db64fdf22399eec4b0b24694e1b2104fb789207779", + "sha256:e69924bfcdda39b722ef4d9aa762b2dd38e4632b3641b1d9a57ca9cd18f2f83a", + "sha256:ea20853c6dbbb53ed34cb4d080382169b6f4554d394015f1bef35e881bf83547", + "sha256:ee2a1ece51b9b9e7752e742cfb661d2a29e7bcdba2d27e66e28a99f1890e4fa0", + "sha256:eeb6dcc05e911516ae3d1f207d4b0520d07f54484c49dfc294d6e7d63b734171", + "sha256:f70b98cd94886b49d91170ef23ec5c0e8ebb6f242d734ed7ed677b24d50c82cf", + "sha256:fc35cb4676846ef752816d5be2193a1e8367b4c1397b74a565a9d0389c433a1d", + "sha256:ff959bee35038c4624250473988b24f846cbeb2c6639de3602c073f10410ceba" + ], + "markers": "python_version >= '3.7'", + "version": "==6.0.4" + }, + "openai": { + "hashes": [ + "sha256:4be1dad329a65b4ce1a660fe6d5431b438f429b5855c883435f0f7fcb6d2dcc8", + "sha256:d18690f9e3d31eedb66b57b88c2165d760b24ea0a01f150dd3f068155088ce68" + ], + "index": "pypi", + "markers": "python_full_version >= '3.7.1'", + "version": "==0.28.1" }, "packaging": { "hashes": [ - "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", - "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" + "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", + "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" ], - "markers": "python_version >= '3.6'", - "version": "==21.3" + "markers": "python_version >= '3.7'", + "version": "==23.2" }, "pluggy": { "hashes": [ - "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", - "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" + "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12", + "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7" ], - "markers": "python_version >= '3.6'", - "version": "==1.0.0" + "markers": "python_version >= '3.8'", + "version": "==1.3.0" }, - "pyparsing": { + "pymongo": { "hashes": [ - "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", - "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc" + "sha256:014e7049dd019a6663747ca7dae328943e14f7261f7c1381045dfc26a04fa330", + "sha256:055f5c266e2767a88bb585d01137d9c7f778b0195d3dbf4a487ef0638be9b651", + "sha256:05c30fd35cc97f14f354916b45feea535d59060ef867446b5c3c7f9b609dd5dc", + "sha256:0634994b026336195778e5693583c060418d4ab453eff21530422690a97e1ee8", + "sha256:09c7de516b08c57647176b9fc21d929d628e35bcebc7422220c89ae40b62126a", + "sha256:107a234dc55affc5802acb3b6d83cbb8c87355b38a9457fcd8806bdeb8bce161", + "sha256:10a379fb60f1b2406ae57b8899bacfe20567918c8e9d2d545e1b93628fcf2050", + "sha256:128b1485753106c54af481789cdfea12b90a228afca0b11fb3828309a907e10e", + "sha256:1394c4737b325166a65ae7c145af1ebdb9fb153ebedd37cf91d676313e4a67b8", + "sha256:1c63e3a2e8fb815c4b1f738c284a4579897e37c3cfd95fdb199229a1ccfb638a", + "sha256:1e4ed21029d80c4f62605ab16398fe1ce093fff4b5f22d114055e7d9fbc4adb0", + "sha256:1ec71ac633b126c0775ed4604ca8f56c3540f5c21a1220639f299e7a544b55f9", + "sha256:21812453354b151200034750cd30b0140e82ec2a01fd4357390f67714a1bfbde", + "sha256:256c503a75bd71cf7fb9ebf889e7e222d49c6036a48aad5a619f98a0adf0e0d7", + "sha256:2703a9f8f5767986b4f51c259ff452cc837c5a83c8ed5f5361f6e49933743b2f", + "sha256:288c21ab9531b037f7efa4e467b33176bc73a0c27223c141b822ab4a0e66ff2a", + "sha256:2972dd1f1285866aba027eff2f4a2bbf8aa98563c2ced14cb34ee5602b36afdf", + "sha256:2973f113e079fb98515722cd728e1820282721ec9fd52830e4b73cabdbf1eb28", + "sha256:2ca0ba501898b2ec31e6c3acf90c31910944f01d454ad8e489213a156ccf1bda", + "sha256:2d2be5c9c3488fa8a70f83ed925940f488eac2837a996708d98a0e54a861f212", + "sha256:2f8c04277d879146eacda920476e93d520eff8bec6c022ac108cfa6280d84348", + "sha256:325701ae7b56daa5b0692305b7cb505ca50f80a1288abb32ff420a8a209b01ca", + "sha256:3729b8db02063da50eeb3db88a27670d85953afb9a7f14c213ac9e3dca93034b", + "sha256:3919708594b86d0f5cdc713eb6fccd3f9b9532af09ea7a5d843c933825ef56c4", + "sha256:39a1cd5d383b37285641d5a7a86be85274466ae336a61b51117155936529f9b3", + "sha256:3ec6c20385c5a58e16b1ea60c5e4993ea060540671d7d12664f385f2fb32fe79", + "sha256:47aa128be2e66abd9d1a9b0437c62499d812d291f17b55185cb4aa33a5f710a4", + "sha256:49f2af6cf82509b15093ce3569229e0d53c90ad8ae2eef940652d4cf1f81e045", + "sha256:4a0269811661ba93c472c8a60ea82640e838c2eb148d252720a09b5123f2c2fe", + "sha256:518c90bdd6e842c446d01a766b9136fec5ec6cc94f3b8c3f8b4a332786ee6b64", + "sha256:5717a308a703dda2886a5796a07489c698b442f5e409cf7dc2ac93de8d61d764", + "sha256:5802acc012bbb4bce4dff92973dff76482f30ef35dd4cb8ab5b0e06aa8f08c80", + "sha256:5e63146dbdb1eac207464f6e0cfcdb640c9c5ff0f57b754fa96fe252314a1dc6", + "sha256:6695d7136a435c1305b261a9ddb9b3ecec9863e05aab3935b96038145fd3a977", + "sha256:680fa0fc719e1a3dcb81130858368f51d83667d431924d0bcf249644bce8f303", + "sha256:6b18276f14b4b6d92e707ab6db19b938e112bd2f1dc3f9f1a628df58e4fd3f0d", + "sha256:6bafea6061d63059d8bc2ffc545e2f049221c8a4457d236c5cd6a66678673eab", + "sha256:6d6a1b1361f118e7fefa17ae3114e77f10ee1b228b20d50c47c9f351346180c8", + "sha256:747c84f4e690fbe6999c90ac97246c95d31460d890510e4a3fa61b7d2b87aa34", + "sha256:79f41576b3022c2fe9780ae3e44202b2438128a25284a8ddfa038f0785d87019", + "sha256:7b0e6361754ac596cd16bfc6ed49f69ffcd9b60b7bc4bcd3ea65c6a83475e4ff", + "sha256:7e3b0127b260d4abae7b62203c4c7ef0874c901b55155692353db19de4b18bc4", + "sha256:7fc2bb8a74dcfcdd32f89528e38dcbf70a3a6594963d60dc9595e3b35b66e414", + "sha256:806e094e9e85d8badc978af8c95b69c556077f11844655cb8cd2d1758769e521", + "sha256:81dd1308bd5630d2bb5980f00aa163b986b133f1e9ed66c66ce2a5bc3572e891", + "sha256:82e620842e12e8cb4050d2643a81c8149361cd82c0a920fa5a15dc4ca8a4000f", + "sha256:85f2cdc400ee87f5952ebf2a117488f2525a3fb2e23863a8efe3e4ee9e54e4d1", + "sha256:8ab6bcc8e424e07c1d4ba6df96f7fb963bcb48f590b9456de9ebd03b88084fe8", + "sha256:8adf014f2779992eba3b513e060d06f075f0ab2fb3ad956f413a102312f65cdf", + "sha256:9b0f98481ad5dc4cb430a60bbb8869f05505283b9ae1c62bdb65eb5e020ee8e3", + "sha256:9bea9138b0fc6e2218147e9c6ce1ff76ff8e29dc00bb1b64842bd1ca107aee9f", + "sha256:a09bfb51953930e7e838972ddf646c5d5f984992a66d79da6ba7f6a8d8a890cd", + "sha256:a0be99b599da95b7a90a918dd927b20c434bea5e1c9b3efc6a3c6cd67c23f813", + "sha256:a49aca4d961823b2846b739380c847e8964ff7ae0f0a683992b9d926054f0d6d", + "sha256:a4dc1319d0c162919ee7f4ee6face076becae2abbd351cc14f1fe70af5fb20d9", + "sha256:a8273e1abbcff1d7d29cbbb1ea7e57d38be72f1af3c597c854168508b91516c2", + "sha256:a8f7f9feecae53fa18d6a3ea7c75f9e9a1d4d20e5c3f9ce3fba83f07bcc4eee2", + "sha256:ad4f66fbb893b55f96f03020e67dcab49ffde0177c6565ccf9dec4fdf974eb61", + "sha256:af425f323fce1b07755edd783581e7283557296946212f5b1a934441718e7528", + "sha256:b14dd73f595199f4275bed4fb509277470d9b9059310537e3b3daba12b30c157", + "sha256:b4ad70d7cac4ca0c7b31444a0148bd3af01a2662fa12b1ad6f57cd4a04e21766", + "sha256:b80a4ee19b3442c57c38afa978adca546521a8822d663310b63ae2a7d7b13f3a", + "sha256:ba51129fcc510824b6ca6e2ce1c27e3e4d048b6e35d3ae6f7e517bed1b8b25ce", + "sha256:c011bd5ad03cc096f99ffcfdd18a1817354132c1331bed7a837a25226659845f", + "sha256:cc94f9fea17a5af8cf1a343597711a26b0117c0b812550d99934acb89d526ed2", + "sha256:ccd785fafa1c931deff6a7116e9a0d402d59fabe51644b0d0c268295ff847b25", + "sha256:d16a534da0e39785687b7295e2fcf9a339f4a20689024983d11afaa4657f8507", + "sha256:d3077a31633beef77d057c6523f5de7271ddef7bde5e019285b00c0cc9cac1e3", + "sha256:d603edea1ff7408638b2504905c032193b7dcee7af269802dbb35bc8c3310ed5", + "sha256:db082f728160369d9a6ed2e722438291558fc15ce06d0a7d696a8dad735c236b", + "sha256:ddef295aaf80cefb0c1606f1995899efcb17edc6b327eb6589e234e614b87756", + "sha256:e16ade71c93f6814d095d25cd6d28a90d63511ea396bd96e9ffcb886b278baaa", + "sha256:e3db7d833a7c38c317dc95b54e27f1d27012e031b45a7c24e360b53197d5f6e7", + "sha256:e5e193f89f4f8c1fe273f9a6e6df915092c9f2af6db2d1afb8bd53855025c11f", + "sha256:eb438a8bf6b695bf50d57e6a059ff09652a07968b2041178b3744ea785fcef9b", + "sha256:ebf02c32afa6b67e5861a27183dd98ed88419a94a2ab843cc145fb0bafcc5b28", + "sha256:ecd9e1fa97aa11bf67472220285775fa15e896da108f425e55d23d7540a712ce", + "sha256:ef67fedd863ffffd4adfd46d9d992b0f929c7f61a8307366d664d93517f2c78e", + "sha256:f28ae33dc5a0b9cee06e95fd420e42155d83271ab75964baf747ce959cac5f52", + "sha256:fb1c56d891f9e34303c451998ef62ba52659648bb0d75b03c5e4ac223a3342c2", + "sha256:fe03bf25fae4b95d8afe40004a321df644400fdcba4c8e5e1a19c1085b740888" ], - "markers": "python_full_version >= '3.6.8'", - "version": "==3.0.9" + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==4.6.0" }, "pytest": { "hashes": [ - "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71", - "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59" + "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac", + "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5" ], "index": "pypi", - "version": "==7.2.0" + "markers": "python_version >= '3.7'", + "version": "==7.4.3" + }, + "python-dotenv": { + "hashes": [ + "sha256:31d752f5b748f4e292448c9a0cac6a08ed5e6f4cefab85044462dcad56905cec", + "sha256:9fa413c37d4652d3fa02fea0ff465c384f5db75eab259c4fc5d0c5b8bf20edd4" + ], + "index": "pypi", + "version": "==0.16.0" + }, + "requests": { + "hashes": [ + "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", + "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" + ], + "markers": "python_version >= '3.7'", + "version": "==2.31.0" + }, + "tqdm": { + "hashes": [ + "sha256:d302b3c5b53d47bce91fea46679d9c3c6508cf6332229aa1e7d8653723793386", + "sha256:d88e651f9db8d8551a62556d3cff9e3034274ca5d66e93197cf2490e2dcb69c7" + ], + "markers": "python_version >= '3.7'", + "version": "==4.66.1" + }, + "urllib3": { + "hashes": [ + "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84", + "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e" + ], + "markers": "python_version >= '3.7'", + "version": "==2.0.7" }, - "tomli": { + "yarl": { "hashes": [ - "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" + "sha256:04ab9d4b9f587c06d801c2abfe9317b77cdf996c65a90d5e84ecc45010823571", + "sha256:066c163aec9d3d073dc9ffe5dd3ad05069bcb03fcaab8d221290ba99f9f69ee3", + "sha256:13414591ff516e04fcdee8dc051c13fd3db13b673c7a4cb1350e6b2ad9639ad3", + "sha256:149ddea5abf329752ea5051b61bd6c1d979e13fbf122d3a1f9f0c8be6cb6f63c", + "sha256:159d81f22d7a43e6eabc36d7194cb53f2f15f498dbbfa8edc8a3239350f59fe7", + "sha256:1b1bba902cba32cdec51fca038fd53f8beee88b77efc373968d1ed021024cc04", + "sha256:22a94666751778629f1ec4280b08eb11815783c63f52092a5953faf73be24191", + "sha256:2a96c19c52ff442a808c105901d0bdfd2e28575b3d5f82e2f5fd67e20dc5f4ea", + "sha256:2b0738fb871812722a0ac2154be1f049c6223b9f6f22eec352996b69775b36d4", + "sha256:2c315df3293cd521033533d242d15eab26583360b58f7ee5d9565f15fee1bef4", + "sha256:32f1d071b3f362c80f1a7d322bfd7b2d11e33d2adf395cc1dd4df36c9c243095", + "sha256:3458a24e4ea3fd8930e934c129b676c27452e4ebda80fbe47b56d8c6c7a63a9e", + "sha256:38a3928ae37558bc1b559f67410df446d1fbfa87318b124bf5032c31e3447b74", + "sha256:3da8a678ca8b96c8606bbb8bfacd99a12ad5dd288bc6f7979baddd62f71c63ef", + "sha256:494053246b119b041960ddcd20fd76224149cfea8ed8777b687358727911dd33", + "sha256:50f33040f3836e912ed16d212f6cc1efb3231a8a60526a407aeb66c1c1956dde", + "sha256:52a25809fcbecfc63ac9ba0c0fb586f90837f5425edfd1ec9f3372b119585e45", + "sha256:53338749febd28935d55b41bf0bcc79d634881195a39f6b2f767870b72514caf", + "sha256:5415d5a4b080dc9612b1b63cba008db84e908b95848369aa1da3686ae27b6d2b", + "sha256:5610f80cf43b6202e2c33ba3ec2ee0a2884f8f423c8f4f62906731d876ef4fac", + "sha256:566185e8ebc0898b11f8026447eacd02e46226716229cea8db37496c8cdd26e0", + "sha256:56ff08ab5df8429901ebdc5d15941b59f6253393cb5da07b4170beefcf1b2528", + "sha256:59723a029760079b7d991a401386390c4be5bfec1e7dd83e25a6a0881859e716", + "sha256:5fcd436ea16fee7d4207c045b1e340020e58a2597301cfbcfdbe5abd2356c2fb", + "sha256:61016e7d582bc46a5378ffdd02cd0314fb8ba52f40f9cf4d9a5e7dbef88dee18", + "sha256:63c48f6cef34e6319a74c727376e95626f84ea091f92c0250a98e53e62c77c72", + "sha256:646d663eb2232d7909e6601f1a9107e66f9791f290a1b3dc7057818fe44fc2b6", + "sha256:662e6016409828ee910f5d9602a2729a8a57d74b163c89a837de3fea050c7582", + "sha256:674ca19cbee4a82c9f54e0d1eee28116e63bc6fd1e96c43031d11cbab8b2afd5", + "sha256:6a5883464143ab3ae9ba68daae8e7c5c95b969462bbe42e2464d60e7e2698368", + "sha256:6e7221580dc1db478464cfeef9b03b95c5852cc22894e418562997df0d074ccc", + "sha256:75df5ef94c3fdc393c6b19d80e6ef1ecc9ae2f4263c09cacb178d871c02a5ba9", + "sha256:783185c75c12a017cc345015ea359cc801c3b29a2966c2655cd12b233bf5a2be", + "sha256:822b30a0f22e588b32d3120f6d41e4ed021806418b4c9f0bc3048b8c8cb3f92a", + "sha256:8288d7cd28f8119b07dd49b7230d6b4562f9b61ee9a4ab02221060d21136be80", + "sha256:82aa6264b36c50acfb2424ad5ca537a2060ab6de158a5bd2a72a032cc75b9eb8", + "sha256:832b7e711027c114d79dffb92576acd1bd2decc467dec60e1cac96912602d0e6", + "sha256:838162460b3a08987546e881a2bfa573960bb559dfa739e7800ceeec92e64417", + "sha256:83fcc480d7549ccebe9415d96d9263e2d4226798c37ebd18c930fce43dfb9574", + "sha256:84e0b1599334b1e1478db01b756e55937d4614f8654311eb26012091be109d59", + "sha256:891c0e3ec5ec881541f6c5113d8df0315ce5440e244a716b95f2525b7b9f3608", + "sha256:8c2ad583743d16ddbdf6bb14b5cd76bf43b0d0006e918809d5d4ddf7bde8dd82", + "sha256:8c56986609b057b4839968ba901944af91b8e92f1725d1a2d77cbac6972b9ed1", + "sha256:8ea48e0a2f931064469bdabca50c2f578b565fc446f302a79ba6cc0ee7f384d3", + "sha256:8ec53a0ea2a80c5cd1ab397925f94bff59222aa3cf9c6da938ce05c9ec20428d", + "sha256:95d2ecefbcf4e744ea952d073c6922e72ee650ffc79028eb1e320e732898d7e8", + "sha256:9b3152f2f5677b997ae6c804b73da05a39daa6a9e85a512e0e6823d81cdad7cc", + "sha256:9bf345c3a4f5ba7f766430f97f9cc1320786f19584acc7086491f45524a551ac", + "sha256:a60347f234c2212a9f0361955007fcf4033a75bf600a33c88a0a8e91af77c0e8", + "sha256:a74dcbfe780e62f4b5a062714576f16c2f3493a0394e555ab141bf0d746bb955", + "sha256:a83503934c6273806aed765035716216cc9ab4e0364f7f066227e1aaea90b8d0", + "sha256:ac9bb4c5ce3975aeac288cfcb5061ce60e0d14d92209e780c93954076c7c4367", + "sha256:aff634b15beff8902d1f918012fc2a42e0dbae6f469fce134c8a0dc51ca423bb", + "sha256:b03917871bf859a81ccb180c9a2e6c1e04d2f6a51d953e6a5cdd70c93d4e5a2a", + "sha256:b124e2a6d223b65ba8768d5706d103280914d61f5cae3afbc50fc3dfcc016623", + "sha256:b25322201585c69abc7b0e89e72790469f7dad90d26754717f3310bfe30331c2", + "sha256:b7232f8dfbd225d57340e441d8caf8652a6acd06b389ea2d3222b8bc89cbfca6", + "sha256:b8cc1863402472f16c600e3e93d542b7e7542a540f95c30afd472e8e549fc3f7", + "sha256:b9a4e67ad7b646cd6f0938c7ebfd60e481b7410f574c560e455e938d2da8e0f4", + "sha256:be6b3fdec5c62f2a67cb3f8c6dbf56bbf3f61c0f046f84645cd1ca73532ea051", + "sha256:bf74d08542c3a9ea97bb8f343d4fcbd4d8f91bba5ec9d5d7f792dbe727f88938", + "sha256:c027a6e96ef77d401d8d5a5c8d6bc478e8042f1e448272e8d9752cb0aff8b5c8", + "sha256:c0c77533b5ed4bcc38e943178ccae29b9bcf48ffd1063f5821192f23a1bd27b9", + "sha256:c1012fa63eb6c032f3ce5d2171c267992ae0c00b9e164efe4d73db818465fac3", + "sha256:c3a53ba34a636a256d767c086ceb111358876e1fb6b50dfc4d3f4951d40133d5", + "sha256:d4e2c6d555e77b37288eaf45b8f60f0737c9efa3452c6c44626a5455aeb250b9", + "sha256:de119f56f3c5f0e2fb4dee508531a32b069a5f2c6e827b272d1e0ff5ac040333", + "sha256:e65610c5792870d45d7b68c677681376fcf9cc1c289f23e8e8b39c1485384185", + "sha256:e9fdc7ac0d42bc3ea78818557fab03af6181e076a2944f43c38684b4b6bed8e3", + "sha256:ee4afac41415d52d53a9833ebae7e32b344be72835bbb589018c9e938045a560", + "sha256:f364d3480bffd3aa566e886587eaca7c8c04d74f6e8933f3f2c996b7f09bee1b", + "sha256:f3b078dbe227f79be488ffcfc7a9edb3409d018e0952cf13f15fd6512847f3f7", + "sha256:f4e2d08f07a3d7d3e12549052eb5ad3eab1c349c53ac51c209a0e5991bbada78", + "sha256:f7a3d8146575e08c29ed1cd287068e6d02f1c7bdff8970db96683b9591b86ee7" ], - "markers": "python_version < '3.11'", - "version": "==2.0.1" + "markers": "python_version >= '3.7'", + "version": "==1.9.2" } }, "develop": {} diff --git a/requirements.txt b/requirements.txt index 0c3987d..72570ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ pymongo==4.6.0 python-dotenv==0.16.0 -openai==1.0.1 +openai==0.28.1 pytest==7.4.3 \ No newline at end of file diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 5886f03..97f7b3a 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -20,7 +20,7 @@ def main(): print("What would you like to do today?\n") print("1. Get a random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") print("2. Get a category-specific random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") - print("3. Have AI generate a pick-up line in your chosen category / language with a 50% success rate.") + print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters) with a 50% success rate.") print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") print("5. Insert your own pick-up line to our database.\n") print("!! Type Q to quit !!\n") diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 1427cb9..3bdc24d 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -2,13 +2,12 @@ import os from dotenv import load_dotenv from random import randint -from openai import OpenAI +import openai load_dotenv() client = MongoClient(os.getenv('MONGO_URI')) -ai_client = OpenAI() -ai_client.api_key = os.getenv('OPENAI_API_KEY') +openai.api_key = os.getenv('OPENAI_API_KEY') # Checks if the connection has been made, else make an error printout try: @@ -29,18 +28,19 @@ def get_random_line() -> None: line = collection.find_one({})["lines"][random_number] print(line) + def get_ai_line(category) -> str: try: - if (category != None): - response = ai_client.chat.completions.create( + if (category != "" and len(category) <= 50): + response = openai.ChatCompletion.create( model = os.getenv('OPENAI_MODEL'), messages = - [{"role": "user", "content": f"I need a {category} pick-up line."}] + [{"role": "user", "content": f"I need a {category} pick-up line."},] ) - ai_message = response.choices[0].message.content - ai_line = "{}".format(ai_message) + message = response.choices[0]['message'] + ai_line = "{}".format(message['content']) collection = database['ai_generated'] @@ -53,8 +53,12 @@ def get_ai_line(category) -> str: }) return ai_line + + elif (category != "" and len(category) > 50): + return "Please specify a category that is less than 50 characters." + else: return "Please specify a category." - + except Exception as err: return str(err) \ No newline at end of file diff --git a/src/scripts/mongo-seed.py b/src/scripts/mongo-seed.py index 2092a74..8451095 100644 --- a/src/scripts/mongo-seed.py +++ b/src/scripts/mongo-seed.py @@ -28,12 +28,14 @@ lines = data['lines'] collection_dev_lines = database['dev_lines'] -collection_ai_generated = database['ai_generated'] +collection_dev_lines.drop() collection_dev_lines.insert_one({ 'lines': lines }) +collection_ai_generated = database['ai_generated'] + collection_ai_generated.insert_one({ 'lines': [] }) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index cf8c6f7..476f89d 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -1,4 +1,9 @@ import pytest +import pathlib +import sys + +sys.path.append(f"{pathlib.Path(__file__).parent.resolve()}/../src") + from pyrizz import pyrizz class Tests: @@ -13,8 +18,18 @@ def test_sanity_check(self, example_fixture): actual = True assert actual == expected, "Expected True to be equal to True!" + # Tests for get_ai_line function. def test_get_ai_line_empty(self): expected = "Please specify a category." - actual = pyrizz.get_ai_line(None) + actual = pyrizz.get_ai_line("") assert actual == expected, "Expected 'Please specify a category.' to be returned when no category is specified." - \ No newline at end of file + + def test_get_ai_line_long(self): + expected = "Please specify a category that is less than 50 characters." + actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.") + assert actual == expected, "Expected 'Please specify a category that is less than 50 characters.' to be returned when a category that is more than 50 characters long is specified." + + def test_get_ai_line_str(self): + expected = str + actual = type(pyrizz.get_ai_line("test")) + assert actual == expected, "Expected a string to be returned when a category is specified." \ No newline at end of file From 05ae65b3b72c1e55d8ea26c23cc0e03d75aefbbd Mon Sep 17 00:00:00 2001 From: ccczy-czy Date: Tue, 7 Nov 2023 01:08:12 -0500 Subject: [PATCH 17/95] fix module import issue --- src/pyrizz/__main__.py | 2 +- src/pyrizz/pyrizz.py | 38 ++++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 6526a0b..578dbe3 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,4 @@ -import pyrizz +import pyrizz.pyrizz as pyrizz """Main function for PyRizz.""" diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index e99f97b..ce5d321 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -1,10 +1,10 @@ -from pymongo import MongoClient import os -from dotenv import load_dotenv from random import randint -import openai import pathlib -import json +import json +from pymongo import MongoClient +from dotenv import load_dotenv +import openai load_dotenv() @@ -16,13 +16,13 @@ try: client.admin.command('ping') database = client[os.getenv('MONGO_DBNAME')] - print('*****') + print('*****') except Exception as err: print('* "Failed to connect to MongoDB at', os.getenv('MONGO_URI')) print('Database connection error:', err) -collection = database['lines'] +collection = database['dev_lines'] def get_random_line() -> None: size = len(collection.find_one({})["lines"]) @@ -36,26 +36,28 @@ def get_random_categorized_line() -> None: print("testing") def get_ai_line(category) -> str: - response = openai.ChatCompletion.create( - model = os.getenv('OPENAI_MODEL'), - messages = - [{"role": "user", "content": f"I need a {category} pick-up line."},] - ) + # response = openai.ChatCompletion.create( + # model = os.getenv('OPENAI_MODEL'), + # messages = + # [{"role": "user", "content": f"I need a {category} pick-up line."},] + # ) - message = response.choices[0]['message'] - ai_line = "{}".format(message['content']) + # message = response.choices[0]['message'] + # ai_line = "{}".format(message['content']) collection = database['ai_generated'] lines = collection.find_one({})["lines"] + print(lines) - lines.append(ai_line) + # lines.append(ai_line) - collection.insert_one({ - 'lines': lines - }) + # collection.insert_one({ + # 'lines': lines + # }) - return ai_line + # return ai_line + return 'testing' def add_user_line(): templates_file_path = PROJECT_ROOT + '/src/data/templates.json' From e3152b2c539a649e80b23ca8af44826f77e808a0 Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 01:54:57 -0500 Subject: [PATCH 18/95] added test pipeline stage --- .github/workflows/python.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 394e272..cf4c855 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -22,4 +22,6 @@ jobs: pip install pipenv pipenv install --dev # Add more steps for your tests and other tasks - + - name: Test with pytest + run: | + pipenv run pytest From a627fc8876425185a9ab97787ac86e995d4f4999 Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 01:57:48 -0500 Subject: [PATCH 19/95] fixed pytest pipeline stage error --- .github/workflows/python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index cf4c855..f90cea1 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -20,6 +20,7 @@ jobs: - name: Install dependencies run: | pip install pipenv + pipenv install pipenv install --dev # Add more steps for your tests and other tasks - name: Test with pytest From 66ad64332630e8723843d3f6e4ccd39c6c3f31ce Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 01:59:27 -0500 Subject: [PATCH 20/95] testing fixing pytest pipeline stage --- .github/workflows/python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index f90cea1..a9c748c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -25,4 +25,5 @@ jobs: # Add more steps for your tests and other tasks - name: Test with pytest run: | + pipenv shell pipenv run pytest From 4a9ba62c0b4e39dc9db65d52b60f8ae255005ab6 Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:02:48 -0500 Subject: [PATCH 21/95] pytest pipeline should work now shirley --- .github/workflows/python.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a9c748c..7b9679b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -20,10 +20,9 @@ jobs: - name: Install dependencies run: | pip install pipenv - pipenv install - pipenv install --dev + pipenv install -e + # pipenv install --dev # Add more steps for your tests and other tasks - name: Test with pytest run: | - pipenv shell - pipenv run pytest + pipenv run python -m pytest From 62b3308c9ff4420ba60c0733162d04a5daf251b6 Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:03:49 -0500 Subject: [PATCH 22/95] SHIRLEY --- .github/workflows/python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7b9679b..02506b9 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -20,8 +20,8 @@ jobs: - name: Install dependencies run: | pip install pipenv - pipenv install -e - # pipenv install --dev + pipenv install + pipenv install --dev # Add more steps for your tests and other tasks - name: Test with pytest run: | From 2cd3b43f14643f89055361ff8d2e7f5bdcad6823 Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:06:04 -0500 Subject: [PATCH 23/95] SHIRLEY --- .github/workflows/python.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 02506b9..c1ca02b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -21,7 +21,6 @@ jobs: run: | pip install pipenv pipenv install - pipenv install --dev # Add more steps for your tests and other tasks - name: Test with pytest run: | From 0a035e69b126880561862a12d2d0794bcf8cc37d Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:07:27 -0500 Subject: [PATCH 24/95] SHIRLEY --- .github/workflows/python.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index c1ca02b..8e96113 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -20,8 +20,10 @@ jobs: - name: Install dependencies run: | pip install pipenv + pipenv shell pipenv install # Add more steps for your tests and other tasks - name: Test with pytest run: | + pipenv shell pipenv run python -m pytest From 8db8d6f1c49c7059ee1329354f2717288ef553b5 Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:09:24 -0500 Subject: [PATCH 25/95] SHIRLEY --- .github/workflows/python.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 8e96113..7be0054 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -19,11 +19,14 @@ jobs: python-version: 3.x # Specify the Python version you need - name: Install dependencies run: | - pip install pipenv - pipenv shell + python -m pip install --upgrade pip + pip install --user pipenv + pipenv install pytest pipenv install # Add more steps for your tests and other tasks + - name: Turn on 'editable' mode + run: | + pipenv install -e . - name: Test with pytest run: | - pipenv shell pipenv run python -m pytest From 1e776fb3ce545b2fd4d7584a6eb94b76d626ad3f Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:21:51 -0500 Subject: [PATCH 26/95] SHIRLEY --- .github/workflows/python.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7be0054..a91160c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -12,11 +12,16 @@ on: jobs: build: runs-on: ubuntu-latest + timeout-minutes: 5 + strategy: + matrix: + python-version: ["3.7", "3.9", "3.11"] steps: - - name: Set up Python - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: 3.x # Specify the Python version you need + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip @@ -29,4 +34,5 @@ jobs: pipenv install -e . - name: Test with pytest run: | + pip install pytest pipenv run python -m pytest From beb4a666a9d2937d59f483d8b925c2bfd353e60c Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:33:00 -0500 Subject: [PATCH 27/95] SHIRLEY --- src/pyrizz/pyrizz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 05e4d26..546b09f 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -11,6 +11,7 @@ client = MongoClient(os.getenv('MONGO_URI')) openai.api_key = os.getenv('OPENAI_API_KEY') PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." +print(os.getenv('MONGO_DBNAME')) # Checks if the connection has been made, else make an error printout try: From 8a474200c138d96207d818d15150fd5526c19b70 Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 02:39:31 -0500 Subject: [PATCH 28/95] SHIRLEY --- .github/workflows/python.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a91160c..7502269 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -36,3 +36,9 @@ jobs: run: | pip install pytest 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 }} + From e92d1476247516b2e9879bafc24ec578a786435d Mon Sep 17 00:00:00 2001 From: zeep Date: Tue, 7 Nov 2023 03:07:10 -0500 Subject: [PATCH 29/95] leaving this here --- .github/workflows/python.yml | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7502269..cdfa66b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -12,33 +12,13 @@ on: 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 + - name: Set up Python + uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python-version }} + python-version: 3.x # Specify the Python version you need - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --user pipenv - pipenv install pytest - pipenv install - # Add more steps for your tests and other tasks - - name: Turn on 'editable' mode - run: | - pipenv install -e . - - name: Test with pytest - run: | - pip install pytest - 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 }} - + pip install pipenv + pipenv install --dev + # Add more steps for your tests and other tasks \ No newline at end of file From 220b1444e3f7aa2d0fe6624ba7155f1f40f77242 Mon Sep 17 00:00:00 2001 From: ccczy-czy Date: Tue, 7 Nov 2023 03:48:33 -0500 Subject: [PATCH 30/95] finish random line and random categorized line picker --- Pipfile | 2 +- Pipfile.lock | 2 +- src/pyrizz/__main__.py | 14 ++++++++- src/pyrizz/pyrizz.py | 68 +++++++++++++++++++++++++++++------------- tests/test_pyrizz.py | 4 ++- 5 files changed, 65 insertions(+), 25 deletions(-) diff --git a/Pipfile b/Pipfile index 82d7c37..c2a7ddf 100644 --- a/Pipfile +++ b/Pipfile @@ -6,7 +6,7 @@ name = "pypi" [packages] pytest = "*" pyrizz = {editable = true, path = "."} -pymongo = "*" +pymongo = "==4.6.0" python-dotenv = "==0.16.0" openai = "==0.28.1" diff --git a/Pipfile.lock b/Pipfile.lock index b5ad20b..473eff8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "f4bb19f4239d45fc262e548b93f4e812962f1af3ee7454a3f0a785e6c3e6fc86" + "sha256": "d4e20e705a62e9a1ad44d6cb92d08d21f74697d7b158aee33db1697b3874ece1" }, "pipfile-spec": 6, "requires": { diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 578dbe3..c73cbd7 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -27,6 +27,18 @@ def main(): print("Enter your choice: ") user_input = input("> ") + + if user_input == "1": + print("\n" + pyrizz.get_random_line(), end = "\n\n") + + if user_input == "2": + category_list = pyrizz.get_dev_line_categories() + print("Select a category: ") + for i, category in enumerate(category_list): + print(f"{i + 1}. {category}") + + category_index = input("> ") + print("\n" + pyrizz.get_random_categorized_line(category_list[int(category_index) - 1]), end = "\n\n") if user_input == "3": print("Enter a category / language: ") @@ -42,7 +54,7 @@ def main(): print("Would you like to do something else? (y/n)") user_cont = input("> ") - if user_cont == "n": + if user_cont == "n" or user_cont == "q" or user_cont == "Q": break if user_cont == "y": diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index ce5d321..e1bf3a4 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -4,6 +4,7 @@ import json from pymongo import MongoClient from dotenv import load_dotenv +from bson.objectid import ObjectId import openai load_dotenv() @@ -24,40 +25,65 @@ collection = database['dev_lines'] -def get_random_line() -> None: - size = len(collection.find_one({})["lines"]) - random_number = randint(0, size - 1) +def get_dev_lines() -> dict: + collection = database['dev_lines'] - line = collection.find_one({})["lines"][random_number] + dev_lines = collection.find_one({"_id": ObjectId('6549de9a01c853780b3d5c40')}) - print(line) + return dev_lines -def get_random_categorized_line() -> None: - print("testing") +def get_dev_line_categories() -> list: + dev_lines = get_dev_lines() + + category_list = list(dev_lines.keys()) + category_list.pop(0) + + return category_list + +def get_random_line() -> str: + dev_lines = get_dev_lines() + + category_list = get_dev_line_categories() + + random_category = category_list[randint(0, len(category_list) - 1)] + category_size = len(dev_lines[random_category]) + random_number = randint(0, category_size - 1) + + line = dev_lines[random_category][random_number] + + return line + +def get_random_categorized_line(category) -> str: + dev_lines = get_dev_lines() + + category_size = len(dev_lines[category]) + random_number = randint(0, category_size - 1) + + line = dev_lines[category][random_number] + + return line def get_ai_line(category) -> str: - # response = openai.ChatCompletion.create( - # model = os.getenv('OPENAI_MODEL'), - # messages = - # [{"role": "user", "content": f"I need a {category} pick-up line."},] - # ) + response = openai.ChatCompletion.create( + model = os.getenv('OPENAI_MODEL'), + messages = + [{"role": "user", "content": f"I need a {category} pick-up line."},] + ) - # message = response.choices[0]['message'] - # ai_line = "{}".format(message['content']) + message = response.choices[0]['message'] + ai_line = "{}".format(message['content']) collection = database['ai_generated'] lines = collection.find_one({})["lines"] - print(lines) - # lines.append(ai_line) + lines.append(ai_line) - # collection.insert_one({ - # 'lines': lines - # }) + collection.insert_one({ + 'lines': lines + }) - # return ai_line - return 'testing' + return ai_line def add_user_line(): templates_file_path = PROJECT_ROOT + '/src/data/templates.json' diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index de7d4e0..a435030 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -10,4 +10,6 @@ def example_fixture(self): def test_sanity_check(self, example_fixture): expected = True actual = True - assert actual == expected, "Expected True to be equal to True!" \ No newline at end of file + assert actual == expected, "Expected True to be equal to True!" + + \ No newline at end of file From 393a17779d332ef29f3db2acc284eca26078c6c3 Mon Sep 17 00:00:00 2001 From: annsts Date: Tue, 7 Nov 2023 13:35:52 -0500 Subject: [PATCH 31/95] added tests --- src/pyrizz/__main__.py | 2 +- tests/test_pyrizz.py | 97 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 3d1228a..72c8b8e 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,4 @@ -import pyrizz.pyrizz as pyrizz +import pyrizz as pyrizz """Main function for PyRizz.""" diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 476f89d..9232ac7 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -1,6 +1,9 @@ import pytest import pathlib import sys +from unittest.mock import Mock, patch +from unittest.mock import patch, MagicMock, mock_open +import openai sys.path.append(f"{pathlib.Path(__file__).parent.resolve()}/../src") @@ -32,4 +35,96 @@ def test_get_ai_line_long(self): def test_get_ai_line_str(self): expected = str actual = type(pyrizz.get_ai_line("test")) - assert actual == expected, "Expected a string to be returned when a category is specified." \ No newline at end of file + assert actual == expected, "Expected a string to be returned when a category is specified." + + # Fixture for mocking open() + @pytest.fixture + def mock_open_json(self, monkeypatch): + data = {"templates": ["Here is a {}, and here is another {}."]} + mock_file = mock_open(read_data=str(data)) + monkeypatch.setattr("builtins.open", mock_file) + + # Fixture for mocking json.load() + @pytest.fixture + def mock_json_load(self, monkeypatch): + data = {"templates": ["Here is a {}, and here is another {}."]} + monkeypatch.setattr("json.load", lambda x: data) + + # Fixture for mocking MongoDB insert_one + @pytest.fixture + def mock_insert_one(self, monkeypatch): + def mock(*args, **kwargs): + return MagicMock(inserted_id=1) + monkeypatch.setattr("pymongo.collection.Collection.insert_one", mock) + + # Fixtures for mocking user input as numbers + @pytest.fixture + def mock_input(self, monkeypatch): + inputs = iter(["1", "test, input"]) + monkeypatch.setattr("builtins.input", lambda x: next(inputs)) + + @pytest.fixture + def mock_input_value_error(self, monkeypatch): + monkeypatch.setattr('builtins.input', lambda _: 'not a number') + + # Fixture for handling openai + @pytest.fixture + def mock_openai_offensive(self, monkeypatch): + monkeypatch.setattr(openai.Completion, 'create', Mock(return_value={ + "choices": [{"text": "2"}] # "2" simulates offensive content + })) + + @pytest.fixture + def mock_openai_error(self, monkeypatch): + def openai_error(*args, **kwargs): + raise openai.error.OpenAIError("Test error") + monkeypatch.setattr(openai.Completion, 'create', openai_error) + + # Tests for add_user_line() function + def test_add_user_line_success(self, mock_open_json, mock_json_load, mock_insert_one, mock_input, capsys): + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "Here's your custom pick-up line:" in captured.out + + def test_add_user_line_invalid_template_number(self, mock_open_json, mock_json_load, capsys): + with patch('builtins.input', side_effect=["21", "exit"]): + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "Template number out of range. Please choose between 1 and 20." in captured.out + + def test_add_user_line_not_enough_words(self, mock_open_json, mock_json_load, capsys): + with patch('builtins.input', side_effect=["1", "test"]): + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "Not enough words provided for the placeholders." in captured.out + + def test_add_user_line_json_error(self, monkeypatch, capsys): + m = mock_open() + m.side_effect = FileNotFoundError("The file was not found.") + monkeypatch.setattr("builtins.open", m) + + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "templates.json was not found" in captured.out + + # Tests for user input validation + def test_is_line_valid_length(self): + long_line = "x" * 141 + assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." + + def test_is_offensive_detection(self, mock_openai_offensive): + offensive_line = "An example offensive line" + assert pyrizz.is_offensive(offensive_line) is True, "Expected the line to be flagged as offensive." + + def test_is_offensive_openai_error_handling(self, mock_openai_error): + line = "This should cause an OpenAIError" + assert pyrizz.is_offensive(line) is False, "Expected to return False when an OpenAIError occurs." + + def test_add_user_line_value_error(self, mock_input_value_error, capsys): + with patch('builtins.input', side_effect=["not a number", "exit"]): + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "Please enter a valid number." in captured.out + + +# pytest tests/test_pyrizz.py \ No newline at end of file From 349d384c27a733d5f95d72ff9090a7502fae9ab9 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 13:43:43 -0500 Subject: [PATCH 32/95] Commented the scripts file --- src/scripts/extract.py | 1 + src/scripts/mongo-seed.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/scripts/extract.py b/src/scripts/extract.py index f400697..58dab07 100644 --- a/src/scripts/extract.py +++ b/src/scripts/extract.py @@ -1,3 +1,4 @@ +# Script to read text data from lines.txt and organizes it into a dictionary as an output of JSON data for MongoDB import json import pathlib diff --git a/src/scripts/mongo-seed.py b/src/scripts/mongo-seed.py index e0800c2..f9abde3 100644 --- a/src/scripts/mongo-seed.py +++ b/src/scripts/mongo-seed.py @@ -1,3 +1,5 @@ +# Script which extracts the pickup lines from the JSON extracted file and inserts it into the MongoDB database. + from pymongo import MongoClient import os from dotenv import load_dotenv From 7ce2b7d25431580423f1a4767361596bdc12b979 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 14:59:59 -0500 Subject: [PATCH 33/95] Added pickup line rating functionality with test function --- pyproject.toml | 2 +- src/pyrizz/__main__.py | 25 ++++++++++++++++--------- src/pyrizz/pyrizz.py | 18 ++++++++++++++++++ tests/test_pyrizz.py | 15 ++++++++++++++- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8a4686a..b5cd208 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyrizz" -description = "A package where users can receive pick up lines one at a time." +description = "A package where users can receive pick up lines, rate pickup lines and add pickup lines" version = "0.0.1" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 3d1228a..3b110a6 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -18,8 +18,7 @@ def main(): print("Welcome to PyRizz! Your journey to getting a date begins here...\n") - while True: - + while True: print("What would you like to do today?\n") print("1. Get a random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") print("2. Get a category-specific random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") @@ -36,20 +35,28 @@ def main(): category = input("> ") print("\n" + pyrizz.get_ai_line(category), end = "\n\n") - if user_input == "5": + elif user_input == "4": + print("Type your pickup line: ") + pickup_line = input("> ") + print("\n" + pyrizz.rate_line(pickup_line), end = "\n\n") + + elif user_input == "5": pyrizz.add_user_line() elif user_input == "q" or user_input == "Q": break + + else: + print("Invalid Response.") + user_cont = input("Would you like to try again? (y/n): ") - print("Would you like to do something else? (y/n)") - user_cont = input("> ") + while user_cont not in ["n", "y"]: + print("\nPlease provide a valid input (y/n)") + user_cont = input("> ") - if user_cont == "n": - break + if user_cont == "n": + break - if user_cont == "y": - continue if __name__ == "__main__": main() \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 546b09f..49c785a 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -164,3 +164,21 @@ def is_offensive(text): return False +def rate_line(pickup_line) -> str: + try: + if (pickup_line != ""): + response = openai.ChatCompletion.create( + model = os.getenv('OPENAI_MODEL'), + messages = + [{"role": "user", "content": f"Don't talk as like a conversation or provide a description, just rate this pickup line from 1 to 10 with a snazzy comment: {pickup_line}"},] + ) + + message = response.choices[0]['message'] + ai_rating_response = "{}".format(message['content']) + return ai_rating_response + + else: + return "No pickup line? You gotta use our other features before you come here buddy." + + except Exception as err: + return str(err) \ No newline at end of file diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 476f89d..c0c8adf 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -32,4 +32,17 @@ def test_get_ai_line_long(self): def test_get_ai_line_str(self): expected = str actual = type(pyrizz.get_ai_line("test")) - assert actual == expected, "Expected a string to be returned when a category is specified." \ No newline at end of file + assert actual == expected, "Expected a string to be returned when a category is specified." + + def test_rate_line(self, example_fixture): + # Test case 1: Test with a valid pickup line + pickup_line = "Do you come with Wi-Fi? Because I'm really feeling a connection." + expected_response = "I'd rate it 9/10 – a clever tech twist on a classic line! 🌐😄" + actual_response = pyrizz.rate_line(pickup_line) + assert actual_response == expected_response + + # Test case 2: Test with an empty pickup line + pickup_line = "" + expected_response = "No pickup line? You gotta use our other features before you come here buddy." + actual_response = pyrizz.rate_line(pickup_line) + assert actual_response == expected_response \ No newline at end of file From 4afb19aa4feeeb5f32f5126e1eef4fa1ddcc9453 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 15:05:19 -0500 Subject: [PATCH 34/95] Pulled all previous test functions from the main --- tests/test_pyrizz.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 9232ac7..094ab45 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -125,6 +125,19 @@ def test_add_user_line_value_error(self, mock_input_value_error, capsys): pyrizz.add_user_line() captured = capsys.readouterr() assert "Please enter a valid number." in captured.out + + def test_rate_line(self, example_fixture): + # Test case 1: Test with a valid pickup line + pickup_line = "Do you come with Wi-Fi? Because I'm really feeling a connection." + expected_response = "I'd rate it 9/10 – a clever tech twist on a classic line! 🌐😄" + actual_response = pyrizz.rate_line(pickup_line) + assert actual_response == expected_response + + # Test case 2: Test with an empty pickup line + pickup_line = "" + expected_response = "No pickup line? You gotta use our other features before you come here buddy." + actual_response = pyrizz.rate_line(pickup_line) + assert actual_response == expected_response # pytest tests/test_pyrizz.py \ No newline at end of file From 659f732f616c148a3aed27c45b2540e08df0ae1d Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 15:48:06 -0500 Subject: [PATCH 35/95] Fixed the test function for the rizz rater --- src/pyrizz/pyrizz.py | 2 +- tests/test_pyrizz.py | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 49c785a..dbc4dbd 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -170,7 +170,7 @@ def rate_line(pickup_line) -> str: response = openai.ChatCompletion.create( model = os.getenv('OPENAI_MODEL'), messages = - [{"role": "user", "content": f"Don't talk as like a conversation or provide a description, just rate this pickup line from 1 to 10 with a snazzy comment: {pickup_line}"},] + [{"role": "user", "content": f"Rate this pickup line out of 10: {pickup_line} In your response follow the format of: rating/10 - snazzy comment."},] ) message = response.choices[0]['message'] diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 094ab45..0362399 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -1,6 +1,7 @@ import pytest import pathlib import sys +import re from unittest.mock import Mock, patch from unittest.mock import patch, MagicMock, mock_open import openai @@ -126,18 +127,22 @@ def test_add_user_line_value_error(self, mock_input_value_error, capsys): captured = capsys.readouterr() assert "Please enter a valid number." in captured.out - def test_rate_line(self, example_fixture): - # Test case 1: Test with a valid pickup line - pickup_line = "Do you come with Wi-Fi? Because I'm really feeling a connection." - expected_response = "I'd rate it 9/10 – a clever tech twist on a classic line! 🌐😄" - actual_response = pyrizz.rate_line(pickup_line) - assert actual_response == expected_response - - # Test case 2: Test with an empty pickup line + # Testing for the rate line functionality + def test_rate_line_empty(self, example_fixture): pickup_line = "" expected_response = "No pickup line? You gotta use our other features before you come here buddy." actual_response = pyrizz.rate_line(pickup_line) assert actual_response == expected_response + def test_rate_line(self, example_fixture): + pickup_line = "Do you come with Wi-Fi? Because I'm really feeling a connection." + actual_response = pyrizz.rate_line(pickup_line) + + # Define a regular expression pattern for expected response format + # In this case, the expected pattern response is a number/10 - some characters as a response. + expected_pattern = r'\d+/10 - .+' + + # Check if the actual response matches the expected pattern + assert re.match(expected_pattern, actual_response) is not None # pytest tests/test_pyrizz.py \ No newline at end of file From 7c3e6dc470c1c4cfa21fb251c9677c39ddcf138c Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 18:17:38 -0500 Subject: [PATCH 36/95] Fixed the main menu interface --- src/pyrizz/__main__.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 4fdf48c..66e1cb2 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,4 @@ -import pyrizz as pyrizz +import pyrizz.pyrizz as pyrizz """Main function for PyRizz.""" @@ -18,7 +18,7 @@ def main(): print("Welcome to PyRizz! Your journey to getting a date begins here...\n") - while True: + while True: print("What would you like to do today?\n") print("1. Get a random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") print("2. Get a category-specific random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") @@ -30,7 +30,15 @@ def main(): print("Enter your choice: ") user_input = input("> ") - if user_input == "3": + if user_input == "1": + # Some execution + pass + + elif user_input == "2": + # Some execution + pass + + elif user_input == "3": print("Enter a category / language: ") category = input("> ") print("\n" + pyrizz.get_ai_line(category), end = "\n\n") @@ -48,15 +56,16 @@ def main(): else: print("Invalid Response.") + + while True: user_cont = input("Would you like to try again? (y/n): ") - - while user_cont not in ["n", "y"]: - print("\nPlease provide a valid input (y/n)") - user_cont = input("> ") - - if user_cont == "n": + if user_cont in ["y", "n"]: break + else: + print("\nPlease provide a valid input (y/n)") + if user_cont == "n": + break if __name__ == "__main__": main() \ No newline at end of file From f92c511fb7ae11fa6393dc36f79ffeb2083bcee1 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 18:29:44 -0500 Subject: [PATCH 37/95] Finalized the fixes for the user interface --- src/pyrizz/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 66e1cb2..3c4398f 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,5 @@ -import pyrizz.pyrizz as pyrizz +# import pyrizz.pyrizz as pyrizz +import src.pyrizz as pyrizz """Main function for PyRizz.""" @@ -55,7 +56,7 @@ def main(): break else: - print("Invalid Response.") + print("\nInvalid Response.") while True: user_cont = input("Would you like to try again? (y/n): ") From de7eb20620323e5455e3f477bdb524c5877a2f89 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 18:59:32 -0500 Subject: [PATCH 38/95] Formatted code --- src/pyrizz/pyrizz.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index dbc4dbd..c1ea8f1 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -28,9 +28,7 @@ def get_random_line() -> None: size = len(collection.find_one({})["lines"]) random_number = randint(0, size - 1) - line = collection.find_one({})["lines"][random_number] - print(line) def get_random_categorized_line() -> None: @@ -49,9 +47,7 @@ def get_ai_line(category) -> str: ai_line = "{}".format(message['content']) collection = database['ai_generated'] - lines = collection.find_one({})["lines"] - lines.append(ai_line) collection.insert_one({ From 45493f7ed45a87e4c0cd948c30fa4303b0b236f4 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 19:01:06 -0500 Subject: [PATCH 39/95] Tweaked the import on the main --- src/pyrizz/__main__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 3c4398f..31891de 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,5 +1,4 @@ -# import pyrizz.pyrizz as pyrizz -import src.pyrizz as pyrizz +import pyrizz.pyrizz as pyrizz """Main function for PyRizz.""" From 996651dea08a7fb4ed89246e962890c186e416fe Mon Sep 17 00:00:00 2001 From: Baani Date: Tue, 7 Nov 2023 20:50:33 -0500 Subject: [PATCH 40/95] SHIRLEY test --- .github/workflows/python.yml | 43 ++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index cdfa66b..2ec9d7c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,24 +1,33 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: pyrizz_tests - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - +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: - - name: Set up Python - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: 3.x # Specify the Python version you need + python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | - pip install pipenv - pipenv install --dev - # Add more steps for your tests and other tasks \ No newline at end of file + 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: Test with pytest + run: | + pipenv run python -m pytest \ No newline at end of file From 14c5cf49c841ef8f1343e7457b8c1857298b695d Mon Sep 17 00:00:00 2001 From: Baani Date: Tue, 7 Nov 2023 20:54:20 -0500 Subject: [PATCH 41/95] SHIRLEY --- .github/workflows/python.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 2ec9d7c..daa3e3f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -30,4 +30,9 @@ jobs: - name: Test with pytest run: | - pipenv run python -m pytest \ No newline at end of file + 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 }} From 16d4faf9d3665b98385b9355441f723b0fca2b2b Mon Sep 17 00:00:00 2001 From: Baani Date: Tue, 7 Nov 2023 21:00:22 -0500 Subject: [PATCH 42/95] hmm --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index daa3e3f..5b70277 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -26,7 +26,7 @@ jobs: - name: Turn on 'editable' mode run: | - pipenv install -e . + pipenv install -e - name: Test with pytest run: | From 28b360f3dd1f1e54652b28ed22b1cda20d003d88 Mon Sep 17 00:00:00 2001 From: Baani Date: Tue, 7 Nov 2023 21:01:27 -0500 Subject: [PATCH 43/95] yes --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 5b70277..daa3e3f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -26,7 +26,7 @@ jobs: - name: Turn on 'editable' mode run: | - pipenv install -e + pipenv install -e . - name: Test with pytest run: | From 74f05c2a9b417dafabcfa2288c97990291ff5b34 Mon Sep 17 00:00:00 2001 From: Baani Date: Tue, 7 Nov 2023 21:04:07 -0500 Subject: [PATCH 44/95] TRY --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index daa3e3f..b56eaa8 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -31,7 +31,7 @@ jobs: - name: Test with pytest run: | pipenv run python -m pytest - env: + env: | MONGO_DBNAME: ${{ secrets.MONGO_DBNAME }} MONGO_URI: ${{ secrets.MONGO_URI }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} From 97b5137040026a1a44184682a853eba6d3bb5cd9 Mon Sep 17 00:00:00 2001 From: Baani Date: Tue, 7 Nov 2023 21:14:03 -0500 Subject: [PATCH 45/95] test --- .github/workflows/python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b56eaa8..7608910 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -28,10 +28,10 @@ jobs: run: | pipenv install -e . - - name: Test with pytest + - name: Testing with pytest run: | pipenv run python -m pytest - env: | + env: MONGO_DBNAME: ${{ secrets.MONGO_DBNAME }} MONGO_URI: ${{ secrets.MONGO_URI }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} From b764fef16d95f572435ee38c2a91c9bdf304f505 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Tue, 7 Nov 2023 21:42:50 -0500 Subject: [PATCH 46/95] Forced the AI to respond to the format for testing --- src/pyrizz/pyrizz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index c1ea8f1..686b34f 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -166,7 +166,7 @@ def rate_line(pickup_line) -> str: response = openai.ChatCompletion.create( model = os.getenv('OPENAI_MODEL'), messages = - [{"role": "user", "content": f"Rate this pickup line out of 10: {pickup_line} In your response follow the format of: rating/10 - snazzy comment."},] + [{"role": "user", "content": f"Rate this pickup line out of 10: {pickup_line} In your response, STRICTLY follow the format of (nothing else): rating/10 - snazzy comment."},] ) message = response.choices[0]['message'] From b2806e3c5cd9b2bd74be6b23850fdab2d5302482 Mon Sep 17 00:00:00 2001 From: annsts Date: Tue, 7 Nov 2023 23:19:34 -0500 Subject: [PATCH 47/95] update readme --- README.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca45a04..b95990e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,92 @@ ![Workflow Status](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/actions/workflows/python.yml/badge.svg) -# Python Package Exercise +# PyRizz: Your Source for Playful Pickup Lines +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. -A little exercise to create a Python package, build it, test it, distribute it, and use it. See [instructions](./instructions.md) for details. +# 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) + + +# 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 pyrizz + ``` + +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. + +### Reporting Bugs + +Report bugs at https://github.com/yourusername/pyrizz/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 at https://github.com/yourusername/pyrizz/issues, describing the enhancement. +* Include the 'enhancement' label on the issue. + +Thank you for your interest in rizz! From 8e7909c96f345a6809fa741e29af91d6a739b19f Mon Sep 17 00:00:00 2001 From: ccczy-czy Date: Tue, 7 Nov 2023 23:51:10 -0500 Subject: [PATCH 48/95] finish randomizer tests --- src/pyrizz/__main__.py | 6 ++- src/pyrizz/pyrizz.py | 26 ++++++++---- tests/test_pyrizz.py | 89 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 111 insertions(+), 10 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index c73cbd7..b46e66a 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -38,7 +38,11 @@ def main(): print(f"{i + 1}. {category}") category_index = input("> ") - print("\n" + pyrizz.get_random_categorized_line(category_list[int(category_index) - 1]), end = "\n\n") + category_index = int(category_index) if category_index.isdigit() else 4 + category_val = '' + if category_index in range(1, 4): + category_val = category_list[category_index - 1] + print("\n" + pyrizz.get_random_categorized_line(category_val), end = "\n\n") if user_input == "3": print("Enter a category / language: ") diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index e1bf3a4..bfc4c1a 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -54,14 +54,24 @@ def get_random_line() -> str: return line def get_random_categorized_line(category) -> str: - dev_lines = get_dev_lines() - - category_size = len(dev_lines[category]) - random_number = randint(0, category_size - 1) - - line = dev_lines[category][random_number] - - return line + try: + if category != "" and (category in get_dev_line_categories()): + dev_lines = get_dev_lines() + + category_size = len(dev_lines[category]) + random_number = randint(0, category_size - 1) + + line = dev_lines[category][random_number] + + return line + + if category != "" and (category not in get_dev_line_categories()): + return "System error: category not found." + + return "Please select a valid category." + + except Exception as err: + return str(err) def get_ai_line(category) -> str: response = openai.ChatCompletion.create( diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index a435030..b6fbf9b 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -1,4 +1,5 @@ import pytest +from pyrizz import pyrizz class Tests: # An example of a pytest fixture - a function that can be used for setup and teardown before and after test functions are run. @@ -12,4 +13,90 @@ def test_sanity_check(self, example_fixture): actual = True assert actual == expected, "Expected True to be equal to True!" - \ No newline at end of file + def test_get_dev_lines_dict(self): + ''' + Verify get_dev_lines() returns a dict. + ''' + actual = pyrizz.get_dev_lines() + assert isinstance(actual, dict), f"Expected get_dev_lines() to return a dict. Instead, it returned a {type(actual)}" + + def test_get_dev_lines_nonempty(self): + ''' + Verify get_dev_lines() returns a non-empty dict. + ''' + actual = pyrizz.get_dev_lines() + assert isinstance(actual, dict), f"Expected get_dev_lines() to return a dict. Instead, it returned a {type(actual)}" + assert bool(actual) is True, f"Expected get_dev_lines() not to be empty. Instead, it returned a dict with {len(actual.keys())} keys and {len(actual.values())} values" + + def test_get_dev_lines_three_categories(self): + ''' + Verify get_dev_lines() returns a dict with three categories: 'romantic&sweet', 'clever&playful', 'technical&geeky'. + ''' + actual = pyrizz.get_dev_lines() + assert isinstance(actual, dict), f"Expected get_dev_lines() to return a dict. Instead, it returned a {type(actual)}" + assert ('romantic&sweet' in actual) is True, f"Expected get_dev_lines() to have key 'romantic&sweet'. Instead, it returned a dict with{'' if ('romantic&sweet' in actual) is True else 'out'} key 'romantic&sweet'" + assert ('clever&playful' in actual) is True, f"Expected get_dev_lines() to have key 'clever&playful'. Instead, it returned a dict with{'' if ('clever&playful' in actual) is True else 'out'} key 'clever&playful'" + assert ('technical&geeky' in actual) is True, f"Expected get_dev_lines() to have key 'technical&geeky'. Instead, it returned a dict with{'' if ('technical&geeky' in actual) is True else 'out'} key 'technical&geeky'" + + def test_get_dev_line_categories_list(self): + ''' + Verify get_dev_line_categories() returns a list. + ''' + actual = pyrizz.get_dev_line_categories() + assert isinstance(actual, list), f"Expected get_dev_line_categories() to return a list. Instead, it returned a {type(actual)}" + + def test_get_dev_line_categories_nonempty(self): + ''' + Verify get_dev_line_categories() returns a non-empty list. + ''' + actual = pyrizz.get_dev_line_categories() + assert isinstance(actual, list), f"Expected get_dev_line_categories() to return a list. Instead, it returned a {type(actual)}" + assert len(actual) > 0, f"Expected get_dev_line_categories() not to be empty. Instead, it returned a list with {len(actual)} elements" + + def test_get_dev_line_categories_three_categories(self): + ''' + Verify get_dev_line_categories() returns a list with three values: 'romantic&sweet', 'clever&playful', 'technical&geeky'. + ''' + actual = pyrizz.get_dev_line_categories() + assert isinstance(actual, list), f"Expected get_dev_line_categories() to return a list. Instead, it returned a {type(actual)}" + assert ('romantic&sweet' in actual) is True, f"Expected get_dev_line_categories() to have element 'romantic&sweet'. Instead, it returned a list with{'' if ('romantic&sweet' in actual) is True else 'out'} value 'romantic&sweet'" + assert ('clever&playful' in actual) is True, f"Expected get_dev_line_categories() to have element 'clever&playful'. Instead, it returned a list with{'' if ('clever&playful' in actual) is True else 'out'} value 'clever&playful'" + assert ('technical&geeky' in actual) is True, f"Expected get_dev_line_categories() to have element 'technical&geeky'. Instead, it returned a list with{'' if ('technical&geeky' in actual) is True else 'out'} value 'technical&geeky'" + + def test_get_random_line_str(self): + ''' + Verify get_random_line() returns a str. + ''' + actual = pyrizz.get_random_line() + assert isinstance(actual, str), f"Expected get_random_line() to return a str. Instead, it returned a {type(actual)}" + + def test_get_random_line_nonempty(self): + ''' + Verify get_random_line() returns a non-empty str. + ''' + actual = pyrizz.get_random_line() + assert isinstance(actual, str), f"Expected get_random_line() to return a str. Instead, it returned a {type(actual)}" + assert len(actual) > 0, f"Expected get_random_line() not to be empty. Instead, it returned a string with {len(actual)} characters" + + def test_get_random_line_long_enough(self): + ''' + Verify get_random_line() returns a sentence longer than 1 character. + ''' + actual = pyrizz.get_random_line() + assert isinstance(actual, str), f"Expected get_random_line() to return a str. Instead, it returned a {type(actual)}" + assert len(actual) > 1, f"Expected get_random_line() has at least 1 character. Instead, it returned a string with {len(actual)} characters" + + def test_get_random_categorized_line_invalid(self): + expected = "Please select a valid category." + actual = pyrizz.get_random_categorized_line("") + assert actual == expected, "Expected 'Please select a valid category.' to be returned when invalid category number is selected." + + def test_get_random_categorized_line_not_found(self): + expected = "System error: category not found." + actual = pyrizz.get_random_categorized_line("shoulda&exist") + assert actual == expected, "Expected 'System error: category not found.' to be returned when a should-exist category is not found." + + def test_get_random_categorized_line_str(self): + expected = str + actual = type(pyrizz.get_random_categorized_line("romantic&sweet")) + assert actual == expected, "Expected a string to be returned when a valid category is selected." \ No newline at end of file From 7a839041423126b686c33da4515f89b9e767c23d Mon Sep 17 00:00:00 2001 From: ccczy-czy Date: Wed, 8 Nov 2023 00:11:49 -0500 Subject: [PATCH 49/95] update pipefile --- Pipfile | 5 ++--- Pipfile.lock | 2 +- src/pyrizz/pyrizz.py | 23 ----------------------- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/Pipfile b/Pipfile index 81f60f8..53e0418 100644 --- a/Pipfile +++ b/Pipfile @@ -4,8 +4,7 @@ verify_ssl = true name = "pypi" [packages] -pytest = "*" -pyrizz = {editable = true, path = "."} +pytest = "==7.4.3" pymongo = "==4.6.0" python-dotenv = "==0.16.0" openai = "==0.28.1" @@ -14,4 +13,4 @@ pyrizz = {editable = true, path = "."} [dev-packages] [requires] -python_version = "3" +python_version = "3" \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock index 48a6d45..dda85ff 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "d4e20e705a62e9a1ad44d6cb92d08d21f74697d7b158aee33db1697b3874ece1" + "sha256": "bb68a407d4163a327275c54eac3d6dc3424737e2845b50af29c67bb6eefb8b89" }, "pipfile-spec": 6, "requires": { diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 6ff4b96..3d72271 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -75,28 +75,6 @@ def get_random_categorized_line(category) -> str: return str(err) def get_ai_line(category) -> str: -<<<<<<< HEAD - response = openai.ChatCompletion.create( - model = os.getenv('OPENAI_MODEL'), - messages = - [{"role": "user", "content": f"I need a {category} pick-up line."},] - ) - - message = response.choices[0]['message'] - ai_line = "{}".format(message['content']) - - collection = database['ai_generated'] - - lines = collection.find_one({})["lines"] - - lines.append(ai_line) - - collection.insert_one({ - 'lines': lines - }) - - return ai_line -======= try: if (category != "" and len(category) <= 50): response = openai.ChatCompletion.create( @@ -126,7 +104,6 @@ def get_ai_line(category) -> str: except Exception as err: return str(err) ->>>>>>> b3a609d302225e6f8e9b3027655697eea1683d0d def add_user_line(): templates_file_path = PROJECT_ROOT + '/src/data/templates.json' From 4803ba8a41d09332abc88455d88dbe80dd36bd7f Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 15:32:09 -0500 Subject: [PATCH 50/95] Removed mongodb --- src/data/lines.json | 106 ----------------- src/data/lines.txt | 101 ---------------- src/data/templates.json | 25 ---- src/pyrizz/__main__.py | 32 +++-- src/pyrizz/pickuplines.py | 243 ++++++++++++++++++++++++++++++++++++++ src/pyrizz/pyrizz.py | 162 +++++++------------------ src/scripts/extract.py | 20 ---- src/scripts/mongo-seed.py | 45 ------- 8 files changed, 298 insertions(+), 436 deletions(-) delete mode 100644 src/data/lines.json delete mode 100644 src/data/lines.txt delete mode 100644 src/data/templates.json create mode 100644 src/pyrizz/pickuplines.py delete mode 100644 src/scripts/extract.py delete mode 100644 src/scripts/mongo-seed.py diff --git a/src/data/lines.json b/src/data/lines.json deleted file mode 100644 index 645e2c6..0000000 --- a/src/data/lines.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "lines": [ - "Is it okay if I walk you home? My heart seems to follow wherever you go.\n", - "If beauty were a moment, you'd be an eternity.\n", - "Did we just share an elevator? Because I believe we have some serious uplifted chemistry.\n", - "I must be a snowflake because I've fallen for you.\n", - "Every time I see you, it feels like I've discovered a new shade of color.\n", - "If stars would shine every time I thought of you, the night sky would never be dark.\n", - "Do you believe in love at first sight, or should I walk by again?\n", - "Your voice is my favorite sound, and your name is my favorite noun.\n", - "If I were to rewrite the alphabet, I'd put U and I together.\n", - "Have you been to the doctor recently? Because I think you've got a case of being mesmerizing.\n", - "I wouldn't need a camera to savor this moment; I just need you.\n", - "Is it hot in here, or is it just the aura of warmth you radiate?\n", - "I tried finding the perfect line to make you smile, but then I realized you are the line.\n", - "If you were a vegetable, you'd be a 'cute-cumber.'\n", - "If life was a song, your smile would be the melody that gets stuck in my head.\n", - "I'm not a photographer, but I can surely picture us together.\n", - "If you were a fruit, you'd be a fine-apple.\n", - "I'm not sure if it was the sparkle in your eyes or your radiant smile, but something just lit up my world.\n", - "Do you mind holding my hand? I want to be sure I'm not dreaming.\n", - "I've been trying to tie my shoes, but I can't stop tripping over my thoughts of you.\n", - "Is there a rainbow today? Because I've just found my pot of gold in you.\n", - "Do you have a map? I keep getting lost in your eyes.\n", - "If you were a star, you'd outshine the entire galaxy.\n", - "I'm not a wishful thinker, but with you, I believe in fairy tales.\n", - "I thought happiness started with an H, but mine starts with U.\n", - "Your smile must be a black hole because it's irresistibly attractive.\n", - "Are you Wi-fi? Because I'm feeling a connection.\n", - "If kisses were snowflakes, I'd send you a blizzard.\n", - "Do you have a Band-Aid? I just scraped my knee falling for you.\n", - "Your presence makes my heart race, but it's a marathon I never want to finish.\n", - "If beauty were a crime, you'd be serving a life sentence.\n", - "Did it hurt? When you fell from the stars and landed in my world?\n", - " I'm not a genie, but I can make your dreams come true.\n", - "Every song I hear reminds me of you, even the ones I haven't heard yet.\n", - "I never believed in magic until I saw you.\n", - "If you were words on a page, you'd be the fine print.\n", - " Are you made of copper and tellurium? Because you're Cu-Te.\n", - "Can I follow you? Because my mom told me to follow my dreams.\n", - "Your beauty could inspire poets and artists for generations.\n", - "Do you believe in destiny? Because I think ours just intertwined.\n", - "Are you a calculator? Because every time I look at you, things start adding up.\n", - "Is your name Google? Because you have everything I've been searching for.\n", - "Do you have a name, or can I call you mine?\n", - "Are you a magician? Every time I look at you, everyone else disappears.\n", - "Do you like basketball? Because when I saw you, my heart did a slam dunk.\n", - "Are you a library book? Because I can't help but check you out.\n", - "If you were a vegetable, you'd be a cutecumber.\n", - "Do you have a sunburn or are you always this hot?\n", - "Is your dad a boxer? Because you're a knockout.\n", - "Are you a loan from a bank? Because you have my interest.\n", - "Are you a campfire? Because you're hot and I want s'more.\n", - "Do you have a pencil? Because I want to erase your past and write our future.\n", - "Are you a parking ticket? Because you've got 'FINE' written all over you.\n", - "If I could rearrange the alphabet, I would put U and I together.\n", - "Are you a snowstorm? Because you make my heart race.\n", - "Do you have a Band-Aid? Because I just scraped my knee falling for you.\n", - "Is your dad a baker? Because you're a cutie pie.\n", - "Are you a time traveler? Because I can see you in my future.\n", - "Are you a candle? Because you light up my world.\n", - "Are you a string? Because I can't stop finding myself attached to you.\n", - "If you were a function, I'd call you every day.\n", - "Are you a loop? Because I can't stop thinking about you again and again.\n", - "You're the 'key' to my 'value'.\n", - "If beauty were data, you'd be an overflow error.\n", - "Are you a variable? Because I feel the need to declare my intentions.\n", - "I think you've just incremented my heart's counter.\n", - "You're the API to my application.\n", - "If relationships were algorithms, ours would be a perfect match.\n", - "Your presence makes my system run at optimal efficiency.\n", - "If you were an exception, I'd catch you.\n", - "You must be a compiler because every time I see you, my code becomes runnable.\n", - "I'm not a photographer, but I can picture us in an endless loop together.\n", - "In the world of binary, you are the one for me.\n", - "I've got a lot of lines of code, but none as intriguing as the story of us.\n", - "Forget the cloud, you've taken up all the storage in my heart.\n", - "I don't need version control to know you're my final commit.\n", - "Let's merge our branches and build a beautiful codebase together.\n", - "Do you believe in parallel universes? Because in every one I've imagined, it's always been you and me.\n", - "You must be a packet because I can't help but sniff you out in a crowd.\n", - "Are you an algorithm? Because every part of me wants to solve you.\n", - "Do you know JavaScript? Because you make my heart race asynchronously.\n", - "If I were to traverse the nodes of my heart, every path would lead to you.\n", - "In the Git of life, I'd never want to revert our commit.\n", - "Are you a CSS file? Because without you, my life would be unstyled.\n", - "You must be a bug, because I just can't shake you off my mind.\n", - "If hearts had firewalls, you'd have bypassed mine ages ago.\n", - "Are you a Boolean? Because true or false, my heart points to you.\n", - "In the world of objects, you are my favorite instance.\n", - "If attraction were a programming language, ours would be high-level.\n", - "Are you a kernel? Because my heart feels an urge to dive deeper into you.\n", - "Do you like Java? Because you've Objectified my affections.\n", - "I'd never put our relationship in a try-catch block, because I never want to handle an exception with us. \n", - "You're not just a semicolon; you're the statement that completes me.\n", - "In the IDE of life, you've just become my favorite extension.\n", - "If I were a coder, I'd refactor my life to include more of you.\n", - "You're like the most elegant code I've ever seen; concise, beautiful, and effective.\n", - "You've stolen the ASCII to my heart.\n", - "You must be an exception, because I can't handle you properly.\n", - "You must be an algorithm, because you have my heart running in O(1) time.\n", - "Are you a piece of code? Because you're turning my software into hardware!\n", - "Are you a compressed file? Because when I see you, my heart wants to unzip.\n", - "I'm the RizzLord." - ] -} \ No newline at end of file diff --git a/src/data/lines.txt b/src/data/lines.txt deleted file mode 100644 index 04bb178..0000000 --- a/src/data/lines.txt +++ /dev/null @@ -1,101 +0,0 @@ -Is it okay if I walk you home? My heart seems to follow wherever you go. -If beauty were a moment, you'd be an eternity. -Did we just share an elevator? Because I believe we have some serious uplifted chemistry. -I must be a snowflake because I've fallen for you. -Every time I see you, it feels like I've discovered a new shade of color. -If stars would shine every time I thought of you, the night sky would never be dark. -Do you believe in love at first sight, or should I walk by again? -Your voice is my favorite sound, and your name is my favorite noun. -If I were to rewrite the alphabet, I'd put U and I together. -Have you been to the doctor recently? Because I think you've got a case of being mesmerizing. -I wouldn't need a camera to savor this moment; I just need you. -Is it hot in here, or is it just the aura of warmth you radiate? -I tried finding the perfect line to make you smile, but then I realized you are the line. -If you were a vegetable, you'd be a 'cute-cumber.' -If life was a song, your smile would be the melody that gets stuck in my head. -I'm not a photographer, but I can surely picture us together. -If you were a fruit, you'd be a fine-apple. -I'm not sure if it was the sparkle in your eyes or your radiant smile, but something just lit up my world. -Do you mind holding my hand? I want to be sure I'm not dreaming. -I've been trying to tie my shoes, but I can't stop tripping over my thoughts of you. -Is there a rainbow today? Because I've just found my pot of gold in you. -Do you have a map? I keep getting lost in your eyes. -If you were a star, you'd outshine the entire galaxy. -I'm not a wishful thinker, but with you, I believe in fairy tales. -I thought happiness started with an H, but mine starts with U. -Your smile must be a black hole because it's irresistibly attractive. -Are you Wi-fi? Because I'm feeling a connection. -If kisses were snowflakes, I'd send you a blizzard. -Do you have a Band-Aid? I just scraped my knee falling for you. -Your presence makes my heart race, but it's a marathon I never want to finish. -If beauty were a crime, you'd be serving a life sentence. -Did it hurt? When you fell from the stars and landed in my world? - I'm not a genie, but I can make your dreams come true. -Every song I hear reminds me of you, even the ones I haven't heard yet. -I never believed in magic until I saw you. -If you were words on a page, you'd be the fine print. - Are you made of copper and tellurium? Because you're Cu-Te. -Can I follow you? Because my mom told me to follow my dreams. -Your beauty could inspire poets and artists for generations. -Do you believe in destiny? Because I think ours just intertwined. -Are you a calculator? Because every time I look at you, things start adding up. -Is your name Google? Because you have everything I've been searching for. -Do you have a name, or can I call you mine? -Are you a magician? Every time I look at you, everyone else disappears. -Do you like basketball? Because when I saw you, my heart did a slam dunk. -Are you a library book? Because I can't help but check you out. -If you were a vegetable, you'd be a cutecumber. -Do you have a sunburn or are you always this hot? -Is your dad a boxer? Because you're a knockout. -Are you a loan from a bank? Because you have my interest. -Are you a campfire? Because you're hot and I want s'more. -Do you have a pencil? Because I want to erase your past and write our future. -Are you a parking ticket? Because you've got 'FINE' written all over you. -If I could rearrange the alphabet, I would put U and I together. -Are you a snowstorm? Because you make my heart race. -Do you have a Band-Aid? Because I just scraped my knee falling for you. -Is your dad a baker? Because you're a cutie pie. -Are you a time traveler? Because I can see you in my future. -Are you a candle? Because you light up my world. -Are you a string? Because I can't stop finding myself attached to you. -If you were a function, I'd call you every day. -Are you a loop? Because I can't stop thinking about you again and again. -You're the 'key' to my 'value'. -If beauty were data, you'd be an overflow error. -Are you a variable? Because I feel the need to declare my intentions. -I think you've just incremented my heart's counter. -You're the API to my application. -If relationships were algorithms, ours would be a perfect match. -Your presence makes my system run at optimal efficiency. -If you were an exception, I'd catch you. -You must be a compiler because every time I see you, my code becomes runnable. -I'm not a photographer, but I can picture us in an endless loop together. -In the world of binary, you are the one for me. -I've got a lot of lines of code, but none as intriguing as the story of us. -Forget the cloud, you've taken up all the storage in my heart. -I don't need version control to know you're my final commit. -Let's merge our branches and build a beautiful codebase together. -Do you believe in parallel universes? Because in every one I've imagined, it's always been you and me. -You must be a packet because I can't help but sniff you out in a crowd. -Are you an algorithm? Because every part of me wants to solve you. -Do you know JavaScript? Because you make my heart race asynchronously. -If I were to traverse the nodes of my heart, every path would lead to you. -In the Git of life, I'd never want to revert our commit. -Are you a CSS file? Because without you, my life would be unstyled. -You must be a bug, because I just can't shake you off my mind. -If hearts had firewalls, you'd have bypassed mine ages ago. -Are you a Boolean? Because true or false, my heart points to you. -In the world of objects, you are my favorite instance. -If attraction were a programming language, ours would be high-level. -Are you a kernel? Because my heart feels an urge to dive deeper into you. -Do you like Java? Because you've Objectified my affections. -I'd never put our relationship in a try-catch block, because I never want to handle an exception with us. -You're not just a semicolon; you're the statement that completes me. -In the IDE of life, you've just become my favorite extension. -If I were a coder, I'd refactor my life to include more of you. -You're like the most elegant code I've ever seen; concise, beautiful, and effective. -You’ve stolen the ASCII to my heart. -You must be an exception, because I can’t handle you properly. -You must be an algorithm, because you have my heart running in O(1) time. -Are you a piece of code? Because you’re turning my software into hardware! -Are you a compressed file? Because when I see you, my heart wants to unzip. \ No newline at end of file diff --git a/src/data/templates.json b/src/data/templates.json deleted file mode 100644 index c0b7ee1..0000000 --- a/src/data/templates.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "templates": [ - "Do you have a {}? Because whenever I look at you, everyone else disappears.", - "Are you a {}? Because every time I think of you, I smile.", - "Do you have a map? I keep getting lost in your {}.", - "If beauty were time, you'd be an {}.", - "I'm not a photographer, but I can picture us together in a {}.", - "Can I follow you home? Cause my parents always told me to follow my {}.", - "Is your name Google? Because you have everything I've been searching for in the {}.", - "Are you made of copper and tellurium? Because you're {}.", - "Do you like Star Wars? Because Yoda only one for me in the {}.", - "If you were a {} on a McDonald's menu, you'd be a McGorgeous.", - "Do you have a Band-Aid? Because I just scraped my knee falling for {}.", - "Is it hot in here or is it just the {} we have together?", - "If you were a vegetable, you'd be a {}.", - "I must be a {} because I am attracted to your magnetic field.", - "Is there an airport nearby or is that just my heart taking {}?", - "You must be a magician because whenever I look at you, everyone else {}.", - "If I could rearrange the alphabet, I'd put {} and {} together.", - "Are you a {}? Because you're so fine you blow my mind.", - "Do you have a pencil? Cause I want to erase your past and write our {}.", - "Do you know what my shirt is made of? It's made of boyfriend {}." - ] - } - \ No newline at end of file diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 0aa7fb8..a51b413 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -33,27 +33,25 @@ def main(): if user_input == "1": print("\n" + pyrizz.get_random_line(), end = "\n\n") - if user_input == "2": - category_list = pyrizz.get_dev_line_categories() + elif user_input == "2": print("Select a category: ") - for i, category in enumerate(category_list): - print(f"{i + 1}. {category}") - + print("1 - Romantic") + print("2 - Clever") + print("3 - Geeky") + print("4 - User Submitted") category_index = input("> ") - category_index = int(category_index) if category_index.isdigit() else 4 - category_val = '' + category_index = int(category_index) if category_index in range(1, 4): - category_val = category_list[category_index - 1] - print("\n" + pyrizz.get_random_categorized_line(category_val), end = "\n\n") - - if user_input == "1": - # Some execution - pass + if(category_index == 1): + category_val = "romantic_lines" + elif(category_index == 2): + category_val = "clever_lines" + elif(category_index == 3): + category_val = "geeky_lines" + elif(category_index == 4): + category_val = "user_lines" + print("\n" + pyrizz.get_random_category_line(category_val), end = "\n\n") - elif user_input == "2": - # Some execution - pass - elif user_input == "3": print("Enter a category / language: ") category = input("> ") diff --git a/src/pyrizz/pickuplines.py b/src/pyrizz/pickuplines.py new file mode 100644 index 0000000..77edec3 --- /dev/null +++ b/src/pyrizz/pickuplines.py @@ -0,0 +1,243 @@ + +dev_lines = [ + "Is it okay if I walk you home? My heart seems to follow wherever you go.\n", + "If beauty were a moment, you'd be an eternity.\n", + "Did we just share an elevator? Because I believe we have some serious uplifted chemistry.\n", + "I must be a snowflake because I've fallen for you.\n", + "Every time I see you, it feels like I've discovered a new shade of color.\n", + "If stars would shine every time I thought of you, the night sky would never be dark.\n", + "Do you believe in love at first sight, or should I walk by again?\n", + "Your voice is my favorite sound, and your name is my favorite noun.\n", + "If I were to rewrite the alphabet, I'd put U and I together.\n", + "Have you been to the doctor recently? Because I think you've got a case of being mesmerizing.\n", + "I wouldn't need a camera to savor this moment; I just need you.\n", + "Is it hot in here, or is it just the aura of warmth you radiate?\n", + "I tried finding the perfect line to make you smile, but then I realized you are the line.\n", + "If you were a vegetable, you'd be a 'cute-cumber.'\n", + "If life was a song, your smile would be the melody that gets stuck in my head.\n", + "I'm not a photographer, but I can surely picture us together.\n", + "If you were a fruit, you'd be a fine-apple.\n", + "I'm not sure if it was the sparkle in your eyes or your radiant smile, but something just lit up my world.\n", + "Do you mind holding my hand? I want to be sure I'm not dreaming.\n", + "I've been trying to tie my shoes, but I can't stop tripping over my thoughts of you.\n", + "Is there a rainbow today? Because I've just found my pot of gold in you.\n", + "Do you have a map? I keep getting lost in your eyes.\n", + "If you were a star, you'd outshine the entire galaxy.\n", + "I'm not a wishful thinker, but with you, I believe in fairy tales.\n", + "I thought happiness started with an H, but mine starts with U.\n", + "Your smile must be a black hole because it's irresistibly attractive.\n", + "Are you Wi-fi? Because I'm feeling a connection.\n", + "If kisses were snowflakes, I'd send you a blizzard.\n", + "Do you have a Band-Aid? I just scraped my knee falling for you.\n", + "Your presence makes my heart race, but it's a marathon I never want to finish.\n", + "If beauty were a crime, you'd be serving a life sentence.\n", + "Did it hurt? When you fell from the stars and landed in my world?\n", + " I'm not a genie, but I can make your dreams come true.\n", + "Every song I hear reminds me of you, even the ones I haven't heard yet.\n", + "I never believed in magic until I saw you.\n", + "If you were words on a page, you'd be the fine print.\n", + " Are you made of copper and tellurium? Because you're Cu-Te.\n", + "Can I follow you? Because my mom told me to follow my dreams.\n", + "Your beauty could inspire poets and artists for generations.\n", + "Do you believe in destiny? Because I think ours just intertwined.\n", + "Are you a calculator? Because every time I look at you, things start adding up.\n", + "Is your name Google? Because you have everything I've been searching for.\n", + "Do you have a name, or can I call you mine?\n", + "Are you a magician? Every time I look at you, everyone else disappears.\n", + "Do you like basketball? Because when I saw you, my heart did a slam dunk.\n", + "Are you a library book? Because I can't help but check you out.\n", + "If you were a vegetable, you'd be a cutecumber.\n", + "Do you have a sunburn or are you always this hot?\n", + "Is your dad a boxer? Because you're a knockout.\n", + "Are you a loan from a bank? Because you have my interest.\n", + "Are you a campfire? Because you're hot and I want s'more.\n", + "Do you have a pencil? Because I want to erase your past and write our future.\n", + "Are you a parking ticket? Because you've got 'FINE' written all over you.\n", + "If I could rearrange the alphabet, I would put U and I together.\n", + "Are you a snowstorm? Because you make my heart race.\n", + "Do you have a Band-Aid? Because I just scraped my knee falling for you.\n", + "Is your dad a baker? Because you're a cutie pie.\n", + "Are you a time traveler? Because I can see you in my future.\n", + "Are you a candle? Because you light up my world.\n", + "Are you a string? Because I can't stop finding myself attached to you.\n", + "If you were a function, I'd call you every day.\n", + "Are you a loop? Because I can't stop thinking about you again and again.\n", + "You're the 'key' to my 'value'.\n", + "If beauty were data, you'd be an overflow error.\n", + "Are you a variable? Because I feel the need to declare my intentions.\n", + "I think you've just incremented my heart's counter.\n", + "You're the API to my application.\n", + "If relationships were algorithms, ours would be a perfect match.\n", + "Your presence makes my system run at optimal efficiency.\n", + "If you were an exception, I'd catch you.\n", + "You must be a compiler because every time I see you, my code becomes runnable.\n", + "I'm not a photographer, but I can picture us in an endless loop together.\n", + "In the world of binary, you are the one for me.\n", + "I've got a lot of lines of code, but none as intriguing as the story of us.\n", + "Forget the cloud, you've taken up all the storage in my heart.\n", + "I don't need version control to know you're my final commit.\n", + "Let's merge our branches and build a beautiful codebase together.\n", + "Do you believe in parallel universes? Because in every one I've imagined, it's always been you and me.\n", + "You must be a packet because I can't help but sniff you out in a crowd.\n", + "Are you an algorithm? Because every part of me wants to solve you.\n", + "Do you know JavaScript? Because you make my heart race asynchronously.\n", + "If I were to traverse the nodes of my heart, every path would lead to you.\n", + "In the Git of life, I'd never want to revert our commit.\n", + "Are you a CSS file? Because without you, my life would be unstyled.\n", + "You must be a bug, because I just can't shake you off my mind.\n", + "If hearts had firewalls, you'd have bypassed mine ages ago.\n", + "Are you a Boolean? Because true or false, my heart points to you.\n", + "In the world of objects, you are my favorite instance.\n", + "If attraction were a programming language, ours would be high-level.\n", + "Are you a kernel? Because my heart feels an urge to dive deeper into you.\n", + "Do you like Java? Because you've Objectified my affections.\n", + "I'd never put our relationship in a try-catch block, because I never want to handle an exception with us. \n", + "You're not just a semicolon; you're the statement that completes me.\n", + "In the IDE of life, you've just become my favorite extension.\n", + "If I were a coder, I'd refactor my life to include more of you.\n", + "You're like the most elegant code I've ever seen; concise, beautiful, and effective.\n", + "You've stolen the ASCII to my heart.\n", + "You must be an exception, because I can't handle you properly.\n", + "You must be an algorithm, because you have my heart running in O(1) time.\n", + "Are you a piece of code? Because you're turning my software into hardware!\n", + "Are you a compressed file? Because when I see you, my heart wants to unzip.\n", + "I'm the RizzLord." +] + +romantic_lines = [ + "Is it okay if I walk you home? My heart seems to follow wherever you go.", + "If beauty were a moment, you'd be an eternity.", + "Every time I see you, it feels like I've discovered a new shade of color", + "If stars would shine every time I thought of you, the night sky would glisten.", + "Do you believe in love at first sight, or should I walk by again?", + "Your voice is my favorite sound, and your name is my favorite noun.", + "If I were to rewrite the alphabet, I'd put U and I together.", + "I wouldn't need a camera to savor this moment; I just need you.", + "Every song I hear reminds me of you, even the ones I haven't heard yet…", + "I never believed in magic until I saw you.", + "Your beauty could inspire poets and artists for generations.", + "Do you believe in destiny? Because I think ours just intertwined.", + "Your presence makes my heart race, but it's a marathon I never want to…", + "If beauty were a crime, you'd be serving a life sentence.", + "Every time I look at you, I believe in fairy tales.", + "Thought happiness started with an H, but mine starts with U.", + "Are you Wi-fi? Because I'm feeling a connection.", + "Do you have a Band-Aid? I just scraped my knee falling for you.", + "Is there a rainbow today? Because I've just found my pot of gold in you", + "If you were a star, you'd outshine the entire galaxy.", + "If kisses were snowflakes, I'd send you a blizzard.", + "Your smile must be a black hole because it's irresistibly attractive.", + "If you were words on a page, you'd be the fine print.", + "Can I follow you? Because my mom told me to follow my dreams.", + "Is your name Google? Because you have everything I've been searching for you", + "Do you have a name, or can I call you mine?", + "Are you a library book? Because I can't help but check you out.", + "Do you have a pencil? Because I want to erase your past and write our future", + "Is your dad a baker? Because you're a cutie pie.", + "Are you a candle? Because you light up my world.", + "Are you a string? Because I can't stop finding myself attached to you.", + "If you were a function, I'd call you every day.", + "Are you a loop? Because I can't stop thinking about you again and again", +] + +clever_lines = [ + "Did we just share an elevator? Because I believe we have some serious …", + "I must be a snowflake because I've fallen for you." + "I tried finding the perfect line to make you smile, but then I realize…", + "If you were a vegetable, you'd be a 'cute-cumber.'", + "If life was a song, your smile would be the melody that gets stuck in …", + "Is it hot in here, or is it just the aura of warmth you radiate?", + "I've been trying to tie my shoes, but I can't stop tripping over my th…", + "Do you have a map? I keep getting lost in your eyes.", + "Did it hurt? When you fell from the stars and landed in my world?", + "I'm not a genie, but I can make your dreams come true.", + "Are you made of copper and tellurium? Because you're Cu-Te.", + "Are you a magician? Every time I look at you, everyone else disappears…", + "Do you like basketball? Because when I saw you, my heart did a slam du…", + "If you were a vegetable, you'd be a cutecumber.", + "Do you have a sunburn, or are you always this hot?", + "Is your dad a boxer? Because you're a knockout.", + "Are you a loan from a bank? Because you have my interest.", + "Are you a campfire? Because you're hot and I want s'more.", + "Are you a parking ticket? Because you've got 'FINE' written all over y…", + "Are you a snowstorm? Because you make my heart race.", + "Are you a time traveler? Because I can see you in my future.", +] + +geeky_lines = [ + "You're the 'key' to my 'value'.", + "If beauty were data, you'd be an overflow error.", + "Are you a variable? Because I feel the need to declare my intentions.", + "I think you've just incremented my heart's counter.", + "You're the API to my application.", + "If relationships were algorithms, ours would be a perfect match.", + "Your presence makes my system run at optimal efficiency.", + "If you were an exception, I'd catch you.", + "You must be a compiler because every time I see you, my code becomes r…", + "I'm not a photographer, but I can picture us in an endless loop togeth…", + "In the world of binary, you are the one for me.", + "I've got a lot of lines of code, but none as intriguing as the story o…", + "Forget the cloud, you've taken up all the storage in my heart.", + "I don't need version control to know you're my final commit.", + "Let's merge our branches and build a beautiful codebase together.", + "Do you believe in parallel universes? Because in every one I've imagin…", + "You must be a packet because I can't help but sniff you out in a crowd…", + "Are you an algorithm? Because every part of me wants to solve you.", + "Do you know JavaScript? Because you make my heart race asynchronously.", + "If I were to traverse the nodes of my heart, every path would lead to …", + "In the Git of life, I'd never want to revert our commit.", + "Are you a CSS file? Because without you, my life would be unstyled.", + "You must be a bug, because I just can't shake you off my mind.", + "If hearts had firewalls, you'd have bypassed mine ages ago.", + "Are you a Boolean? Because true or false, my heart points to you.", + "In the world of objects, you are my favorite instance.", + "If attraction were a programming language, ours would be high-level.", + "Are you a kernel? Because my heart feels an urge to dive deeper into y…", + "Do you like Java? Because you've Objectified my affections.", + "I'd never put our relationship in a try-catch block, because I never w…", + "You're not just a semicolon; you're the statement that completes me.", + "In the IDE of life, you've just become my favorite extension.", + "If I were a coder, I'd refactor my life to include more of you.", + "You're like the most elegant code I've ever seen; concise, beautiful, …", + "You have stolen the ASCII to my heart.", + "You must be an exception, because I can't handle you properly.", + "You must be an algorithm, because you have my heart running in O(1) ti…", + "Are you a piece of code? Because you're turning my software into hardw…", + "Are you a compressed file? Because when I see you, my heart wants to u…" +] + +templates = [ + "Do you have a {}? Because whenever I look at you, everyone else disappears.", + "Are you a {}? Because every time I think of you, I smile.", + "Do you have a map? I keep getting lost in your {}.", + "If beauty were time, you'd be an {}.", + "I'm not a photographer, but I can picture us together in a {}.", + "Can I follow you home? Cause my parents always told me to follow my {}.", + "Is your name Google? Because you have everything I've been searching for in the {}.", + "Are you made of copper and tellurium? Because you're {}.", + "Do you like Star Wars? Because Yoda only one for me in the {}.", + "If you were a {} on a McDonald's menu, you'd be a McGorgeous.", + "Do you have a Band-Aid? Because I just scraped my knee falling for {}.", + "Is it hot in here or is it just the {} we have together?", + "If you were a vegetable, you'd be a {}.", + "I must be a {} because I am attracted to your magnetic field.", + "Is there an airport nearby or is that just my heart taking {}?", + "You must be a magician because whenever I look at you, everyone else {}.", + "If I could rearrange the alphabet, I'd put {} and {} together.", + "Are you a {}? Because you're so fine you blow my mind.", + "Do you have a pencil? Cause I want to erase your past and write our {}.", + "Do you know what my shirt is made of? It's made of boyfriend {}." +] + +user_lines = [] + +pickuplines = { + 'dev_lines': dev_lines, + 'romantic_lines': romantic_lines, + 'clever_lines': clever_lines, + 'geeky_lines': geeky_lines, + 'user_lines': user_lines, + 'all': dev_lines + romantic_lines + clever_lines + geeky_lines + user_lines +} + +user_templates = templates \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 3d72271..24e45af 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -1,78 +1,29 @@ import os -from random import randint +import random import pathlib import json -from pymongo import MongoClient from dotenv import load_dotenv -from bson.objectid import ObjectId import openai +from pyrizz.pickuplines import pickuplines, user_templates load_dotenv() - -client = MongoClient(os.getenv('MONGO_URI')) openai.api_key = os.getenv('OPENAI_API_KEY') -PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." -print(os.getenv('MONGO_DBNAME')) - -# Checks if the connection has been made, else make an error printout -try: - client.admin.command('ping') - database = client[os.getenv('MONGO_DBNAME')] - print('*****') - -except Exception as err: - print('* "Failed to connect to MongoDB at', os.getenv('MONGO_URI')) - print('Database connection error:', err) - -collection = database['dev_lines'] - -def get_dev_lines() -> dict: - collection = database['dev_lines'] - - dev_lines = collection.find_one({"_id": ObjectId('6549de9a01c853780b3d5c40')}) - - return dev_lines - -def get_dev_line_categories() -> list: - dev_lines = get_dev_lines() - - category_list = list(dev_lines.keys()) - category_list.pop(0) - return category_list - -def get_random_line() -> str: - dev_lines = get_dev_lines() - - category_list = get_dev_line_categories() - - random_category = category_list[randint(0, len(category_list) - 1)] - category_size = len(dev_lines[random_category]) - random_number = randint(0, category_size - 1) - - line = dev_lines[random_category][random_number] - - return line +def get_lines(category='all'): + if category not in pickuplines: + print("Category does not exist!") + return -def get_random_categorized_line(category) -> str: - try: - if category != "" and (category in get_dev_line_categories()): - dev_lines = get_dev_lines() + else: + return pickuplines[category] - category_size = len(dev_lines[category]) - random_number = randint(0, category_size - 1) +def get_random_line(): + allpickuplines = get_lines('all') + return random.choice(allpickuplines) - line = dev_lines[category][random_number] - - return line - - if category != "" and (category not in get_dev_line_categories()): - return "System error: category not found." - - return "Please select a valid category." - - except Exception as err: - return str(err) +def get_random_category_line(category='all'): + category_pickupline = get_lines(category) + return random.choice(category_pickupline) def get_ai_line(category) -> str: try: @@ -85,15 +36,6 @@ def get_ai_line(category) -> str: message = response.choices[0]['message'] ai_line = "{}".format(message['content']) - - collection = database['ai_generated'] - lines = collection.find_one({})["lines"] - lines.append(ai_line) - - collection.insert_one({ - 'lines': lines - }) - return ai_line elif (category != "" and len(category) > 50): @@ -105,33 +47,38 @@ def get_ai_line(category) -> str: except Exception as err: return str(err) -def add_user_line(): - templates_file_path = PROJECT_ROOT + '/src/data/templates.json' - +def rate_line(pickup_line) -> str: try: - with open(templates_file_path, 'r', encoding='utf-8') as file: - templates = json.load(file)["templates"] - except json.JSONDecodeError as e: - print(f"Error decoding JSON: {e}") - return - except FileNotFoundError: - print(f"The file {templates_file_path} was not found.") - return - except Exception as e: - print(f"An unexpected error occurred: {e}") - return + if (pickup_line != ""): + response = openai.ChatCompletion.create( + model = os.getenv('OPENAI_MODEL'), + messages = + [{"role": "user", "content": f"Rate this pickup line out of 10: {pickup_line} In your response, STRICTLY follow the format of (nothing else): rating/10 - snazzy comment."},] + ) + + message = response.choices[0]['message'] + ai_rating_response = "{}".format(message['content']) + return ai_rating_response + + else: + return "No pickup line? You gotta use our other features before you come here buddy." + + except Exception as err: + return str(err) +def add_user_line(): + pickupline_templates = user_templates print("Choose a template number (1-20):") try: template_number = int(input("> ")) - 1 - if not (0 <= template_number < len(templates)): + if not (0 <= template_number < len(user_templates)): print("Template number out of range. Please choose between 1 and 20.") return except ValueError: print("Please enter a valid number.") return - template_to_show = templates[template_number] + template_to_show = pickupline_templates[template_number] placeholders_count = template_to_show.count("{}") placeholder_representation = ['______'] * placeholders_count print("Fill in the blanks for the following template:") @@ -142,7 +89,7 @@ def add_user_line(): words = [word.strip() for word in words] try: - user_line = templates[template_number].format(*words) + user_line = pickupline_templates[template_number].format(*words) except IndexError: print("Not enough words provided for the placeholders.") return @@ -151,19 +98,10 @@ def add_user_line(): return if is_line_valid(user_line): - try: - collection = database['user_lines'] - insert_result = collection.insert_one({'line': user_line}) - - if insert_result.inserted_id: - print("Here's your custom pick-up line:") - print(user_line) - print("Line added to the database successfully!") - else: - print("Failed to add line to the database.") - - except Exception as e: - print(f"An error occurred while inserting the line into the database: {e}") + print("Here's your custom pick-up line:") + print(user_line) + pickuplines['user_lines'].append(user_line) + print("Nice! Your line was added!") else: print("Your pick-up line doesn't pass our checks.") @@ -198,23 +136,3 @@ def is_offensive(text): except Exception as e: print(f"An unexpected error occurred when checking for offensive content: {e}") return False - - -def rate_line(pickup_line) -> str: - try: - if (pickup_line != ""): - response = openai.ChatCompletion.create( - model = os.getenv('OPENAI_MODEL'), - messages = - [{"role": "user", "content": f"Rate this pickup line out of 10: {pickup_line} In your response, STRICTLY follow the format of (nothing else): rating/10 - snazzy comment."},] - ) - - message = response.choices[0]['message'] - ai_rating_response = "{}".format(message['content']) - return ai_rating_response - - else: - return "No pickup line? You gotta use our other features before you come here buddy." - - except Exception as err: - return str(err) \ No newline at end of file diff --git a/src/scripts/extract.py b/src/scripts/extract.py deleted file mode 100644 index 3f780f0..0000000 --- a/src/scripts/extract.py +++ /dev/null @@ -1,20 +0,0 @@ -# Script to read text data from lines.txt and organizes it into a dictionary as an output of JSON data for MongoDB -import json -import pathlib - -PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." - -file_lines = [] - -with open(f'{PROJECT_ROOT}/src/data/lines.txt', 'r') as file: - file_lines = file.readlines() - -d = { - 'lines': [] -} - -for line in file_lines: - d['lines'].append(line) - -with open(f'{PROJECT_ROOT}/src/data/lines.json', 'w') as file: - json.dump(d, file) \ No newline at end of file diff --git a/src/scripts/mongo-seed.py b/src/scripts/mongo-seed.py deleted file mode 100644 index 817da33..0000000 --- a/src/scripts/mongo-seed.py +++ /dev/null @@ -1,45 +0,0 @@ -# Script which extracts the pickup lines from the JSON extracted file and inserts it into the MongoDB database. - -from pymongo import MongoClient -import os -from dotenv import load_dotenv -import json -import pathlib - -load_dotenv() - -PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." - -# Establish a database connection with the MONGO_URI (MongoDB Atlas connection) -client = MongoClient(os.getenv('MONGO_URI')) - -# Checks if the connection has been made, else make an error printout -try: - client.admin.command('ping') - database = client[os.getenv('MONGO_DBNAME')] - print('* Connected to MongoDB!') - -except Exception as err: - print('* "Failed to connect to MongoDB at', os.getenv('MONGO_URI')) - print('Database connection error:', err) - -lines = [] - -with open(f'{PROJECT_ROOT}/src/data/lines.json', 'r') as file: - data = json.load(file) - lines = data['lines'] - -collection_dev_lines = database['dev_lines'] -collection_dev_lines.drop() - -collection_dev_lines.insert_one({ - 'lines': lines -}) - -collection_ai_generated = database['ai_generated'] - -collection_ai_generated.insert_one({ - 'lines': [] -}) - -client.close() \ No newline at end of file From bb47b2a9734fc794fbe01a1e3048ff718ac58a06 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 16:00:43 -0500 Subject: [PATCH 51/95] added tests --- tests/test_pyrizz.py | 295 ++++++++++++++----------------------------- 1 file changed, 93 insertions(+), 202 deletions(-) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 33fa6f4..376249f 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -5,231 +5,122 @@ from unittest.mock import Mock, patch from unittest.mock import patch, MagicMock, mock_open import openai - sys.path.append(f"{pathlib.Path(__file__).parent.resolve()}/../src") - from pyrizz import pyrizz -class Tests: - # An example of a pytest fixture - a function that can be used for setup and teardown before and after test functions are run. - @pytest.fixture - def example_fixture(self): - yield - - # Test debugging... making sure that we can run a simple test that always passes. - def test_sanity_check(self, example_fixture): - expected = True - actual = True - assert actual == expected, "Expected True to be equal to True!" - - def test_get_dev_lines_dict(self): - ''' - Verify get_dev_lines() returns a dict. - ''' - actual = pyrizz.get_dev_lines() - assert isinstance(actual, dict), f"Expected get_dev_lines() to return a dict. Instead, it returned a {type(actual)}" - - def test_get_dev_lines_nonempty(self): - ''' - Verify get_dev_lines() returns a non-empty dict. - ''' - actual = pyrizz.get_dev_lines() - assert isinstance(actual, dict), f"Expected get_dev_lines() to return a dict. Instead, it returned a {type(actual)}" - assert bool(actual) is True, f"Expected get_dev_lines() not to be empty. Instead, it returned a dict with {len(actual.keys())} keys and {len(actual.values())} values" - - def test_get_dev_lines_three_categories(self): - ''' - Verify get_dev_lines() returns a dict with three categories: 'romantic&sweet', 'clever&playful', 'technical&geeky'. - ''' - actual = pyrizz.get_dev_lines() - assert isinstance(actual, dict), f"Expected get_dev_lines() to return a dict. Instead, it returned a {type(actual)}" - assert ('romantic&sweet' in actual) is True, f"Expected get_dev_lines() to have key 'romantic&sweet'. Instead, it returned a dict with{'' if ('romantic&sweet' in actual) is True else 'out'} key 'romantic&sweet'" - assert ('clever&playful' in actual) is True, f"Expected get_dev_lines() to have key 'clever&playful'. Instead, it returned a dict with{'' if ('clever&playful' in actual) is True else 'out'} key 'clever&playful'" - assert ('technical&geeky' in actual) is True, f"Expected get_dev_lines() to have key 'technical&geeky'. Instead, it returned a dict with{'' if ('technical&geeky' in actual) is True else 'out'} key 'technical&geeky'" - - def test_get_dev_line_categories_list(self): - ''' - Verify get_dev_line_categories() returns a list. - ''' - actual = pyrizz.get_dev_line_categories() - assert isinstance(actual, list), f"Expected get_dev_line_categories() to return a list. Instead, it returned a {type(actual)}" - - def test_get_dev_line_categories_nonempty(self): - ''' - Verify get_dev_line_categories() returns a non-empty list. - ''' - actual = pyrizz.get_dev_line_categories() - assert isinstance(actual, list), f"Expected get_dev_line_categories() to return a list. Instead, it returned a {type(actual)}" - assert len(actual) > 0, f"Expected get_dev_line_categories() not to be empty. Instead, it returned a list with {len(actual)} elements" - - def test_get_dev_line_categories_three_categories(self): - ''' - Verify get_dev_line_categories() returns a list with three values: 'romantic&sweet', 'clever&playful', 'technical&geeky'. - ''' - actual = pyrizz.get_dev_line_categories() - assert isinstance(actual, list), f"Expected get_dev_line_categories() to return a list. Instead, it returned a {type(actual)}" - assert ('romantic&sweet' in actual) is True, f"Expected get_dev_line_categories() to have element 'romantic&sweet'. Instead, it returned a list with{'' if ('romantic&sweet' in actual) is True else 'out'} value 'romantic&sweet'" - assert ('clever&playful' in actual) is True, f"Expected get_dev_line_categories() to have element 'clever&playful'. Instead, it returned a list with{'' if ('clever&playful' in actual) is True else 'out'} value 'clever&playful'" - assert ('technical&geeky' in actual) is True, f"Expected get_dev_line_categories() to have element 'technical&geeky'. Instead, it returned a list with{'' if ('technical&geeky' in actual) is True else 'out'} value 'technical&geeky'" +class Tests: + + # Tests if this returns a list + def test_get_lines_list(self): + actual = pyrizz.get_lines('all') + assert isinstance(actual, list) + + # Tests if this returns an empty or not a proper category + def test_get_lines_nonempty(self): + actual = pyrizz.get_lines() + assert isinstance(actual, dict) + assert bool(actual) + + # Tests if this returns a string def test_get_random_line_str(self): - ''' - Verify get_random_line() returns a str. - ''' actual = pyrizz.get_random_line() - assert isinstance(actual, str), f"Expected get_random_line() to return a str. Instead, it returned a {type(actual)}" + assert isinstance(actual, str) + # Tests if the get random line is a non-empty value def test_get_random_line_nonempty(self): - ''' - Verify get_random_line() returns a non-empty str. - ''' actual = pyrizz.get_random_line() - assert isinstance(actual, str), f"Expected get_random_line() to return a str. Instead, it returned a {type(actual)}" - assert len(actual) > 0, f"Expected get_random_line() not to be empty. Instead, it returned a string with {len(actual)} characters" + assert isinstance(actual, str) + assert len(actual) > 0 + + # Tests if the get random line is a empty value + def test_get_random_line_empty(self): + actual = pyrizz.get_random_line() + assert isinstance(actual, str) + assert bool(actual) + # Tests if the get random line is long enough def test_get_random_line_long_enough(self): - ''' - Verify get_random_line() returns a sentence longer than 1 character. - ''' actual = pyrizz.get_random_line() - assert isinstance(actual, str), f"Expected get_random_line() to return a str. Instead, it returned a {type(actual)}" - assert len(actual) > 1, f"Expected get_random_line() has at least 1 character. Instead, it returned a string with {len(actual)} characters" + assert isinstance(actual, str) + assert len(actual) > 1 - def test_get_random_categorized_line_invalid(self): - expected = "Please select a valid category." - actual = pyrizz.get_random_categorized_line("") - assert actual == expected, "Expected 'Please select a valid category.' to be returned when invalid category number is selected." - - def test_get_random_categorized_line_not_found(self): - expected = "System error: category not found." - actual = pyrizz.get_random_categorized_line("shoulda&exist") - assert actual == expected, "Expected 'System error: category not found.' to be returned when a should-exist category is not found." - - def test_get_random_categorized_line_str(self): - expected = str - actual = type(pyrizz.get_random_categorized_line("romantic&sweet")) - assert actual == expected, "Expected a string to be returned when a valid category is selected." - # Tests for get_ai_line function. + + # Tests if this returns a string + def test_get_random_category_line_str(self): + actual = pyrizz.get_random_category_line("romantic_lines") + assert isinstance(actual, str) + + # Tests if the get random category line is a non-empty value + def test_get_random_category_line_nonempty(self): + actual = pyrizz.get_random_category_line("romanctic_lines") + assert isinstance(actual, str) + assert len(actual) > 0 + + # Tests if the get random cateogory line is a empty value + def test_get_random_category_line_empty(self): + actual = pyrizz.get_random_category_line() + assert isinstance(actual, str) + assert bool(actual) + + # Tests if the get random line is long enough + def test_get_random_category_line_longenough(self): + actual = pyrizz.get_random_category_line("romanctic_lines") + assert isinstance(actual, str) + assert len(actual) > 0 + + + # Tests if the input for ai line is empty def test_get_ai_line_empty(self): - expected = "Please specify a category." actual = pyrizz.get_ai_line("") - assert actual == expected, "Expected 'Please specify a category.' to be returned when no category is specified." - + assert actual == "Please specify a category" + + # Tests if the input is way too long def test_get_ai_line_long(self): - expected = "Please specify a category that is less than 50 characters." actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.") - assert actual == expected, "Expected 'Please specify a category that is less than 50 characters.' to be returned when a category that is more than 50 characters long is specified." + assert actual == "Please specify a category that is less than 50 characters" + # Tests if the input for ai line actually results in a string def test_get_ai_line_str(self): - expected = str - actual = type(pyrizz.get_ai_line("test")) - assert actual == expected, "Expected a string to be returned when a category is specified." - - # Fixture for mocking open() - @pytest.fixture - def mock_open_json(self, monkeypatch): - data = {"templates": ["Here is a {}, and here is another {}."]} - mock_file = mock_open(read_data=str(data)) - monkeypatch.setattr("builtins.open", mock_file) - - # Fixture for mocking json.load() - @pytest.fixture - def mock_json_load(self, monkeypatch): - data = {"templates": ["Here is a {}, and here is another {}."]} - monkeypatch.setattr("json.load", lambda x: data) - - # Fixture for mocking MongoDB insert_one - @pytest.fixture - def mock_insert_one(self, monkeypatch): - def mock(*args, **kwargs): - return MagicMock(inserted_id=1) - monkeypatch.setattr("pymongo.collection.Collection.insert_one", mock) - - # Fixtures for mocking user input as numbers - @pytest.fixture - def mock_input(self, monkeypatch): - inputs = iter(["1", "test, input"]) - monkeypatch.setattr("builtins.input", lambda x: next(inputs)) - - @pytest.fixture - def mock_input_value_error(self, monkeypatch): - monkeypatch.setattr('builtins.input', lambda _: 'not a number') - - # Fixture for handling openai - @pytest.fixture - def mock_openai_offensive(self, monkeypatch): - monkeypatch.setattr(openai.Completion, 'create', Mock(return_value={ - "choices": [{"text": "2"}] # "2" simulates offensive content - })) - - @pytest.fixture - def mock_openai_error(self, monkeypatch): - def openai_error(*args, **kwargs): - raise openai.error.OpenAIError("Test error") - monkeypatch.setattr(openai.Completion, 'create', openai_error) - - # Tests for add_user_line() function - def test_add_user_line_success(self, mock_open_json, mock_json_load, mock_insert_one, mock_input, capsys): - pyrizz.add_user_line() + actual = pyrizz.get_ai_line("test") + assert isinstance(actual, str) + + + # Tests if the rate line is empty + def test_rate_line_empty(self): + actual = pyrizz.rate_line("") + assert actual == "No pickup line? You gotta use our other features before you come here buddy" + + # Tests if the rate line function follows a specific format + def test_rate_line_format(self): + actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") + assert re.match(r'\d+/10 - .+', actual) is not None + + + def test_add_user_line_invalid_template_number(self, capsys): + with pytest.raises(SystemExit): + with pytest.raises(SystemExit): + pyrizz.add_user_line() captured = capsys.readouterr() - assert "Here's your custom pick-up line:" in captured.out - - def test_add_user_line_invalid_template_number(self, mock_open_json, mock_json_load, capsys): - with patch('builtins.input', side_effect=["21", "exit"]): - pyrizz.add_user_line() - captured = capsys.readouterr() - assert "Template number out of range. Please choose between 1 and 20." in captured.out - - def test_add_user_line_not_enough_words(self, mock_open_json, mock_json_load, capsys): - with patch('builtins.input', side_effect=["1", "test"]): - pyrizz.add_user_line() - captured = capsys.readouterr() - assert "Not enough words provided for the placeholders." in captured.out - - def test_add_user_line_json_error(self, monkeypatch, capsys): - m = mock_open() - m.side_effect = FileNotFoundError("The file was not found.") - monkeypatch.setattr("builtins.open", m) - - pyrizz.add_user_line() + assert "Template number out of range. Please choose between 1 and 20." in captured.out + + def test_add_user_line_not_enough_words(self, capsys): + with pytest.raises(SystemExit): + with pytest.raises(SystemExit): + pyrizz.add_user_line() captured = capsys.readouterr() - assert "templates.json was not found" in captured.out - - # Tests for user input validation + assert "Not enough words provided for the placeholders." in captured.out + def test_is_line_valid_length(self): - long_line = "x" * 141 - assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." + long_line = "x" * 141 + assert not pyrizz.is_line_valid(long_line) - def test_is_offensive_detection(self, mock_openai_offensive): + def test_is_offensive_detection(self, monkeypatch): + monkeypatch.setattr(pyrizz, "is_offensive", Mock(return_value=True)) offensive_line = "An example offensive line" - assert pyrizz.is_offensive(offensive_line) is True, "Expected the line to be flagged as offensive." + assert pyrizz.is_offensive(offensive_line) - def test_is_offensive_openai_error_handling(self, mock_openai_error): + def test_is_offensive_openai_error_handling(self, monkeypatch): + monkeypatch.setattr(pyrizz, "is_offensive", Mock(side_effect=Exception("Test error"))) line = "This should cause an OpenAIError" - assert pyrizz.is_offensive(line) is False, "Expected to return False when an OpenAIError occurs." - - def test_add_user_line_value_error(self, mock_input_value_error, capsys): - with patch('builtins.input', side_effect=["not a number", "exit"]): - pyrizz.add_user_line() - captured = capsys.readouterr() - assert "Please enter a valid number." in captured.out - - # Testing for the rate line functionality - def test_rate_line_empty(self, example_fixture): - pickup_line = "" - expected_response = "No pickup line? You gotta use our other features before you come here buddy." - actual_response = pyrizz.rate_line(pickup_line) - assert actual_response == expected_response - - def test_rate_line(self, example_fixture): - pickup_line = "Do you come with Wi-Fi? Because I'm really feeling a connection." - actual_response = pyrizz.rate_line(pickup_line) - - # Define a regular expression pattern for expected response format - # In this case, the expected pattern response is a number/10 - some characters as a response. - expected_pattern = r'\d+/10 - .+' - - # Check if the actual response matches the expected pattern - assert re.match(expected_pattern, actual_response) is not None - -# pytest tests/test_pyrizz.py + assert not pyrizz.is_offensive(line) From 084cbb7c2a2115318d0028d4ed6841ad43bc6275 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 16:29:06 -0500 Subject: [PATCH 52/95] Tests... --- tests/test_pyrizz.py | 45 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 376249f..42db9a1 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -18,8 +18,8 @@ def test_get_lines_list(self): # Tests if this returns an empty or not a proper category def test_get_lines_nonempty(self): actual = pyrizz.get_lines() - assert isinstance(actual, dict) - assert bool(actual) + assert isinstance(actual, list) + assert bool(actual) is True # Tests if this returns a string @@ -53,7 +53,7 @@ def test_get_random_category_line_str(self): # Tests if the get random category line is a non-empty value def test_get_random_category_line_nonempty(self): - actual = pyrizz.get_random_category_line("romanctic_lines") + actual = pyrizz.get_random_category_line("romantic_lines") assert isinstance(actual, str) assert len(actual) > 0 @@ -65,7 +65,7 @@ def test_get_random_category_line_empty(self): # Tests if the get random line is long enough def test_get_random_category_line_longenough(self): - actual = pyrizz.get_random_category_line("romanctic_lines") + actual = pyrizz.get_random_category_line("romantic_lines") assert isinstance(actual, str) assert len(actual) > 0 @@ -73,12 +73,15 @@ def test_get_random_category_line_longenough(self): # Tests if the input for ai line is empty def test_get_ai_line_empty(self): actual = pyrizz.get_ai_line("") - assert actual == "Please specify a category" + expected = "Please specify a category." + assert actual.strip() == expected.strip() # Tests if the input is way too long def test_get_ai_line_long(self): actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.") - assert actual == "Please specify a category that is less than 50 characters" + expected = "Please specify a category that is less than 50 characters." + assert actual.strip() == expected.strip() + # Tests if the input for ai line actually results in a string def test_get_ai_line_str(self): @@ -89,7 +92,7 @@ def test_get_ai_line_str(self): # Tests if the rate line is empty def test_rate_line_empty(self): actual = pyrizz.rate_line("") - assert actual == "No pickup line? You gotta use our other features before you come here buddy" + assert actual == "No pickup line? You gotta use our other features before you come here buddy." # Tests if the rate line function follows a specific format def test_rate_line_format(self): @@ -98,29 +101,17 @@ def test_rate_line_format(self): def test_add_user_line_invalid_template_number(self, capsys): - with pytest.raises(SystemExit): - with pytest.raises(SystemExit): - pyrizz.add_user_line() - captured = capsys.readouterr() - assert "Template number out of range. Please choose between 1 and 20." in captured.out - - def test_add_user_line_not_enough_words(self, capsys): - with pytest.raises(SystemExit): - with pytest.raises(SystemExit): - pyrizz.add_user_line() - captured = capsys.readouterr() - assert "Not enough words provided for the placeholders." in captured.out + with patch('builtins.input', side_effect=["21", "exit"]): + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "Template number out of range. Please choose between 1 and 20." in captured.out def test_is_line_valid_length(self): long_line = "x" * 141 assert not pyrizz.is_line_valid(long_line) - def test_is_offensive_detection(self, monkeypatch): - monkeypatch.setattr(pyrizz, "is_offensive", Mock(return_value=True)) - offensive_line = "An example offensive line" - assert pyrizz.is_offensive(offensive_line) - - def test_is_offensive_openai_error_handling(self, monkeypatch): - monkeypatch.setattr(pyrizz, "is_offensive", Mock(side_effect=Exception("Test error"))) + def test_is_offensive_openai_error_handling(self): line = "This should cause an OpenAIError" - assert not pyrizz.is_offensive(line) + assert pyrizz.is_offensive(line) is False, "Expected to return False when an OpenAIError occurs." + + From c840e72798a2af623456c932e0187605e7c5ecce Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 16:40:30 -0500 Subject: [PATCH 53/95] Finalized tests --- src/data/templates.json | 25 ++++++++++++ src/pyrizz/pyrizz.py | 35 +++++++++++++---- tests/test_pyrizz.py | 84 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 131 insertions(+), 13 deletions(-) create mode 100644 src/data/templates.json diff --git a/src/data/templates.json b/src/data/templates.json new file mode 100644 index 0000000..c0b7ee1 --- /dev/null +++ b/src/data/templates.json @@ -0,0 +1,25 @@ +{ + "templates": [ + "Do you have a {}? Because whenever I look at you, everyone else disappears.", + "Are you a {}? Because every time I think of you, I smile.", + "Do you have a map? I keep getting lost in your {}.", + "If beauty were time, you'd be an {}.", + "I'm not a photographer, but I can picture us together in a {}.", + "Can I follow you home? Cause my parents always told me to follow my {}.", + "Is your name Google? Because you have everything I've been searching for in the {}.", + "Are you made of copper and tellurium? Because you're {}.", + "Do you like Star Wars? Because Yoda only one for me in the {}.", + "If you were a {} on a McDonald's menu, you'd be a McGorgeous.", + "Do you have a Band-Aid? Because I just scraped my knee falling for {}.", + "Is it hot in here or is it just the {} we have together?", + "If you were a vegetable, you'd be a {}.", + "I must be a {} because I am attracted to your magnetic field.", + "Is there an airport nearby or is that just my heart taking {}?", + "You must be a magician because whenever I look at you, everyone else {}.", + "If I could rearrange the alphabet, I'd put {} and {} together.", + "Are you a {}? Because you're so fine you blow my mind.", + "Do you have a pencil? Cause I want to erase your past and write our {}.", + "Do you know what my shirt is made of? It's made of boyfriend {}." + ] + } + \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 24e45af..c07935c 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -7,6 +7,7 @@ from pyrizz.pickuplines import pickuplines, user_templates load_dotenv() +PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." openai.api_key = os.getenv('OPENAI_API_KEY') def get_lines(category='all'): @@ -67,18 +68,32 @@ def rate_line(pickup_line) -> str: return str(err) def add_user_line(): - pickupline_templates = user_templates + templates_file_path = PROJECT_ROOT + '/src/data/templates.json' + + try: + with open(templates_file_path, 'r', encoding='utf-8') as file: + templates = json.load(file)["templates"] + except json.JSONDecodeError as e: + print(f"Error decoding JSON: {e}") + return + except FileNotFoundError: + print(f"The file {templates_file_path} was not found.") + return + except Exception as e: + print(f"An unexpected error occurred: {e}") + return + print("Choose a template number (1-20):") try: template_number = int(input("> ")) - 1 - if not (0 <= template_number < len(user_templates)): + if not (0 <= template_number < len(templates)): print("Template number out of range. Please choose between 1 and 20.") return except ValueError: print("Please enter a valid number.") return - template_to_show = pickupline_templates[template_number] + template_to_show = templates[template_number] placeholders_count = template_to_show.count("{}") placeholder_representation = ['______'] * placeholders_count print("Fill in the blanks for the following template:") @@ -89,7 +104,7 @@ def add_user_line(): words = [word.strip() for word in words] try: - user_line = pickupline_templates[template_number].format(*words) + user_line = templates[template_number].format(*words) except IndexError: print("Not enough words provided for the placeholders.") return @@ -98,10 +113,14 @@ def add_user_line(): return if is_line_valid(user_line): - print("Here's your custom pick-up line:") - print(user_line) - pickuplines['user_lines'].append(user_line) - print("Nice! Your line was added!") + try: + print("Here's your custom pick-up line:") + print(user_line) + # Add the line somehow + print("Line added") + + except Exception as e: + print(f"An error occurred while inserting the line into the database: {e}") else: print("Your pick-up line doesn't pass our checks.") diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 42db9a1..81e05d0 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -100,18 +100,92 @@ def test_rate_line_format(self): assert re.match(r'\d+/10 - .+', actual) is not None - def test_add_user_line_invalid_template_number(self, capsys): + + # Fixture for mocking open() + @pytest.fixture + def mock_open_json(self, monkeypatch): + data = {"templates": ["Here is a {}, and here is another {}."]} + mock_file = mock_open(read_data=str(data)) + monkeypatch.setattr("builtins.open", mock_file) + + # Fixture for mocking json.load() + @pytest.fixture + def mock_json_load(self, monkeypatch): + data = {"templates": ["Here is a {}, and here is another {}."]} + monkeypatch.setattr("json.load", lambda x: data) + + # Fixture for mocking MongoDB insert_one + @pytest.fixture + def mock_insert_one(self, monkeypatch): + def mock(*args, **kwargs): + return MagicMock(inserted_id=1) + monkeypatch.setattr("pymongo.collection.Collection.insert_one", mock) + + # Fixtures for mocking user input as numbers + @pytest.fixture + def mock_input(self, monkeypatch): + inputs = iter(["1", "test, input"]) + monkeypatch.setattr("builtins.input", lambda x: next(inputs)) + + @pytest.fixture + def mock_input_value_error(self, monkeypatch): + monkeypatch.setattr('builtins.input', lambda _: 'not a number') + + # Fixture for handling openai + @pytest.fixture + def mock_openai_offensive(self, monkeypatch): + monkeypatch.setattr(openai.Completion, 'create', Mock(return_value={ + "choices": [{"text": "2"}] # "2" simulates offensive content + })) + + @pytest.fixture + def mock_openai_error(self, monkeypatch): + def openai_error(*args, **kwargs): + raise openai.error.OpenAIError("Test error") + monkeypatch.setattr(openai.Completion, 'create', openai_error) + + # Tests for add_user_line() function + # def test_add_user_line_success(self, mock_open_json, mock_json_load, mock_insert_one, mock_input, capsys): + # pyrizz.add_user_line() + # captured = capsys.readouterr() + # assert "Here's your custom pick-up line:" in captured.out + + def test_add_user_line_invalid_template_number(self, mock_open_json, mock_json_load, capsys): with patch('builtins.input', side_effect=["21", "exit"]): pyrizz.add_user_line() captured = capsys.readouterr() assert "Template number out of range. Please choose between 1 and 20." in captured.out + def test_add_user_line_not_enough_words(self, mock_open_json, mock_json_load, capsys): + with patch('builtins.input', side_effect=["1", "test"]): + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "Not enough words provided for the placeholders." in captured.out + + def test_add_user_line_json_error(self, monkeypatch, capsys): + m = mock_open() + m.side_effect = FileNotFoundError("The file was not found.") + monkeypatch.setattr("builtins.open", m) + + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "templates.json was not found" in captured.out + + # Tests for user input validation def test_is_line_valid_length(self): - long_line = "x" * 141 - assert not pyrizz.is_line_valid(long_line) + long_line = "x" * 141 + assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." + + def test_is_offensive_detection(self, mock_openai_offensive): + offensive_line = "An example offensive line" + assert pyrizz.is_offensive(offensive_line) is True, "Expected the line to be flagged as offensive." - def test_is_offensive_openai_error_handling(self): + def test_is_offensive_openai_error_handling(self, mock_openai_error): line = "This should cause an OpenAIError" assert pyrizz.is_offensive(line) is False, "Expected to return False when an OpenAIError occurs." - + def test_add_user_line_value_error(self, mock_input_value_error, capsys): + with patch('builtins.input', side_effect=["not a number", "exit"]): + pyrizz.add_user_line() + captured = capsys.readouterr() + assert "Please enter a valid number." in captured.out \ No newline at end of file From 74f03677dd8ade074be9a7b10be2a13fd3a43dc4 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 17:14:46 -0500 Subject: [PATCH 54/95] Fixed issue with testing --- Pipfile | 10 +++++++--- Pipfile.lock | 16 +++++++++++++--- requirements.txt | 1 - src/pyrizz/pyrizz.py | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Pipfile b/Pipfile index 53e0418..cbedfc9 100644 --- a/Pipfile +++ b/Pipfile @@ -3,14 +3,18 @@ url = "https://pypi.org/simple" verify_ssl = true name = "pypi" +[[source]] +url = "https://test.pypi.org/simple/" +verify_ssl = true +name = "testpypi" + [packages] pytest = "==7.4.3" -pymongo = "==4.6.0" python-dotenv = "==0.16.0" openai = "==0.28.1" -pyrizz = {editable = true, path = "."} +pyrizz = {version = "==0.0.666", index = "testpypi"} [dev-packages] [requires] -python_version = "3" \ No newline at end of file +python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock index dda85ff..7fab4c6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "bb68a407d4163a327275c54eac3d6dc3424737e2845b50af29c67bb6eefb8b89" + "sha256": "864cf2082bad317c803dedda32f71fd27e9a67a5772fe02d918f4fa4d1728c3a" }, "pipfile-spec": 6, "requires": { @@ -12,6 +12,11 @@ "name": "pypi", "url": "https://pypi.org/simple", "verify_ssl": true + }, + { + "name": "testpypi", + "url": "https://test.pypi.org/simple/", + "verify_ssl": true } ] }, @@ -522,8 +527,13 @@ "version": "==4.6.0" }, "pyrizz": { - "editable": true, - "path": "." + "hashes": [ + "sha256:0eea82bdb1f115c58f448fb52cf6a812cc05bf8505eed988658c0513f9d8af9a", + "sha256:eed764cd70ae2016430dc32fc869aeada3bd45bbe6b6a262973f7cc74b48953c" + ], + "index": "testpypi", + "markers": "python_version >= '3.7'", + "version": "==0.0.666" }, "pytest": { "hashes": [ diff --git a/requirements.txt b/requirements.txt index 72570ae..c050d22 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -pymongo==4.6.0 python-dotenv==0.16.0 openai==0.28.1 pytest==7.4.3 \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index c07935c..d8657e9 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -54,7 +54,7 @@ def rate_line(pickup_line) -> str: response = openai.ChatCompletion.create( model = os.getenv('OPENAI_MODEL'), messages = - [{"role": "user", "content": f"Rate this pickup line out of 10: {pickup_line} In your response, STRICTLY follow the format of (nothing else): rating/10 - snazzy comment."},] + [{"role": "user", "content": f"Rate this pickup line out of 10 (whole numbers only): {pickup_line} In your response, STRICTLY follow the format of (nothing else): rating/10 - snazzy comment."},] ) message = response.choices[0]['message'] From 1eb82a10da42e130346db00c4f3083a9df4b3e82 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 21:04:57 -0500 Subject: [PATCH 55/95] Changed files based on pyrizztest --- pyproject.toml | 2 +- src/data/templates.json | 25 -------- src/pyrizz/__main__.py | 20 +++--- src/pyrizz/pickuplines.py | 15 ++--- src/pyrizz/pyrizz.py | 60 +++--------------- src/pyrizz/templates.py | 22 +++++++ tests/test_pyrizz.py | 127 +++++++++----------------------------- 7 files changed, 78 insertions(+), 193 deletions(-) delete mode 100644 src/data/templates.json create mode 100644 src/pyrizz/templates.py diff --git a/pyproject.toml b/pyproject.toml index b5cd208..611c5b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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 = "0.0.1" +version = "0.0.2" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, diff --git a/src/data/templates.json b/src/data/templates.json deleted file mode 100644 index c0b7ee1..0000000 --- a/src/data/templates.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "templates": [ - "Do you have a {}? Because whenever I look at you, everyone else disappears.", - "Are you a {}? Because every time I think of you, I smile.", - "Do you have a map? I keep getting lost in your {}.", - "If beauty were time, you'd be an {}.", - "I'm not a photographer, but I can picture us together in a {}.", - "Can I follow you home? Cause my parents always told me to follow my {}.", - "Is your name Google? Because you have everything I've been searching for in the {}.", - "Are you made of copper and tellurium? Because you're {}.", - "Do you like Star Wars? Because Yoda only one for me in the {}.", - "If you were a {} on a McDonald's menu, you'd be a McGorgeous.", - "Do you have a Band-Aid? Because I just scraped my knee falling for {}.", - "Is it hot in here or is it just the {} we have together?", - "If you were a vegetable, you'd be a {}.", - "I must be a {} because I am attracted to your magnetic field.", - "Is there an airport nearby or is that just my heart taking {}?", - "You must be a magician because whenever I look at you, everyone else {}.", - "If I could rearrange the alphabet, I'd put {} and {} together.", - "Are you a {}? Because you're so fine you blow my mind.", - "Do you have a pencil? Cause I want to erase your past and write our {}.", - "Do you know what my shirt is made of? It's made of boyfriend {}." - ] - } - \ No newline at end of file diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index a51b413..9c0f2a1 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -20,11 +20,11 @@ def main(): while True: print("What would you like to do today?\n") - print("1. Get a random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") - print("2. Get a category-specific random pick-up line hand-picked by the devs with a guaranteed 100% success rate.") - print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters) with a 50% success rate.") + print("1. Get a random pick-up line") + print("2. Get a category-specific random pick-up line (romantic, clever, geeky, dev)") + print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters)") print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") - print("5. Insert your own pick-up line to our database.\n") + print("5. Create your very own pickup line!.\n") print("!! Type Q to quit !!\n") print("Enter your choice: ") @@ -38,18 +38,18 @@ def main(): print("1 - Romantic") print("2 - Clever") print("3 - Geeky") - print("4 - User Submitted") + print("4 - Developer Lines") category_index = input("> ") category_index = int(category_index) if category_index in range(1, 4): if(category_index == 1): - category_val = "romantic_lines" + category_val = "romantic" elif(category_index == 2): - category_val = "clever_lines" + category_val = "clever" elif(category_index == 3): - category_val = "geeky_lines" + category_val = "geeky" elif(category_index == 4): - category_val = "user_lines" + category_val = "dev" print("\n" + pyrizz.get_random_category_line(category_val), end = "\n\n") elif user_input == "3": @@ -63,7 +63,7 @@ def main(): print("\n" + pyrizz.rate_line(pickup_line), end = "\n\n") elif user_input == "5": - pyrizz.add_user_line() + pyrizz.create_line() elif user_input == "q" or user_input == "Q": break diff --git a/src/pyrizz/pickuplines.py b/src/pyrizz/pickuplines.py index 77edec3..ddc3ef2 100644 --- a/src/pyrizz/pickuplines.py +++ b/src/pyrizz/pickuplines.py @@ -229,15 +229,10 @@ "Do you know what my shirt is made of? It's made of boyfriend {}." ] -user_lines = [] - pickuplines = { 'dev_lines': dev_lines, - 'romantic_lines': romantic_lines, - 'clever_lines': clever_lines, - 'geeky_lines': geeky_lines, - 'user_lines': user_lines, - 'all': dev_lines + romantic_lines + clever_lines + geeky_lines + user_lines -} - -user_templates = templates \ No newline at end of file + 'romantic': romantic_lines, + 'clever': clever_lines, + 'geeky': geeky_lines, + 'all': dev_lines + romantic_lines + clever_lines + geeky_lines +} \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index d8657e9..1a32b82 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -4,7 +4,8 @@ import json from dotenv import load_dotenv import openai -from pyrizz.pickuplines import pickuplines, user_templates +from pyrizz.pickuplines import pickuplines +from pyrizz.templates import templates load_dotenv() PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." @@ -12,8 +13,7 @@ def get_lines(category='all'): if category not in pickuplines: - print("Category does not exist!") - return + return ("Category does not exist!") else: return pickuplines[category] @@ -67,28 +67,14 @@ def rate_line(pickup_line) -> str: except Exception as err: return str(err) -def add_user_line(): - templates_file_path = PROJECT_ROOT + '/src/data/templates.json' - - try: - with open(templates_file_path, 'r', encoding='utf-8') as file: - templates = json.load(file)["templates"] - except json.JSONDecodeError as e: - print(f"Error decoding JSON: {e}") - return - except FileNotFoundError: - print(f"The file {templates_file_path} was not found.") - return - except Exception as e: - print(f"An unexpected error occurred: {e}") - return - +def create_line(): print("Choose a template number (1-20):") try: template_number = int(input("> ")) - 1 if not (0 <= template_number < len(templates)): print("Template number out of range. Please choose between 1 and 20.") return + except ValueError: print("Please enter a valid number.") return @@ -105,53 +91,27 @@ def add_user_line(): try: user_line = templates[template_number].format(*words) + except IndexError: print("Not enough words provided for the placeholders.") return + except Exception as e: print(f"An unexpected formatting error occurred: {e}") return if is_line_valid(user_line): try: - print("Here's your custom pick-up line:") - print(user_line) - # Add the line somehow - print("Line added") + print("\nLooks great! Try it on a human now and meet your match!") + return(user_line) except Exception as e: print(f"An error occurred while inserting the line into the database: {e}") else: - print("Your pick-up line doesn't pass our checks.") + return("Your pick-up line doesn't pass our checks.") def is_line_valid(user_line): if len(user_line) > 140: - print("Your pick-up line is too long.") - return False - - if is_offensive(user_line): - print("Your pick-up line may be offensive.") return False return True - -def is_offensive(text): - try: - response = openai.Completion.create( - model="content-filter-alpha", - prompt="<|endoftext|>"+text+"\n--\nLabel:", - temperature=0, - max_tokens=1 - ) - content_filter_response = response["choices"][0]["text"].strip() - - if content_filter_response in ("2", "1"): - return True - else: - return False - except openai.error.OpenAIError as e: - print(f"OpenAIError occurred: {e}") - return False - except Exception as e: - print(f"An unexpected error occurred when checking for offensive content: {e}") - return False diff --git a/src/pyrizz/templates.py b/src/pyrizz/templates.py new file mode 100644 index 0000000..835dc87 --- /dev/null +++ b/src/pyrizz/templates.py @@ -0,0 +1,22 @@ +templates = [ + "Do you have a {}? Because whenever I look at you, everyone else disappears.", + "Are you a {}? Because every time I think of you, I smile.", + "Do you have a map? I keep getting lost in your {}.", + "If beauty were time, you'd be an {}.", + "I'm not a photographer, but I can picture us together in a {}.", + "Can I follow you home? Cause my parents always told me to follow my {}.", + "Is your name Google? Because you have everything I've been searching for in the {}.", + "Are you made of copper and tellurium? Because you're {}.", + "Do you like Star Wars? Because Yoda only one for me in the {}.", + "If you were a {} on a McDonald's menu, you'd be a McGorgeous.", + "Do you have a Band-Aid? Because I just scraped my knee falling for {}.", + "Is it hot in here or is it just the {} we have together?", + "If you were a vegetable, you'd be a {}.", + "I must be a {} because I am attracted to your magnetic field.", + "Is there an airport nearby or is that just my heart taking {}?", + "You must be a magician because whenever I look at you, everyone else {}.", + "If I could rearrange the alphabet, I'd put {} and {} together.", + "Are you a {}? Because you're so fine you blow my mind.", + "Do you have a pencil? Cause I want to erase your past and write our {}.", + "Do you know what my shirt is made of? It's made of boyfriend {}." +] \ No newline at end of file diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 81e05d0..5d575e1 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -6,186 +6,119 @@ from unittest.mock import patch, MagicMock, mock_open import openai sys.path.append(f"{pathlib.Path(__file__).parent.resolve()}/../src") -from pyrizz import pyrizz +from pyrizztest import pyrizztest class Tests: # Tests if this returns a list def test_get_lines_list(self): - actual = pyrizz.get_lines('all') + actual = pyrizztest.get_lines('all') assert isinstance(actual, list) # Tests if this returns an empty or not a proper category def test_get_lines_nonempty(self): - actual = pyrizz.get_lines() + actual = pyrizztest.get_lines() assert isinstance(actual, list) assert bool(actual) is True # Tests if this returns a string def test_get_random_line_str(self): - actual = pyrizz.get_random_line() + actual = pyrizztest.get_random_line() assert isinstance(actual, str) # Tests if the get random line is a non-empty value def test_get_random_line_nonempty(self): - actual = pyrizz.get_random_line() + actual = pyrizztest.get_random_line() assert isinstance(actual, str) assert len(actual) > 0 # Tests if the get random line is a empty value def test_get_random_line_empty(self): - actual = pyrizz.get_random_line() + actual = pyrizztest.get_random_line() assert isinstance(actual, str) assert bool(actual) # Tests if the get random line is long enough def test_get_random_line_long_enough(self): - actual = pyrizz.get_random_line() + actual = pyrizztest.get_random_line() assert isinstance(actual, str) assert len(actual) > 1 # Tests if this returns a string def test_get_random_category_line_str(self): - actual = pyrizz.get_random_category_line("romantic_lines") + actual = pyrizztest.get_random_category_line("romantic") assert isinstance(actual, str) # Tests if the get random category line is a non-empty value def test_get_random_category_line_nonempty(self): - actual = pyrizz.get_random_category_line("romantic_lines") + actual = pyrizztest.get_random_category_line("romantic") assert isinstance(actual, str) assert len(actual) > 0 # Tests if the get random cateogory line is a empty value def test_get_random_category_line_empty(self): - actual = pyrizz.get_random_category_line() + actual = pyrizztest.get_random_category_line() assert isinstance(actual, str) assert bool(actual) # Tests if the get random line is long enough def test_get_random_category_line_longenough(self): - actual = pyrizz.get_random_category_line("romantic_lines") + actual = pyrizztest.get_random_category_line("romantic") assert isinstance(actual, str) assert len(actual) > 0 # Tests if the input for ai line is empty def test_get_ai_line_empty(self): - actual = pyrizz.get_ai_line("") + actual = pyrizztest.get_ai_line("") expected = "Please specify a category." assert actual.strip() == expected.strip() # Tests if the input is way too long def test_get_ai_line_long(self): - actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.") + actual = pyrizztest.get_ai_line("This is a very long category that is definitely more than 50 characters long.") expected = "Please specify a category that is less than 50 characters." assert actual.strip() == expected.strip() # Tests if the input for ai line actually results in a string def test_get_ai_line_str(self): - actual = pyrizz.get_ai_line("test") + actual = pyrizztest.get_ai_line("test") assert isinstance(actual, str) # Tests if the rate line is empty def test_rate_line_empty(self): - actual = pyrizz.rate_line("") + actual = pyrizztest.rate_line("") assert actual == "No pickup line? You gotta use our other features before you come here buddy." # Tests if the rate line function follows a specific format def test_rate_line_format(self): - actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") + actual = pyrizztest.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") assert re.match(r'\d+/10 - .+', actual) is not None - - - # Fixture for mocking open() - @pytest.fixture - def mock_open_json(self, monkeypatch): - data = {"templates": ["Here is a {}, and here is another {}."]} - mock_file = mock_open(read_data=str(data)) - monkeypatch.setattr("builtins.open", mock_file) - - # Fixture for mocking json.load() - @pytest.fixture - def mock_json_load(self, monkeypatch): - data = {"templates": ["Here is a {}, and here is another {}."]} - monkeypatch.setattr("json.load", lambda x: data) - - # Fixture for mocking MongoDB insert_one - @pytest.fixture - def mock_insert_one(self, monkeypatch): - def mock(*args, **kwargs): - return MagicMock(inserted_id=1) - monkeypatch.setattr("pymongo.collection.Collection.insert_one", mock) - - # Fixtures for mocking user input as numbers - @pytest.fixture - def mock_input(self, monkeypatch): - inputs = iter(["1", "test, input"]) - monkeypatch.setattr("builtins.input", lambda x: next(inputs)) - - @pytest.fixture - def mock_input_value_error(self, monkeypatch): - monkeypatch.setattr('builtins.input', lambda _: 'not a number') - - # Fixture for handling openai - @pytest.fixture - def mock_openai_offensive(self, monkeypatch): - monkeypatch.setattr(openai.Completion, 'create', Mock(return_value={ - "choices": [{"text": "2"}] # "2" simulates offensive content - })) - - @pytest.fixture - def mock_openai_error(self, monkeypatch): - def openai_error(*args, **kwargs): - raise openai.error.OpenAIError("Test error") - monkeypatch.setattr(openai.Completion, 'create', openai_error) - - # Tests for add_user_line() function - # def test_add_user_line_success(self, mock_open_json, mock_json_load, mock_insert_one, mock_input, capsys): - # pyrizz.add_user_line() - # captured = capsys.readouterr() - # assert "Here's your custom pick-up line:" in captured.out - - def test_add_user_line_invalid_template_number(self, mock_open_json, mock_json_load, capsys): - with patch('builtins.input', side_effect=["21", "exit"]): - pyrizz.add_user_line() + + def test_create_line_invalid_template_number(self, capsys): + with patch('builtins.input', side_effect=["21"]): + pyrizztest.create_line() captured = capsys.readouterr() assert "Template number out of range. Please choose between 1 and 20." in captured.out - def test_add_user_line_not_enough_words(self, mock_open_json, mock_json_load, capsys): - with patch('builtins.input', side_effect=["1", "test"]): - pyrizz.add_user_line() + def test_create_line_invalid_value_input(self, capsys): + with patch('builtins.input', side_effect=["abc"]): + pyrizztest.create_line() captured = capsys.readouterr() - assert "Not enough words provided for the placeholders." in captured.out - - def test_add_user_line_json_error(self, monkeypatch, capsys): - m = mock_open() - m.side_effect = FileNotFoundError("The file was not found.") - monkeypatch.setattr("builtins.open", m) + assert "Please enter a valid number." in captured.out - pyrizz.add_user_line() - captured = capsys.readouterr() - assert "templates.json was not found" in captured.out + def test_create_line_not_enough_words(self, capsys): + with patch('builtins.input', side_effect=["17", "test"]): + result = pyrizztest.create_line() + captured = capsys.readouterr() + assert "Not enough words provided for the placeholders." in captured.out # Tests for user input validation def test_is_line_valid_length(self): long_line = "x" * 141 - assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." - - def test_is_offensive_detection(self, mock_openai_offensive): - offensive_line = "An example offensive line" - assert pyrizz.is_offensive(offensive_line) is True, "Expected the line to be flagged as offensive." - - def test_is_offensive_openai_error_handling(self, mock_openai_error): - line = "This should cause an OpenAIError" - assert pyrizz.is_offensive(line) is False, "Expected to return False when an OpenAIError occurs." - - def test_add_user_line_value_error(self, mock_input_value_error, capsys): - with patch('builtins.input', side_effect=["not a number", "exit"]): - pyrizz.add_user_line() - captured = capsys.readouterr() - assert "Please enter a valid number." in captured.out \ No newline at end of file + assert not pyrizztest.is_line_valid(long_line), "Expected the line to be flagged as too long." \ No newline at end of file From 29f794c9bfb377d6c59b7eb952bb6d5148c24002 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 21:09:45 -0500 Subject: [PATCH 56/95] Fixed pytests --- Pipfile.lock | 98 +------------------------------------------- tests/test_pyrizz.py | 40 +++++++++--------- 2 files changed, 21 insertions(+), 117 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 7fab4c6..421fde7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "864cf2082bad317c803dedda32f71fd27e9a67a5772fe02d918f4fa4d1728c3a" + "sha256": "9d584cf34b3a85e08bd790ccc841cf3eb0070006743efe6825942c0ad600751f" }, "pipfile-spec": 6, "requires": { @@ -242,14 +242,6 @@ "markers": "python_full_version >= '3.7.0'", "version": "==3.3.2" }, - "dnspython": { - "hashes": [ - "sha256:57c6fbaaeaaf39c891292012060beb141791735dbb4004798328fc2c467402d8", - "sha256:8dcfae8c7460a2f84b4072e26f1c9f4101ca20c071649cb7c34e8b6a93d58984" - ], - "markers": "python_version >= '3.8' and python_version < '4.0'", - "version": "==2.4.2" - }, "frozenlist": { "hashes": [ "sha256:007df07a6e3eb3e33e9a1fe6a9db7af152bbd8a185f9aaa6ece10a3529e3e1c6", @@ -438,94 +430,6 @@ "markers": "python_version >= '3.8'", "version": "==1.3.0" }, - "pymongo": { - "hashes": [ - "sha256:014e7049dd019a6663747ca7dae328943e14f7261f7c1381045dfc26a04fa330", - "sha256:055f5c266e2767a88bb585d01137d9c7f778b0195d3dbf4a487ef0638be9b651", - "sha256:05c30fd35cc97f14f354916b45feea535d59060ef867446b5c3c7f9b609dd5dc", - "sha256:0634994b026336195778e5693583c060418d4ab453eff21530422690a97e1ee8", - "sha256:09c7de516b08c57647176b9fc21d929d628e35bcebc7422220c89ae40b62126a", - "sha256:107a234dc55affc5802acb3b6d83cbb8c87355b38a9457fcd8806bdeb8bce161", - "sha256:10a379fb60f1b2406ae57b8899bacfe20567918c8e9d2d545e1b93628fcf2050", - "sha256:128b1485753106c54af481789cdfea12b90a228afca0b11fb3828309a907e10e", - "sha256:1394c4737b325166a65ae7c145af1ebdb9fb153ebedd37cf91d676313e4a67b8", - "sha256:1c63e3a2e8fb815c4b1f738c284a4579897e37c3cfd95fdb199229a1ccfb638a", - "sha256:1e4ed21029d80c4f62605ab16398fe1ce093fff4b5f22d114055e7d9fbc4adb0", - "sha256:1ec71ac633b126c0775ed4604ca8f56c3540f5c21a1220639f299e7a544b55f9", - "sha256:21812453354b151200034750cd30b0140e82ec2a01fd4357390f67714a1bfbde", - "sha256:256c503a75bd71cf7fb9ebf889e7e222d49c6036a48aad5a619f98a0adf0e0d7", - "sha256:2703a9f8f5767986b4f51c259ff452cc837c5a83c8ed5f5361f6e49933743b2f", - "sha256:288c21ab9531b037f7efa4e467b33176bc73a0c27223c141b822ab4a0e66ff2a", - "sha256:2972dd1f1285866aba027eff2f4a2bbf8aa98563c2ced14cb34ee5602b36afdf", - "sha256:2973f113e079fb98515722cd728e1820282721ec9fd52830e4b73cabdbf1eb28", - "sha256:2ca0ba501898b2ec31e6c3acf90c31910944f01d454ad8e489213a156ccf1bda", - "sha256:2d2be5c9c3488fa8a70f83ed925940f488eac2837a996708d98a0e54a861f212", - "sha256:2f8c04277d879146eacda920476e93d520eff8bec6c022ac108cfa6280d84348", - "sha256:325701ae7b56daa5b0692305b7cb505ca50f80a1288abb32ff420a8a209b01ca", - "sha256:3729b8db02063da50eeb3db88a27670d85953afb9a7f14c213ac9e3dca93034b", - "sha256:3919708594b86d0f5cdc713eb6fccd3f9b9532af09ea7a5d843c933825ef56c4", - "sha256:39a1cd5d383b37285641d5a7a86be85274466ae336a61b51117155936529f9b3", - "sha256:3ec6c20385c5a58e16b1ea60c5e4993ea060540671d7d12664f385f2fb32fe79", - "sha256:47aa128be2e66abd9d1a9b0437c62499d812d291f17b55185cb4aa33a5f710a4", - "sha256:49f2af6cf82509b15093ce3569229e0d53c90ad8ae2eef940652d4cf1f81e045", - "sha256:4a0269811661ba93c472c8a60ea82640e838c2eb148d252720a09b5123f2c2fe", - "sha256:518c90bdd6e842c446d01a766b9136fec5ec6cc94f3b8c3f8b4a332786ee6b64", - "sha256:5717a308a703dda2886a5796a07489c698b442f5e409cf7dc2ac93de8d61d764", - "sha256:5802acc012bbb4bce4dff92973dff76482f30ef35dd4cb8ab5b0e06aa8f08c80", - "sha256:5e63146dbdb1eac207464f6e0cfcdb640c9c5ff0f57b754fa96fe252314a1dc6", - "sha256:6695d7136a435c1305b261a9ddb9b3ecec9863e05aab3935b96038145fd3a977", - "sha256:680fa0fc719e1a3dcb81130858368f51d83667d431924d0bcf249644bce8f303", - "sha256:6b18276f14b4b6d92e707ab6db19b938e112bd2f1dc3f9f1a628df58e4fd3f0d", - "sha256:6bafea6061d63059d8bc2ffc545e2f049221c8a4457d236c5cd6a66678673eab", - "sha256:6d6a1b1361f118e7fefa17ae3114e77f10ee1b228b20d50c47c9f351346180c8", - "sha256:747c84f4e690fbe6999c90ac97246c95d31460d890510e4a3fa61b7d2b87aa34", - "sha256:79f41576b3022c2fe9780ae3e44202b2438128a25284a8ddfa038f0785d87019", - "sha256:7b0e6361754ac596cd16bfc6ed49f69ffcd9b60b7bc4bcd3ea65c6a83475e4ff", - "sha256:7e3b0127b260d4abae7b62203c4c7ef0874c901b55155692353db19de4b18bc4", - "sha256:7fc2bb8a74dcfcdd32f89528e38dcbf70a3a6594963d60dc9595e3b35b66e414", - "sha256:806e094e9e85d8badc978af8c95b69c556077f11844655cb8cd2d1758769e521", - "sha256:81dd1308bd5630d2bb5980f00aa163b986b133f1e9ed66c66ce2a5bc3572e891", - "sha256:82e620842e12e8cb4050d2643a81c8149361cd82c0a920fa5a15dc4ca8a4000f", - "sha256:85f2cdc400ee87f5952ebf2a117488f2525a3fb2e23863a8efe3e4ee9e54e4d1", - "sha256:8ab6bcc8e424e07c1d4ba6df96f7fb963bcb48f590b9456de9ebd03b88084fe8", - "sha256:8adf014f2779992eba3b513e060d06f075f0ab2fb3ad956f413a102312f65cdf", - "sha256:9b0f98481ad5dc4cb430a60bbb8869f05505283b9ae1c62bdb65eb5e020ee8e3", - "sha256:9bea9138b0fc6e2218147e9c6ce1ff76ff8e29dc00bb1b64842bd1ca107aee9f", - "sha256:a09bfb51953930e7e838972ddf646c5d5f984992a66d79da6ba7f6a8d8a890cd", - "sha256:a0be99b599da95b7a90a918dd927b20c434bea5e1c9b3efc6a3c6cd67c23f813", - "sha256:a49aca4d961823b2846b739380c847e8964ff7ae0f0a683992b9d926054f0d6d", - "sha256:a4dc1319d0c162919ee7f4ee6face076becae2abbd351cc14f1fe70af5fb20d9", - "sha256:a8273e1abbcff1d7d29cbbb1ea7e57d38be72f1af3c597c854168508b91516c2", - "sha256:a8f7f9feecae53fa18d6a3ea7c75f9e9a1d4d20e5c3f9ce3fba83f07bcc4eee2", - "sha256:ad4f66fbb893b55f96f03020e67dcab49ffde0177c6565ccf9dec4fdf974eb61", - "sha256:af425f323fce1b07755edd783581e7283557296946212f5b1a934441718e7528", - "sha256:b14dd73f595199f4275bed4fb509277470d9b9059310537e3b3daba12b30c157", - "sha256:b4ad70d7cac4ca0c7b31444a0148bd3af01a2662fa12b1ad6f57cd4a04e21766", - "sha256:b80a4ee19b3442c57c38afa978adca546521a8822d663310b63ae2a7d7b13f3a", - "sha256:ba51129fcc510824b6ca6e2ce1c27e3e4d048b6e35d3ae6f7e517bed1b8b25ce", - "sha256:c011bd5ad03cc096f99ffcfdd18a1817354132c1331bed7a837a25226659845f", - "sha256:cc94f9fea17a5af8cf1a343597711a26b0117c0b812550d99934acb89d526ed2", - "sha256:ccd785fafa1c931deff6a7116e9a0d402d59fabe51644b0d0c268295ff847b25", - "sha256:d16a534da0e39785687b7295e2fcf9a339f4a20689024983d11afaa4657f8507", - "sha256:d3077a31633beef77d057c6523f5de7271ddef7bde5e019285b00c0cc9cac1e3", - "sha256:d603edea1ff7408638b2504905c032193b7dcee7af269802dbb35bc8c3310ed5", - "sha256:db082f728160369d9a6ed2e722438291558fc15ce06d0a7d696a8dad735c236b", - "sha256:ddef295aaf80cefb0c1606f1995899efcb17edc6b327eb6589e234e614b87756", - "sha256:e16ade71c93f6814d095d25cd6d28a90d63511ea396bd96e9ffcb886b278baaa", - "sha256:e3db7d833a7c38c317dc95b54e27f1d27012e031b45a7c24e360b53197d5f6e7", - "sha256:e5e193f89f4f8c1fe273f9a6e6df915092c9f2af6db2d1afb8bd53855025c11f", - "sha256:eb438a8bf6b695bf50d57e6a059ff09652a07968b2041178b3744ea785fcef9b", - "sha256:ebf02c32afa6b67e5861a27183dd98ed88419a94a2ab843cc145fb0bafcc5b28", - "sha256:ecd9e1fa97aa11bf67472220285775fa15e896da108f425e55d23d7540a712ce", - "sha256:ef67fedd863ffffd4adfd46d9d992b0f929c7f61a8307366d664d93517f2c78e", - "sha256:f28ae33dc5a0b9cee06e95fd420e42155d83271ab75964baf747ce959cac5f52", - "sha256:fb1c56d891f9e34303c451998ef62ba52659648bb0d75b03c5e4ac223a3342c2", - "sha256:fe03bf25fae4b95d8afe40004a321df644400fdcba4c8e5e1a19c1085b740888" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==4.6.0" - }, "pyrizz": { "hashes": [ "sha256:0eea82bdb1f115c58f448fb52cf6a812cc05bf8505eed988658c0513f9d8af9a", diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 5d575e1..079bced 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -6,119 +6,119 @@ from unittest.mock import patch, MagicMock, mock_open import openai sys.path.append(f"{pathlib.Path(__file__).parent.resolve()}/../src") -from pyrizztest import pyrizztest +from pyrizz import pyrizz class Tests: # Tests if this returns a list def test_get_lines_list(self): - actual = pyrizztest.get_lines('all') + actual = pyrizz.get_lines('all') assert isinstance(actual, list) # Tests if this returns an empty or not a proper category def test_get_lines_nonempty(self): - actual = pyrizztest.get_lines() + actual = pyrizz.get_lines() assert isinstance(actual, list) assert bool(actual) is True # Tests if this returns a string def test_get_random_line_str(self): - actual = pyrizztest.get_random_line() + actual = pyrizz.get_random_line() assert isinstance(actual, str) # Tests if the get random line is a non-empty value def test_get_random_line_nonempty(self): - actual = pyrizztest.get_random_line() + actual = pyrizz.get_random_line() assert isinstance(actual, str) assert len(actual) > 0 # Tests if the get random line is a empty value def test_get_random_line_empty(self): - actual = pyrizztest.get_random_line() + actual = pyrizz.get_random_line() assert isinstance(actual, str) assert bool(actual) # Tests if the get random line is long enough def test_get_random_line_long_enough(self): - actual = pyrizztest.get_random_line() + actual = pyrizz.get_random_line() assert isinstance(actual, str) assert len(actual) > 1 # Tests if this returns a string def test_get_random_category_line_str(self): - actual = pyrizztest.get_random_category_line("romantic") + actual = pyrizz.get_random_category_line("romantic") assert isinstance(actual, str) # Tests if the get random category line is a non-empty value def test_get_random_category_line_nonempty(self): - actual = pyrizztest.get_random_category_line("romantic") + actual = pyrizz.get_random_category_line("romantic") assert isinstance(actual, str) assert len(actual) > 0 # Tests if the get random cateogory line is a empty value def test_get_random_category_line_empty(self): - actual = pyrizztest.get_random_category_line() + actual = pyrizz.get_random_category_line() assert isinstance(actual, str) assert bool(actual) # Tests if the get random line is long enough def test_get_random_category_line_longenough(self): - actual = pyrizztest.get_random_category_line("romantic") + actual = pyrizz.get_random_category_line("romantic") assert isinstance(actual, str) assert len(actual) > 0 # Tests if the input for ai line is empty def test_get_ai_line_empty(self): - actual = pyrizztest.get_ai_line("") + actual = pyrizz.get_ai_line("") expected = "Please specify a category." assert actual.strip() == expected.strip() # Tests if the input is way too long def test_get_ai_line_long(self): - actual = pyrizztest.get_ai_line("This is a very long category that is definitely more than 50 characters long.") + actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.") expected = "Please specify a category that is less than 50 characters." assert actual.strip() == expected.strip() # Tests if the input for ai line actually results in a string def test_get_ai_line_str(self): - actual = pyrizztest.get_ai_line("test") + actual = pyrizz.get_ai_line("test") assert isinstance(actual, str) # Tests if the rate line is empty def test_rate_line_empty(self): - actual = pyrizztest.rate_line("") + actual = pyrizz.rate_line("") assert actual == "No pickup line? You gotta use our other features before you come here buddy." # Tests if the rate line function follows a specific format def test_rate_line_format(self): - actual = pyrizztest.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") + actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") assert re.match(r'\d+/10 - .+', actual) is not None def test_create_line_invalid_template_number(self, capsys): with patch('builtins.input', side_effect=["21"]): - pyrizztest.create_line() + pyrizz.create_line() captured = capsys.readouterr() assert "Template number out of range. Please choose between 1 and 20." in captured.out def test_create_line_invalid_value_input(self, capsys): with patch('builtins.input', side_effect=["abc"]): - pyrizztest.create_line() + pyrizz.create_line() captured = capsys.readouterr() assert "Please enter a valid number." in captured.out def test_create_line_not_enough_words(self, capsys): with patch('builtins.input', side_effect=["17", "test"]): - result = pyrizztest.create_line() + result = pyrizz.create_line() captured = capsys.readouterr() assert "Not enough words provided for the placeholders." in captured.out # Tests for user input validation def test_is_line_valid_length(self): long_line = "x" * 141 - assert not pyrizztest.is_line_valid(long_line), "Expected the line to be flagged as too long." \ No newline at end of file + assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." \ No newline at end of file From d457f8c753a4a5d5bf963439d5fbdd787ba0aefc Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 21:16:32 -0500 Subject: [PATCH 57/95] Fixed some lines --- pyproject.toml | 2 +- src/pyrizz/pickuplines.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 611c5b2..c1eba9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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 = "0.0.2" +version = "0.0.7" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, diff --git a/src/pyrizz/pickuplines.py b/src/pyrizz/pickuplines.py index ddc3ef2..52c5cbf 100644 --- a/src/pyrizz/pickuplines.py +++ b/src/pyrizz/pickuplines.py @@ -230,7 +230,7 @@ ] pickuplines = { - 'dev_lines': dev_lines, + 'dev': dev_lines, 'romantic': romantic_lines, 'clever': clever_lines, 'geeky': geeky_lines, From f1eca0f19d5eb191296c89b7794f0fdb7658c619 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Wed, 8 Nov 2023 21:18:03 -0500 Subject: [PATCH 58/95] Updated version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c1eba9f..cf19c6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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 = "0.0.7" +version = "1.0.3" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, From de66536c206c0767bf571efb24fc6fd9deff3208 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Wed, 8 Nov 2023 21:43:23 -0500 Subject: [PATCH 59/95] Update README.md --- README.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b95990e..6652e9a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,70 @@ Looking to add a dash of humor to your day or spark some laughter in your conver - [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 + +``` +from pyrizz import pyrizz + +print(pyrizz.get_random_categoryy_line('romantic')) +print(pyrizz.get_random_categoryy_line('clever')) +print(pyrizz.get_random_categoryy_line('geeky')) +print(pyrizz.get_random_categoryy_line('dev')) +``` + +### get_ai_line(keyword) + +In this function, you can retreive a generated pickup line using openai based on any keyword that you suggest. In this example, it would output a Shakespearean pickup line: + +``` +from pyrizz import pyrizz + +print(pyrizz.get_ai_line('shakespeare')) +``` + +### rate_line(pickup_line) + +In this function, you can rate your very own pickup line out of 10 using openai. Simply type your pickup line and a rating will output: + +``` +from pyrizz import pyrizz + +print(pyrizz.rate_line('Are you from Tennesse? Cause you're the only 10 I see.')) +``` + +### create_line() + +In this function, if you're new to pickup lines, you can create your very own pickup using some of our templates! +``` +from pyrizz import pyrizz + +print(pyrizz.create_line()) +``` + +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 access it simply run: `pipenv run python -m pyrizz` on the directory of the repository when cloned. # Contributing @@ -29,7 +93,7 @@ We love contributions from everyone. By participating in this project, you agree Change into the cloned directory: ```shell - cd pyrizz + cd 3-python-package-exercise-experientia ``` 3. **Install pipenv**: From 027eb1c639f56a52c1f7ab0f3d52595311136744 Mon Sep 17 00:00:00 2001 From: annsts Date: Wed, 8 Nov 2023 23:56:15 -0500 Subject: [PATCH 60/95] ascii art --- README.md | 3 +- src/pyrizz/__main__.py | 13 +- src/pyrizz/data/ascii_art.txt | 415 ++++++++++++++++++++++++++++++++++ src/pyrizz/pyrizz.py | 93 +++++--- src/pyrizz/templates.py | 22 +- tests/test_pyrizz.py | 34 ++- 6 files changed, 520 insertions(+), 60 deletions(-) create mode 100644 src/pyrizz/data/ascii_art.txt diff --git a/README.md b/README.md index 6652e9a..84a8e1c 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,9 @@ In this function, if you're new to pickup lines, you can create your very own pi ``` from pyrizz import pyrizz -print(pyrizz.create_line()) +print(pyrizz.create_line(template_number, words)) ``` +Then this function returns your line with some random ASCII art. 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) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 9c0f2a1..3020adf 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -24,7 +24,8 @@ def main(): print("2. Get a category-specific random pick-up line (romantic, clever, geeky, dev)") print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters)") print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") - print("5. Create your very own pickup line!.\n") + print("5. Create your line with one of our templates with randomly selected ASCII art.") + print("6. List available templates for pick-up lines.\n") print("!! Type Q to quit !!\n") print("Enter your choice: ") @@ -63,7 +64,15 @@ def main(): print("\n" + pyrizz.rate_line(pickup_line), end = "\n\n") elif user_input == "5": - pyrizz.create_line() + template_number, words = pyrizz.get_user_input_for_line() + line = pyrizz.create_line(template_number, words) + if line: + print("\nHere's your custom pick-up line:") + print(line) + + elif user_input == "6": + print("Here are the available templates:") + pyrizz.list_templates() elif user_input == "q" or user_input == "Q": break diff --git a/src/pyrizz/data/ascii_art.txt b/src/pyrizz/data/ascii_art.txt new file mode 100644 index 0000000..feffdc8 --- /dev/null +++ b/src/pyrizz/data/ascii_art.txt @@ -0,0 +1,415 @@ +# ascii_art.txt +[Start] +,d88b.d88b, ,d88b.d88b, ,d88b.d88b, ,d88b.d88b, ,d88b.d88b, +88888888888 88888888888 88888888888 88888888888 88888888888 +`Y8888888Y' `Y8888888Y' `Y8888888Y' `Y8888888Y' `Y8888888Y' + `Y888Y' `Y888Y' `Y888Y' `Y888Y' `Y888Y' + `Y' `Y' `Y' `Y' `Y' +[End] +[Start] + _ _ + /` \/ `\_ _ + \ /` \/ `\ + '. .\ / + \/ '. .' + \/ +[End] +[Start] + @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +\\\\ @ @ @ @ @ @ @ @ @ @ @ @ + ------@ ---( @-----@ )---( @-----@ )---( @-----@ )--- @--------> +//// @ @ @ @ @ @ @ @ + @ @ @ @ @ @ @ @ + @ @ @ @ @ @ @ @ + @ @ @ @ @ @ @ @ + @ @ @ @ +[End] +[Start] + ****** ****** + ********** ********** + ************* ************* +***************************** +***************************** +***************************** + *************************** + *********************** + ******************* + *************** + *********** + ******* + *** + * +[End] +[Start] +oo + oo @@@@@@@@: @@@@@@@@! + o@@@@!!!!;;;;@ @@.......:;!@ + 'O@@!!!;;;;;;;;@ @.......: ;!@ + @@@!!!!;;::::::.@@........: ;!@ + @@!!!!;;:::::..............: ;!@ + @@@!!!;::::::..............: ;!@ + @@!!;;::::::.............: ;!@ + @@!;;::::::......oo.....::::!@ + @!!;::::::........oo..:::@ + !!!;:::::..........oo@ + !!;:::::.......@ oo * + ;;::::.....@ oo *** + :::..@ ooo*## + ::. _##ooo### + : **########## +[End] +[Start] + _____ _____ + ,ad8PPPP88b, ,d88PPPP8ba, + d8P" "Y8b, ,d8P" "Y8b +dP' "8a8" `Yd +8( " )8 +I8 8I + Yb, ,dP + "8a, ,a8" + "8a, ,a8" + "Yba adP" + `Y8a a8P' + `88, ,88' + "8b d8" + "8b d8" + `888' + " +[End] +[Start] + .;;;, .;;;, .;;;, .;;;, + .;;;,;;;;;,;;;;;,.;;;, .;;;.,;;;;;,;;;;;,;;;. + ;;;;xXXxXXxXXxXXxXXx;;;. .,. .;;;xXXxXXxXXxXXxXX;;;;; + .,,.`xXX' `xXXx,;;;;;,xXXx' `XXx;;,,. + ;;;;xXX' `xXXx;xXXx' `XXx;;;; + `;;XX' `XXX' `XX;;' +,;;,XX `X' XX,;;, +;;;;XX, ,XX;;;; + ``.;XX, ,XX;,'' + ;;;;XX, ,XX;;;; + ```.;XX, ,XX;,''' + ;;;;XX, ,XX;;;; + ```,;XX, ,XX;,''' + ;;;;XX, ,XX;;;; + ````,;XX, ,XX;, ''' + ;;;;;XX, ,XX;;;; + `````,;XX, ,XX;,'''' + ;;;;;XX, ,XX;;;;; + `````;;XX;;''''' + `;;;;' +[End] +[Start] + | \ \ | |/ / + | |\ `' ' / + | ;'aorta \ / , pulmonary + | ; _, | / / , arteries + superior | | ( `-.;_,-' '-' , +vena cava | `, `-._ _,-'_ + |,-`. `.) ,<_,-'_, pulmonary + ,' `. / ,' `;-' _, veins + ; `./ /`, \-' + | right / | ;\ |\ + | atrium ;_,._|_, `, ' \ + | \ \ ` `, + ` __ ` \ left ;, + \ ,' ` \, ventricle + \_| ;, ;; + | \ `;, ;; + inferior | |`. `;;, ;' +vena cava | | `-. ;;;;,;' + | | |`-.._ ,;;;;;' + | | | | ``';;;' FL + aorta +[End] +[Start] +:::::::8888!!!888888::::::::88888 8888888:::::::::::::::::::::::::::::::::::::: +::::::888!!!!!!!!!!8888:::888!!!! !! !!!8888::::88888888:::::::::8888888888::::: +:::::8!!:!: !!!!!88888!!!! ! !!!!88888!! !!!!88::::::8888! :888888: +::::88!! : ::!!!88!!!!! ! :!!888!!!! !!!!!88:88! ! !!!888 +:::88:! :::!!!:!!: ! !!!!88!!!! !!!!!!888! !! !!!!!!!!8 +:::8::! !! !:!:!!::: : !!!!88:! ::!!:!8! !! !!!! !!!! +::8!:! : !! !!!:::!!!!! !:!!!8: !!!:!!!:!!:: ! !!!!! +::8::!: ! ! !!!!:!:::!:: !:!::!!88! !:!!!::!:!::: !!!!!!!! +$$$$$$$$: !!! !!!::!!!::!! !!:!!:8!! ! !!::!::::::! ! !!:!!!!!! +:$$$$$$$$$ ::::!!!!:!!!!::: !!!!!:!!!8!!: : !!!!!!!!!!!: !!!!$$$::!!! +::$$$$$$$$$$::!!!:!!!!!!:::!!!!::!!!!!!88!:: !!! !!!!!!!!:::! !: :::!$$$$$:!! +:::$$$$$$$$$$$:!!:::::::!!!!!!!!!!!!!:!!88:::::::::::::!!!!!!!!: :!!!!!!!:$$$$$! +$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$8$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ +:::$$$$$$$$$$$:!!!!!!!!!!!!!!::!!!:!:!!!!:8! : ! !!::!:!:::!!!!!::!!!!!!!$$$$$$! +::$$$$$$$$$!: :!! ! !:::!!!!!:!!:!!!!!!!8 : ::! !:!!!!!!!::!:::$$$$!!! +$$$$$$$$$8:!! : :::: ::!:!!!::::::!!!!:!88! !!!! !::!!!!!!!!!$$$$!!!8 +$$$$$$$$$888!! ! !!!! !:::::::!!:!!!!!!!88!8!! !!!::!!!!!!!::!:$$$!!!88: +$$$$$$$::::888 ::: !!!:!!::!!!!!!!!!88:::8!!! ! !!!::!!!!!!!:::!!!888: +::::::::::::88 ! :!!!!!!!!!:!:!!!8!:::::888! !!:!::::!!!!!!888::: +::::::::::::::8 !!:::!!:!:!!!!!8:::::::::88!! !!!!!!!!!!!!!8888:::: +:::::::::::::::888! !! !!!!!!!!!!!!!!88::::::::::::88!!! !:!!!!!!::!8888::::: +:::::::::::::::::88!!! !!::!!!!!!!!88:::::::::::::::888!! !!!!!:!!!88::::::: +:::::::::::::::::::888!!!!!!!!!!!888::::::::::::::::::::888! !!!!!8888:::::::: +::::::::::::::::::::8888!!!!!!8!88:::::::::::::::::::::::!888!!!8!!88::::::::::: +[End] +[Start] + .. + $. ,o$$$o. + $. $$$$$$$o. .. + .$. $' $$$$$$ ,o'' + .$' $ '$$$$$,o'.,' .oo' + .$' $. $$$$' ,, .o'. + .$' '$o. 'O$ ..ooo''',oo' + .$' .o$' '$$'' ,,o' + .%$,,,,,ooO' ' ,,o'' +.$o. ,o' $o ..oo' + ''O'''''''''',' $'$. .o' + '$ $ '$,'o' ' + '$ $ .o $ + '$ $ .$$ + '$ $, .o$$ + '$ $. ,o' $ + $. '$. $,oooo''o, + $. $. 'o' '$ + $. $. .,ooo, $ + .'' 'oo...o' $ 'o $ + $ $ '' + $ $ + $ % + ,$ $ + $ $' +[End] +[Start] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + < :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: > + < :::::::::::: :::::::::::: :::::::::::: > + < ::::::::: :::: ::::::::: > + < ::::::: ******** :: ******** ::::::: > + < ::::: **** **** **** **** ::::: > + < :::: **** **** **** :::: > + < ::: **** ** **** ::: > + < ::: **** **** ::: > + < :::: **** ***** :::: > + < ::::: **** **** ::::: > + < ::::::: **** **** ::::::: > + < ::::::::: **** **** ::::::::: > + < ::::::::::: **** **** ::::::::::: > + < :::::::::::::: **** **** :::::::::::::: > + < ::::::::::::::::: **** **** ::::::::::::::::: > + < :::::::::::::::::::: **** :::::::::::::::::::: > + < ::::::::::::::::::::::: ** ::::::::::::::::::::::: > + < ::::::::::::::::::::::::: ::::::::::::::::::::::::: > + < ::::::::::::::::::::::::::: ::::::::::::::::::::::::::: > + < ::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::: > + < :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: > + ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() +[End] +[Start] + ...::::::::::... + .:^^~~!!!~~~~~~~~~~!!!~~~^:. + .:~!!!~~~^^^::::::::::::^^^~~~!!!~:. + .^!!!~~^^::..... .....::^^~~!!!^. + :!!!~~^::............................::^~~!!!:. + .^!!!~^^:..................................:^^~!7!^. + ^!7!~^::......................................:^^~!77^ + .!7!~~^:.......^7:......................:7^.......:^~~!7!. + :77!~^::::.....!GB~......................~BG!.....::::^~!77: + ^?7!~^::::...:!5BG7........................7GB5!:...::::^~!7?^ + :?7!~^^:::^~7YPGPJ^..........................^JPGPY7~^:::^^~!7?: + .77!!~^:^JY555J7~:::^^::....:::::::::::...::^^:.:~7J555YJ^:^~!!7?. + !?!!~^^^^^^^:::~7??777JYJ7^:.::::::::.:~7??777JYJ7^::::^^^^^^~!!?! + .?7!!~^^^^^^::!557:. .Y#BG5!::::::::!557:. .J##G57::^^^^^^~!!7?. + ~?7!!~^^^^^^^Y#Y. 5@@@&#Y::::::Y#5: Y@@@&#Y^^^^^^^~!!7?~ + !?7!!~~~^^^^7@&^ ^5@@@@@@@J::::!@&! :Y@@@@@@@J^^^~~~~!!7?! + 7?7!!~~~~~~^7@@P!^^~?P&@&&@@@@@Y::::7@@G7^^~75&@&&@@@@@Y^~~~~~~!!7?7 + !?77!!!~~~~~~P@@@@&@@@#7:?&@@@#~:^^:^P@@@@&@@@#7:?&@@@#!^~~~~!!!77?7 + ~J77!!!!!~~~~~5&@@@@@@#Y5#@@@P~:^^^^^^Y&@@@@@@#Y5#@@@G!~~~~!!!!777J~ + :J?777!!!!!~~~~!YG&@@@@@@&B57^^^^^^^^^^!YG&@@@@@@&B57~~~~!!!!!777?J. + !J?777!!!!!~~~~^^~!7??7!~^^^^^^^^^^^^^^^^~!7??77~~^~~~~!!!!!777?J! + .J?7777!!!!!~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^~~~~~!!!!!7777?JJ. + ^J??7777!!!!!~~~~~~~~~^^^^^^^^^^^^^^^^^^^^~~~~~~~~~!!!!!7777?JJ^ + ^JJ?77777!!!!!~~~~~~~~~~~~~^^^^^^^~^~~~~~~~~~~~!!!!!!77777?JJ^ + :JJ??77777!!!!!!!~~~~~~~~~^^^~~^^^~~~~~~~~~!!!!!!!77777??JJ: + .7JJ???777!~~~!!!!!~~~~~!J5GGGG5J!~~~~~!!!!~~~!!777???JY7. + ~?77!~~^^^~!7!!!!!!!!7#&#GPPG#!!!!!!!!!~^^^^~!!7?J~ + :^^^^^^^^~~!77777!!!!!!!??!!!~~!??!!!!!!!!7777!~^^^^^^^^^. + .~~^^^^^^^^^^^^^^^^^^^^^^^^^^~!!~^^^^^^^^^^^^^~~^^^^^^^^^^^~^ + :^^:::~~^^^^^::::::^^^^~~~~~~~~!!!!7777!!!!~~~~~~~~^^^^::::::^^^^^~^.:::^. + :~^^^^^^^^^^::::::::^^^7JJJJ?????????7??????????JJJJ7^^^::::::::^^^^^^^^^~~. + .~^^^^^^::::::::::::::^~~.:~!7?JJJJJJJJJJJJJJJJ?7!~::!~:::::::::::::::^^^^^~^ + .!^^^^^^^^^^^:::::::::^!~ ..::^^^^^^^^::.. !~^::::::::::^^^^^^^^^~~ + !~~~^^^^^^^^^^^^^^^^^~!~ ~!^^^^^^^^^^^^^^^^^^^^!^ + :!~~~~~!!!!~~~~~~~~~~!~ !~~~~~~~~~~~~!!~~~~~!!. + ^!7!777!!777!!!!!!!!!. :!!!!!!!!!777!7777!7!. + .::.. .::^^^^:::. .::^^^^^::. ..:^: +[End] +[Start] + + ..:::^^^^:::... + .:^~!!!!!!!!!!!!!!!!!!~^:. + .^!!7!!~~~^^^^^^^^^^^^^~~~!!!!^. + .~77!~~^^^^^^^^^^^^^^^^:^^^^^^~~!7!^. + .~77!~~~!7?Y5P7^^^^JPP5YJ?77~^^^^^^~!77^ + .77!!~~7GGBGPY7~^^^^~!?J5PGGG7^^^^^^^^~!77: + .77!!!!~~??7~^^^:^^^^^^^^^^~!~^^^^^^^^^^~~!?^ + !?!!!!!77!~~~^^^^^^^~^^^^^^^~~~~~~~^^^^^^~~!?: + .?7!!!7?J7!~^^^^^~~^~!!~^^^^^^^~~!!!~~~^^^~~~7?. + :J7!!!?YJ7!~~^^^^^~~~7!~^^^^^~~~~!777~~~~~~~~!J~ + :J7!!!?5Y??J7~::::^~7?7JJ7~^::^^~!7JJ!~~~~~~~!?7 + .?7!!!7?JJB@@BJ~^^^~??P@@@#J!~^~~!?J7!~~~~~~~!?? + !J!!!!7??YB&&G?7777!7JG#&#Y?77?JJ?!!~~~~~~~~!J7 + .?7!~!!7???JJJJJ?7!!!!77???JJJJ?!!!~~~~~~~~!7Y~ + .^J7!~!!!7??7777!!!~~~~!!!!!!!!!!!~~~~~~~~!7JJ. . + ^^:!J!!~~!!!77!!!~~~~^^^^^^^~~~~~~~~~~~~~~!7J5~:^^: + ^^ .7J?777!!!!!!~~~~^^^^^^^^^^^^^^^^^^~~~~!7JY~J!..~^ + ~^ :?^~7JJ???????7777777777!!!!!!!~~!!777JY?.^?: ^^ + ^~ . ^7 :!YP5YJ?77!!~~~~~~~!!!7??JJJJYY5Y7: .J: . .!: + :^ .!^: ^7 :!JY5PP555555555555555YYYYJ7^. .J. :~~..^. + ^..7: : ^? .:~!?JYY555555YYJJ?7!^: .J... ~! :: + : ^7 ..^^ ...::::... !:. .?..: + ..~^ !^.. + . +[End] +[Start] + __ __ + / \./ \/\_ + __{^\_ _}_ | |/^\ + / /\_/^\._|_/ // / +( (__{(@)}\__|.//_/__A____A_______A________A________A_____A___A___A_____ + \__/{/(_)\_} )\\ \\---v-----V-----V---Y-----v----Y------v-----V-----v-- + ( (__)_)_/ )\ \> + \__/ \__/\/\/ + \__,--' +[End] +[Start] + .. .. + ' L '.` ' +>>--`. U .'-->> + `. V .' + `. .` +[End] +[Start] + .-~~-.--. + : | + .~ ~ -.\ /.- ~~ . + > `. .' < +( .- -. ) + `- -.-~ `- -' ~-.- -' + ( : ) _ _ .-: + ~--. : .--~ .-~ .-~ | + ~-.-^-.-~ \_ .~ .-~ .~ + \ \' \ '_ _ -~ + `.`. // + . - ~ ~-.__`.`-.// + .-~ . - ~ |~ ~ ~-.~-. + .' .-~ .-~ :/~-.~-./: + /_~_ _ . - ~ ~-.~-._ + ~-.< +[End] +[Start] + .-==-. + /{.=-.}\ + | / . \ | + |; : :| + \( : )/ + `._'__.' + |\ || + \ \ || + | | || + | | || /| + \ \|| / / + \ ||| | | + | || | | + \||/ / + ||| / + || | + ||/ + || +^^^^^jgs^^^^^^^^^^^^^^ +[End] +[Start] + .-~~~- + .-~~~_._~~~\ + /~-~~ ~. `._ + / \ \ | ~~-_ + __ | | | | /~\| + _-~~ ~~-..| ______||/__..-~~/ + ~-.___ \ /~\_________.-~~ + \~~--._\ | / + ^-_ ~\ \ /^ + ^~---|~~~~-.___.-~^ + /~^| | | |^~\ + //~^`/ /_/ ^~\\ + / //~|| \ + ~ || + ___ - || __ ___ _ + |\| \ ||_.-~~ /|\- \~-._ + | -\| | ||/ / | |\- | |\ \ + \__-\|______ || | \___\| \_\| + _____ _.-~/|\ \\|| \ | / ~-. + /' --/| / /| \ \|| \ / |\~- + ' ---/| | | |\ | || \__| +| --/| | ; \ /| / -(|| +`./ | / \|/ ||)- + `~^~^ || +[End] +[Start] + ..ooo. + .888888888. + 88"P""T"T888 8o + o8o 8.8"8 88o."8o 8o + 88 . o88o8 8 88."8 88P"o + 88 o8 88 oo.8 888 8 888 88 + 88 88 88o888" 88" o888 88 + 88."8o."T88P.88". 88888 88 + 888."888."88P".o8 8888 888 + "888o"8888oo8888 o888 o8P" + "8888.""888P"P.888".88P + "88888ooo 888P".o888 + ""8P"".oooooo8888P + .oo888ooo. 8888NICK8P8 +o88888"888"88o. "8888"".88 .oo888oo.. + 8888" "88 88888. 88".o88888888"888. + "8888o.""o 88"88o. o8".888"888"88 "88P + T888C.oo. "8."8"8 o8"o888 o88" ".=888" + 88888888o "8 8 8 .8 .8"88 8"".o888o8P + "8888C.o8o 8 8 8" 8 o" ...o"""8888 + "88888888 " 8 .8 8 88888888888" + "8888888o .8o=" o8o..o|8oo88" + "888" 88" 888888888"" + o8P "888""" + ...oo88 + "8oo...oo888"" +[End] +[Start] +_░▒███████ +░██▓▒░░▒▓██ +██▓▒░__░▒▓██___██████ +██▓▒░____░▓███▓__░▒▓██ +██▓▒░___░▓██▓_____░▒▓██ +██▓▒░_______________░▒▓██ +_██▓▒░______________░▒▓██ +__██▓▒░____________░▒▓██ +___██▓▒░__________░▒▓██ +____██▓▒░________░▒▓██ +_____██▓▒░_____░▒▓██ +______██▓▒░__░▒▓██ +_______█▓▒░░▒▓██ +_________░▒▓██ +_______░▒▓██ +_____░▒▓██ +[End] +[Start] +░░░░░░░▄▀▀▀▀█░░░░░░░░░░░░░░░░░░░░ +░░░░░░█▀░░░░█░░░░░░░░░░░░░░░░░░░░ +░░░░░█░░░░░░█▀▀▀▄▄░░░░░░▓░░░░░░░░ +░░░░▄█░░░░░░░░░░░░▀▀▄▄░▓▓▓░░░░░░░ +░░░▄█░░░░░░░░░░░░░░░░░▀▓▓▓▓▀▀▀█░░ +▀▄▄█░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓░░█░░ +▀▄█░▀▄░░░░▄▄░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓ +▄▀█▀▄░░░░███░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓░ +░▀█▀▄░░░░▀▀░░░░░░░░░▄▄░░░▓▓▓▓▓░░░ +░░▀█░░░░░░░░▄▄░░░░░███░░░░▓▓░█░░░ +░░░▀█░░░░░░█░░▀▄░░░▀▀░░░░░▓░█▀░░░ +░░░░▀█░░░░░░▀▄▄▀░░░░░░░░▀▄░█▀░░░░ +░░░░░░▀█▄░░░░░░░░░░░░░▀▄░░██░░░░░ +░░░░░░░░░▀█▄░░░░░░░░▀▄░░██▀░▀░░░░ +░░░░░░░░░░░░▀▀▄▄▄▄▄▄▄█▀█░░▀▄░░░░░ +░░░░░░░░░░░░░░░░░░░░░░░░▀░░░░░░░░ +[End] \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 1a32b82..1f6410a 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -6,9 +6,11 @@ import openai from pyrizz.pickuplines import pickuplines from pyrizz.templates import templates +from better_profanity import profanity +import random load_dotenv() -PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." +PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/" openai.api_key = os.getenv('OPENAI_API_KEY') def get_lines(category='all'): @@ -66,52 +68,73 @@ def rate_line(pickup_line) -> str: except Exception as err: return str(err) + +def load_ascii_art(filename): + with open(filename, 'r', encoding='utf-8') as file: + content = file.read() + ascii_art_pieces = content.split('[End]') + ascii_art_pieces = [piece.strip()[len('[Start]'):].strip() for piece in ascii_art_pieces if piece.strip()] + return ascii_art_pieces + +def create_line(template_number, words): + if not (0 <= template_number < len(templates)): + return None, "Template number out of range. Please choose between 0 and {}.".format(len(templates) - 1) + + template_to_use = templates[template_number] + placeholders_count = template_to_use.count("{}") + if placeholders_count != len(words): + return None, "Incorrect number of words provided for the placeholders. Expected {}, got {}.".format(placeholders_count, len(words)) -def create_line(): - print("Choose a template number (1-20):") try: - template_number = int(input("> ")) - 1 - if not (0 <= template_number < len(templates)): - print("Template number out of range. Please choose between 1 and 20.") - return - - except ValueError: - print("Please enter a valid number.") - return + user_line = template_to_use.format(*words) + except IndexError as e: + return None, f"Error in formatting: {str(e)}" + + if is_line_valid(user_line): + ascii_art_pieces = load_ascii_art(PROJECT_ROOT + 'data/ascii_art.txt') + art = random.choice(ascii_art_pieces) + user_line_with_art = f"{art}\n\n{user_line}" + return user_line_with_art + else: + return None, "Your line doesn't pass our checks. Sorry!" + +def get_user_input_for_line(): + print("Choose a template number (0-{}):".format(len(templates))) + template_number = int(input("> ")) - 1 + + if template_number not in range(len(templates)): + print("Invalid template number. Please choose a number between 0 and {}.".format(len(templates) - 1)) + return None, None template_to_show = templates[template_number] - placeholders_count = template_to_show.count("{}") - placeholder_representation = ['______'] * placeholders_count + placeholders_count = template_to_show.count("{}") + print("Fill in the blanks for the following template:") - print(template_to_show.format(*placeholder_representation)) + print(template_to_show.format(*(['______'] * placeholders_count))) - print(f"Enter {placeholders_count} word(s) separated by a comma to fill into the template:") + print(f"Enter {placeholders_count} word(s) separated by commas to fill into the template:") words = input("> ").split(',') words = [word.strip() for word in words] - try: - user_line = templates[template_number].format(*words) - - except IndexError: - print("Not enough words provided for the placeholders.") - return - - except Exception as e: - print(f"An unexpected formatting error occurred: {e}") - return - - if is_line_valid(user_line): - try: - print("\nLooks great! Try it on a human now and meet your match!") - return(user_line) - - except Exception as e: - print(f"An error occurred while inserting the line into the database: {e}") - else: - return("Your pick-up line doesn't pass our checks.") + return template_number, words def is_line_valid(user_line): if len(user_line) > 140: + print("Your pick-up line is too long.") + return False + + if is_offensive(user_line): return False return True + +def is_offensive(text): + if profanity.contains_profanity(text): + return True + else: + return False + +def list_templates(): + for idx, template in enumerate(templates, 1): + print(f"Template {idx}: {template}") + return templates diff --git a/src/pyrizz/templates.py b/src/pyrizz/templates.py index 835dc87..76e0306 100644 --- a/src/pyrizz/templates.py +++ b/src/pyrizz/templates.py @@ -18,5 +18,25 @@ "If I could rearrange the alphabet, I'd put {} and {} together.", "Are you a {}? Because you're so fine you blow my mind.", "Do you have a pencil? Cause I want to erase your past and write our {}.", - "Do you know what my shirt is made of? It's made of boyfriend {}." + "Do you know what my shirt is made of? It's made of boyfriend {}.", + "Are you a {}? Because you just brightened my day with a single smile.", + "I'm not a genie, but I can make your {} come true.", + "If you were a {}, you'd be a sweet one.", + "Was that an earthquake, or did you just rock my {}?", + "Do you have a name, or can I call you {}?", + "If we were at home, cuddling on a rainy Sunday morning, what would we have for {}? Pancakes, bacon, or {}?", + "Excuse me, but I think you dropped something: MY {}.", + "If you were a fruit, you'd be a {}apple.", + "Are you a {}? Because every time I look at you, I feel like I'm on cloud nine.", + "Do you play soccer? Because you're a {} in the field.", + "If you were words on a page, you'd be the {} print.", + "Did we just share an {}? Because I feel like I've known you forever.", + "I'm writing a term paper on the finer things in life. Can I interview you over {}?", + "I'd never play hide and seek with you because someone like you is impossible to {}.", + "Can I take a picture of you, so I can show Santa what I want for {}?", + "Do you have a sunburn, or are you always this {}?", + "If you were a {} in the sea, I'd swim all the oceans to find you.", + "You must be the square root of -1 because you can't be {}.", + "Is it okay if I follow you home? Because my parents always told me to follow my {}.", + "If you were a {}, you'd be an extraordinary one." ] \ No newline at end of file diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 079bced..c734a92 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -98,27 +98,19 @@ def test_rate_line_empty(self): def test_rate_line_format(self): actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") assert re.match(r'\d+/10 - .+', actual) is not None - - - def test_create_line_invalid_template_number(self, capsys): - with patch('builtins.input', side_effect=["21"]): - pyrizz.create_line() - captured = capsys.readouterr() - assert "Template number out of range. Please choose between 1 and 20." in captured.out - - def test_create_line_invalid_value_input(self, capsys): - with patch('builtins.input', side_effect=["abc"]): - pyrizz.create_line() - captured = capsys.readouterr() - assert "Please enter a valid number." in captured.out - - def test_create_line_not_enough_words(self, capsys): - with patch('builtins.input', side_effect=["17", "test"]): - result = pyrizz.create_line() - captured = capsys.readouterr() - assert "Not enough words provided for the placeholders." in captured.out - + # Tests for user input validation def test_is_line_valid_length(self): long_line = "x" * 141 - assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." \ No newline at end of file + assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." + + @patch("builtins.input", side_effect=["1", "word1, word2"]) + def test_get_user_input_for_line(self, mock_input): + template_number, words = pyrizz.get_user_input_for_line() + assert template_number == 0 + assert words == ["word1", "word2"] + + def test_create_line_invalid_template_number(self): + _, message = pyrizz.create_line(999, ["word1", "word2"]) + assert message == "Template number out of range. Please choose between 0 and {}.".format(len(pyrizz.templates) - 1) + \ No newline at end of file From 273c48f1b4086cc72a42108d1efa5401ff7710ea Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 00:01:55 -0500 Subject: [PATCH 61/95] dependencies --- Pipfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pipfile b/Pipfile index cbedfc9..d3c3c29 100644 --- a/Pipfile +++ b/Pipfile @@ -9,11 +9,13 @@ verify_ssl = true name = "testpypi" [packages] +better_profanity = "*" pytest = "==7.4.3" python-dotenv = "==0.16.0" openai = "==0.28.1" pyrizz = {version = "==0.0.666", index = "testpypi"} + [dev-packages] [requires] From ec2c90c4c255ef3106943a67a95576cea9db4f80 Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 00:07:27 -0500 Subject: [PATCH 62/95] f --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c050d22..7d0e861 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ python-dotenv==0.16.0 openai==0.28.1 -pytest==7.4.3 \ No newline at end of file +pytest==7.4.3 +better-profanity==0.7.0 \ No newline at end of file From d6f4da8b323de557dde1b6a02154366b43f982cd Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 00:10:24 -0500 Subject: [PATCH 63/95] ff --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7608910..e7095eb 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -22,7 +22,7 @@ jobs: pip install --user pipenv pipenv --python ${{ matrix.python-version }} pipenv install pytest - pipenv install + pipenv install --dev - name: Turn on 'editable' mode run: | From 7609aca0d04809b0ed069fc632d9849b1a4b2b68 Mon Sep 17 00:00:00 2001 From: Baani Pasrija Date: Thu, 9 Nov 2023 00:19:40 -0500 Subject: [PATCH 64/95] don't merge yet, but this is the ai code --- Pipfile | 4 + Pipfile.lock | 163 ++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 4 +- src/pyrizz/__main__.py | 24 +++++- src/pyrizz/pyrizz.py | 16 ++-- 5 files changed, 193 insertions(+), 18 deletions(-) diff --git a/Pipfile b/Pipfile index cbedfc9..71a6269 100644 --- a/Pipfile +++ b/Pipfile @@ -13,6 +13,10 @@ pytest = "==7.4.3" python-dotenv = "==0.16.0" openai = "==0.28.1" pyrizz = {version = "==0.0.666", index = "testpypi"} +build = "*" +twine = "*" +aliased = "*" +to = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 421fde7..b3df3aa 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "9d584cf34b3a85e08bd790ccc841cf3eb0070006743efe6825942c0ad600751f" + "sha256": "9da618d6ffb6f837cb5fa53169f3258ca3e9c04b590f56c4803304a63681c91e" }, "pipfile-spec": 6, "requires": { - "python_version": "3" + "python_version": "3.9" }, "sources": [ { @@ -138,6 +138,15 @@ "markers": "python_version >= '3.7'", "version": "==23.1.0" }, + "build": { + "hashes": [ + "sha256:538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b", + "sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==1.0.3" + }, "certifi": { "hashes": [ "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", @@ -242,6 +251,14 @@ "markers": "python_full_version >= '3.7.0'", "version": "==3.3.2" }, + "docutils": { + "hashes": [ + "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6", + "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b" + ], + "markers": "python_version >= '3.7'", + "version": "==0.20.1" + }, "frozenlist": { "hashes": [ "sha256:007df07a6e3eb3e33e9a1fe6a9db7af152bbd8a185f9aaa6ece10a3529e3e1c6", @@ -317,6 +334,14 @@ "markers": "python_version >= '3.5'", "version": "==3.4" }, + "importlib-metadata": { + "hashes": [ + "sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb", + "sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743" + ], + "markers": "python_version >= '3.8'", + "version": "==6.8.0" + }, "iniconfig": { "hashes": [ "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", @@ -325,6 +350,46 @@ "markers": "python_version >= '3.7'", "version": "==2.0.0" }, + "jaraco.classes": { + "hashes": [ + "sha256:10afa92b6743f25c0cf5f37c6bb6e18e2c5bb84a16527ccfc0040ea377e7aaeb", + "sha256:c063dd08e89217cee02c8d5e5ec560f2c8ce6cdc2fcdc2e68f7b2e5547ed3621" + ], + "markers": "python_version >= '3.8'", + "version": "==3.3.0" + }, + "keyring": { + "hashes": [ + "sha256:4901caaf597bfd3bbd78c9a0c7c4c29fcd8310dab2cffefe749e916b6527acd6", + "sha256:ca0746a19ec421219f4d713f848fa297a661a8a8c1504867e55bfb5e09091509" + ], + "markers": "python_version >= '3.8'", + "version": "==24.2.0" + }, + "markdown-it-py": { + "hashes": [ + "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", + "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb" + ], + "markers": "python_version >= '3.8'", + "version": "==3.0.0" + }, + "mdurl": { + "hashes": [ + "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", + "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba" + ], + "markers": "python_version >= '3.7'", + "version": "==0.1.2" + }, + "more-itertools": { + "hashes": [ + "sha256:626c369fa0eb37bac0291bce8259b332fd59ac792fa5497b59837309cd5b114a", + "sha256:64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6" + ], + "markers": "python_version >= '3.8'", + "version": "==10.1.0" + }, "multidict": { "hashes": [ "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9", @@ -405,6 +470,27 @@ "markers": "python_version >= '3.7'", "version": "==6.0.4" }, + "nh3": { + "hashes": [ + "sha256:116c9515937f94f0057ef50ebcbcc10600860065953ba56f14473ff706371873", + "sha256:18415df36db9b001f71a42a3a5395db79cf23d556996090d293764436e98e8ad", + "sha256:203cac86e313cf6486704d0ec620a992c8bc164c86d3a4fd3d761dd552d839b5", + "sha256:2b0be5c792bd43d0abef8ca39dd8acb3c0611052ce466d0401d51ea0d9aa7525", + "sha256:377aaf6a9e7c63962f367158d808c6a1344e2b4f83d071c43fbd631b75c4f0b2", + "sha256:525846c56c2bcd376f5eaee76063ebf33cf1e620c1498b2a40107f60cfc6054e", + "sha256:5529a3bf99402c34056576d80ae5547123f1078da76aa99e8ed79e44fa67282d", + "sha256:7771d43222b639a4cd9e341f870cee336b9d886de1ad9bec8dddab22fe1de450", + "sha256:88c753efbcdfc2644a5012938c6b9753f1c64a5723a67f0301ca43e7b85dcf0e", + "sha256:93a943cfd3e33bd03f77b97baa11990148687877b74193bf777956b67054dcc6", + "sha256:9be2f68fb9a40d8440cbf34cbf40758aa7f6093160bfc7fb018cce8e424f0c3a", + "sha256:a0c509894fd4dccdff557068e5074999ae3b75f4c5a2d6fb5415e782e25679c4", + "sha256:ac8056e937f264995a82bf0053ca898a1cb1c9efc7cd68fa07fe0060734df7e4", + "sha256:aed56a86daa43966dd790ba86d4b810b219f75b4bb737461b6886ce2bde38fd6", + "sha256:e8986f1dd3221d1e741fda0a12eaa4a273f1d80a35e31a1ffe579e7c621d069e", + "sha256:f99212a81c62b5f22f9e7c3e347aa00491114a5647e1f13bbebd79c3e5f08d75" + ], + "version": "==0.2.14" + }, "openai": { "hashes": [ "sha256:4be1dad329a65b4ce1a660fe6d5431b438f429b5855c883435f0f7fcb6d2dcc8", @@ -422,6 +508,14 @@ "markers": "python_version >= '3.7'", "version": "==23.2" }, + "pkginfo": { + "hashes": [ + "sha256:4b7a555a6d5a22169fcc9cf7bfd78d296b0361adad412a346c1226849af5e546", + "sha256:8fd5896e8718a4372f0ea9cc9d96f6417c9b986e23a4d116dda26b62cc29d046" + ], + "markers": "python_version >= '3.6'", + "version": "==1.9.6" + }, "pluggy": { "hashes": [ "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12", @@ -430,6 +524,22 @@ "markers": "python_version >= '3.8'", "version": "==1.3.0" }, + "pygments": { + "hashes": [ + "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692", + "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29" + ], + "markers": "python_version >= '3.7'", + "version": "==2.16.1" + }, + "pyproject-hooks": { + "hashes": [ + "sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8", + "sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5" + ], + "markers": "python_version >= '3.7'", + "version": "==1.0.0" + }, "pyrizz": { "hashes": [ "sha256:0eea82bdb1f115c58f448fb52cf6a812cc05bf8505eed988658c0513f9d8af9a", @@ -456,6 +566,14 @@ "index": "pypi", "version": "==0.16.0" }, + "readme-renderer": { + "hashes": [ + "sha256:13d039515c1f24de668e2c93f2e877b9dbe6c6c32328b90a40a49d8b2b85f36d", + "sha256:2d55489f83be4992fe4454939d1a051c33edbab778e82761d060c9fc6b308cd1" + ], + "markers": "python_version >= '3.8'", + "version": "==42.0" + }, "requests": { "hashes": [ "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", @@ -464,6 +582,30 @@ "markers": "python_version >= '3.7'", "version": "==2.31.0" }, + "requests-toolbelt": { + "hashes": [ + "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6", + "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.0.0" + }, + "rfc3986": { + "hashes": [ + "sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd", + "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c" + ], + "markers": "python_version >= '3.7'", + "version": "==2.0.0" + }, + "rich": { + "hashes": [ + "sha256:2b38e2fe9ca72c9a00170a1a2d20c63c790d0e10ef1fe35eba76e1e7b1d7d245", + "sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef" + ], + "markers": "python_full_version >= '3.7.0'", + "version": "==13.6.0" + }, "tqdm": { "hashes": [ "sha256:d302b3c5b53d47bce91fea46679d9c3c6508cf6332229aa1e7d8653723793386", @@ -472,6 +614,15 @@ "markers": "python_version >= '3.7'", "version": "==4.66.1" }, + "twine": { + "hashes": [ + "sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8", + "sha256:9e102ef5fdd5a20661eb88fad46338806c3bd32cf1db729603fe3697b1bc83c8" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==4.0.2" + }, "urllib3": { "hashes": [ "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84", @@ -559,6 +710,14 @@ ], "markers": "python_version >= '3.7'", "version": "==1.9.2" + }, + "zipp": { + "hashes": [ + "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31", + "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0" + ], + "markers": "python_version >= '3.8'", + "version": "==3.17.0" } }, "develop": {} diff --git a/pyproject.toml b/pyproject.toml index cf19c6f..4510a48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,11 +5,11 @@ 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.0.3" +version = "0.0.91" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, - { name="Baani Pasrija", email="baanipasrija25@gmail.com" }, + { name="Baani Pasrsija", email="baanipasrija25@gmail.com" }, { name="Zander Chen", email="ccczy2002@gmail.com" } ] license = { file = "LICENSE" } diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 9c0f2a1..e2b2c47 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,5 @@ -import pyrizz.pyrizz as pyrizz +import pyrizz as pyrizz +import openai """Main function for PyRizz.""" @@ -16,6 +17,7 @@ print("\n") def main(): + openai_client = openai print("Welcome to PyRizz! Your journey to getting a date begins here...\n") while True: @@ -25,6 +27,9 @@ def main(): print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters)") print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") print("5. Create your very own pickup line!.\n") + + print("6. Enter your API key to use AI functionality.\n") + print("!! Type Q to quit !!\n") print("Enter your choice: ") @@ -55,15 +60,26 @@ def main(): elif user_input == "3": print("Enter a category / language: ") category = input("> ") - print("\n" + pyrizz.get_ai_line(category), end = "\n\n") + print("\n" + pyrizz.get_ai_line(category, openai_client), end = "\n\n") elif user_input == "4": print("Type your pickup line: ") pickup_line = input("> ") - print("\n" + pyrizz.rate_line(pickup_line), end = "\n\n") + print("\n" + pyrizz.rate_line(pickup_line, openai_client), end = "\n\n") elif user_input == "5": pyrizz.create_line() + + elif user_input == "6": + print("Please enter your API key.") + user_api_key = input("> ") + try: + openai_client.api_key = user_api_key + openai_client.Model.list() + print("Successful. You can use AI functionality now!\n") + except openai_client.error.AuthenticationError as err: + print(err) + print() elif user_input == "q" or user_input == "Q": break @@ -72,7 +88,7 @@ def main(): print("\nInvalid Response.") while True: - user_cont = input("Would you like to try again? (y/n): ") + user_cont = input("Would you like to continue? (y/n): ") if user_cont in ["y", "n"]: break else: diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 1a32b82..3eea975 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -2,14 +2,10 @@ import random import pathlib import json -from dotenv import load_dotenv -import openai from pyrizz.pickuplines import pickuplines from pyrizz.templates import templates -load_dotenv() PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." -openai.api_key = os.getenv('OPENAI_API_KEY') def get_lines(category='all'): if category not in pickuplines: @@ -26,11 +22,11 @@ def get_random_category_line(category='all'): category_pickupline = get_lines(category) return random.choice(category_pickupline) -def get_ai_line(category) -> str: +def get_ai_line(category, client) -> str: try: if (category != "" and len(category) <= 50): - response = openai.ChatCompletion.create( - model = os.getenv('OPENAI_MODEL'), + response = client.ChatCompletion.create( + model = "gpt-3.5-turbo", messages = [{"role": "user", "content": f"I need a {category} pick-up line."},] ) @@ -48,11 +44,11 @@ def get_ai_line(category) -> str: except Exception as err: return str(err) -def rate_line(pickup_line) -> str: +def rate_line(pickup_line, client) -> str: try: if (pickup_line != ""): - response = openai.ChatCompletion.create( - model = os.getenv('OPENAI_MODEL'), + response = client.ChatCompletion.create( + model = "gpt-3.5-turbo", messages = [{"role": "user", "content": f"Rate this pickup line out of 10 (whole numbers only): {pickup_line} In your response, STRICTLY follow the format of (nothing else): rating/10 - snazzy comment."},] ) From e1b913443248906c2fbbb2729581927a64392cf4 Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 00:20:06 -0500 Subject: [PATCH 65/95] fff --- Pipfile | 2 -- requirements.txt | 3 +-- src/pyrizz/pyrizz.py | 16 ++++++++-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Pipfile b/Pipfile index d3c3c29..cbedfc9 100644 --- a/Pipfile +++ b/Pipfile @@ -9,13 +9,11 @@ verify_ssl = true name = "testpypi" [packages] -better_profanity = "*" pytest = "==7.4.3" python-dotenv = "==0.16.0" openai = "==0.28.1" pyrizz = {version = "==0.0.666", index = "testpypi"} - [dev-packages] [requires] diff --git a/requirements.txt b/requirements.txt index 7d0e861..c050d22 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ python-dotenv==0.16.0 openai==0.28.1 -pytest==7.4.3 -better-profanity==0.7.0 \ No newline at end of file +pytest==7.4.3 \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 1f6410a..69bdf04 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -6,7 +6,7 @@ import openai from pyrizz.pickuplines import pickuplines from pyrizz.templates import templates -from better_profanity import profanity +#from better_profanity import profanity import random load_dotenv() @@ -123,16 +123,16 @@ def is_line_valid(user_line): print("Your pick-up line is too long.") return False - if is_offensive(user_line): - return False + #if is_offensive(user_line): + #return False return True -def is_offensive(text): - if profanity.contains_profanity(text): - return True - else: - return False +#def is_offensive(text): +# if profanity.contains_profanity(text): +# return True +# else: +# return False def list_templates(): for idx, template in enumerate(templates, 1): From a2289e355b59389b0c45505e3ebef15ac5e2ed79 Mon Sep 17 00:00:00 2001 From: annsts <98844972+annsts@users.noreply.github.com> Date: Thu, 9 Nov 2023 00:24:20 -0500 Subject: [PATCH 66/95] Revert "ascii art" --- .github/workflows/python.yml | 2 +- README.md | 3 +- src/pyrizz/__main__.py | 13 +- src/pyrizz/data/ascii_art.txt | 415 ---------------------------------- src/pyrizz/pyrizz.py | 93 +++----- src/pyrizz/templates.py | 22 +- tests/test_pyrizz.py | 34 +-- 7 files changed, 61 insertions(+), 521 deletions(-) delete mode 100644 src/pyrizz/data/ascii_art.txt diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index e7095eb..7608910 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -22,7 +22,7 @@ jobs: pip install --user pipenv pipenv --python ${{ matrix.python-version }} pipenv install pytest - pipenv install --dev + pipenv install - name: Turn on 'editable' mode run: | diff --git a/README.md b/README.md index 84a8e1c..6652e9a 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,8 @@ In this function, if you're new to pickup lines, you can create your very own pi ``` from pyrizz import pyrizz -print(pyrizz.create_line(template_number, words)) +print(pyrizz.create_line()) ``` -Then this function returns your line with some random ASCII art. 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) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 3020adf..9c0f2a1 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -24,8 +24,7 @@ def main(): print("2. Get a category-specific random pick-up line (romantic, clever, geeky, dev)") print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters)") print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") - print("5. Create your line with one of our templates with randomly selected ASCII art.") - print("6. List available templates for pick-up lines.\n") + print("5. Create your very own pickup line!.\n") print("!! Type Q to quit !!\n") print("Enter your choice: ") @@ -64,15 +63,7 @@ def main(): print("\n" + pyrizz.rate_line(pickup_line), end = "\n\n") elif user_input == "5": - template_number, words = pyrizz.get_user_input_for_line() - line = pyrizz.create_line(template_number, words) - if line: - print("\nHere's your custom pick-up line:") - print(line) - - elif user_input == "6": - print("Here are the available templates:") - pyrizz.list_templates() + pyrizz.create_line() elif user_input == "q" or user_input == "Q": break diff --git a/src/pyrizz/data/ascii_art.txt b/src/pyrizz/data/ascii_art.txt deleted file mode 100644 index feffdc8..0000000 --- a/src/pyrizz/data/ascii_art.txt +++ /dev/null @@ -1,415 +0,0 @@ -# ascii_art.txt -[Start] -,d88b.d88b, ,d88b.d88b, ,d88b.d88b, ,d88b.d88b, ,d88b.d88b, -88888888888 88888888888 88888888888 88888888888 88888888888 -`Y8888888Y' `Y8888888Y' `Y8888888Y' `Y8888888Y' `Y8888888Y' - `Y888Y' `Y888Y' `Y888Y' `Y888Y' `Y888Y' - `Y' `Y' `Y' `Y' `Y' -[End] -[Start] - _ _ - /` \/ `\_ _ - \ /` \/ `\ - '. .\ / - \/ '. .' - \/ -[End] -[Start] - @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ - @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ -\\\\ @ @ @ @ @ @ @ @ @ @ @ @ - ------@ ---( @-----@ )---( @-----@ )---( @-----@ )--- @--------> -//// @ @ @ @ @ @ @ @ - @ @ @ @ @ @ @ @ - @ @ @ @ @ @ @ @ - @ @ @ @ @ @ @ @ - @ @ @ @ -[End] -[Start] - ****** ****** - ********** ********** - ************* ************* -***************************** -***************************** -***************************** - *************************** - *********************** - ******************* - *************** - *********** - ******* - *** - * -[End] -[Start] -oo - oo @@@@@@@@: @@@@@@@@! - o@@@@!!!!;;;;@ @@.......:;!@ - 'O@@!!!;;;;;;;;@ @.......: ;!@ - @@@!!!!;;::::::.@@........: ;!@ - @@!!!!;;:::::..............: ;!@ - @@@!!!;::::::..............: ;!@ - @@!!;;::::::.............: ;!@ - @@!;;::::::......oo.....::::!@ - @!!;::::::........oo..:::@ - !!!;:::::..........oo@ - !!;:::::.......@ oo * - ;;::::.....@ oo *** - :::..@ ooo*## - ::. _##ooo### - : **########## -[End] -[Start] - _____ _____ - ,ad8PPPP88b, ,d88PPPP8ba, - d8P" "Y8b, ,d8P" "Y8b -dP' "8a8" `Yd -8( " )8 -I8 8I - Yb, ,dP - "8a, ,a8" - "8a, ,a8" - "Yba adP" - `Y8a a8P' - `88, ,88' - "8b d8" - "8b d8" - `888' - " -[End] -[Start] - .;;;, .;;;, .;;;, .;;;, - .;;;,;;;;;,;;;;;,.;;;, .;;;.,;;;;;,;;;;;,;;;. - ;;;;xXXxXXxXXxXXxXXx;;;. .,. .;;;xXXxXXxXXxXXxXX;;;;; - .,,.`xXX' `xXXx,;;;;;,xXXx' `XXx;;,,. - ;;;;xXX' `xXXx;xXXx' `XXx;;;; - `;;XX' `XXX' `XX;;' -,;;,XX `X' XX,;;, -;;;;XX, ,XX;;;; - ``.;XX, ,XX;,'' - ;;;;XX, ,XX;;;; - ```.;XX, ,XX;,''' - ;;;;XX, ,XX;;;; - ```,;XX, ,XX;,''' - ;;;;XX, ,XX;;;; - ````,;XX, ,XX;, ''' - ;;;;;XX, ,XX;;;; - `````,;XX, ,XX;,'''' - ;;;;;XX, ,XX;;;;; - `````;;XX;;''''' - `;;;;' -[End] -[Start] - | \ \ | |/ / - | |\ `' ' / - | ;'aorta \ / , pulmonary - | ; _, | / / , arteries - superior | | ( `-.;_,-' '-' , -vena cava | `, `-._ _,-'_ - |,-`. `.) ,<_,-'_, pulmonary - ,' `. / ,' `;-' _, veins - ; `./ /`, \-' - | right / | ;\ |\ - | atrium ;_,._|_, `, ' \ - | \ \ ` `, - ` __ ` \ left ;, - \ ,' ` \, ventricle - \_| ;, ;; - | \ `;, ;; - inferior | |`. `;;, ;' -vena cava | | `-. ;;;;,;' - | | |`-.._ ,;;;;;' - | | | | ``';;;' FL - aorta -[End] -[Start] -:::::::8888!!!888888::::::::88888 8888888:::::::::::::::::::::::::::::::::::::: -::::::888!!!!!!!!!!8888:::888!!!! !! !!!8888::::88888888:::::::::8888888888::::: -:::::8!!:!: !!!!!88888!!!! ! !!!!88888!! !!!!88::::::8888! :888888: -::::88!! : ::!!!88!!!!! ! :!!888!!!! !!!!!88:88! ! !!!888 -:::88:! :::!!!:!!: ! !!!!88!!!! !!!!!!888! !! !!!!!!!!8 -:::8::! !! !:!:!!::: : !!!!88:! ::!!:!8! !! !!!! !!!! -::8!:! : !! !!!:::!!!!! !:!!!8: !!!:!!!:!!:: ! !!!!! -::8::!: ! ! !!!!:!:::!:: !:!::!!88! !:!!!::!:!::: !!!!!!!! -$$$$$$$$: !!! !!!::!!!::!! !!:!!:8!! ! !!::!::::::! ! !!:!!!!!! -:$$$$$$$$$ ::::!!!!:!!!!::: !!!!!:!!!8!!: : !!!!!!!!!!!: !!!!$$$::!!! -::$$$$$$$$$$::!!!:!!!!!!:::!!!!::!!!!!!88!:: !!! !!!!!!!!:::! !: :::!$$$$$:!! -:::$$$$$$$$$$$:!!:::::::!!!!!!!!!!!!!:!!88:::::::::::::!!!!!!!!: :!!!!!!!:$$$$$! -$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$8$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -:::$$$$$$$$$$$:!!!!!!!!!!!!!!::!!!:!:!!!!:8! : ! !!::!:!:::!!!!!::!!!!!!!$$$$$$! -::$$$$$$$$$!: :!! ! !:::!!!!!:!!:!!!!!!!8 : ::! !:!!!!!!!::!:::$$$$!!! -$$$$$$$$$8:!! : :::: ::!:!!!::::::!!!!:!88! !!!! !::!!!!!!!!!$$$$!!!8 -$$$$$$$$$888!! ! !!!! !:::::::!!:!!!!!!!88!8!! !!!::!!!!!!!::!:$$$!!!88: -$$$$$$$::::888 ::: !!!:!!::!!!!!!!!!88:::8!!! ! !!!::!!!!!!!:::!!!888: -::::::::::::88 ! :!!!!!!!!!:!:!!!8!:::::888! !!:!::::!!!!!!888::: -::::::::::::::8 !!:::!!:!:!!!!!8:::::::::88!! !!!!!!!!!!!!!8888:::: -:::::::::::::::888! !! !!!!!!!!!!!!!!88::::::::::::88!!! !:!!!!!!::!8888::::: -:::::::::::::::::88!!! !!::!!!!!!!!88:::::::::::::::888!! !!!!!:!!!88::::::: -:::::::::::::::::::888!!!!!!!!!!!888::::::::::::::::::::888! !!!!!8888:::::::: -::::::::::::::::::::8888!!!!!!8!88:::::::::::::::::::::::!888!!!8!!88::::::::::: -[End] -[Start] - .. - $. ,o$$$o. - $. $$$$$$$o. .. - .$. $' $$$$$$ ,o'' - .$' $ '$$$$$,o'.,' .oo' - .$' $. $$$$' ,, .o'. - .$' '$o. 'O$ ..ooo''',oo' - .$' .o$' '$$'' ,,o' - .%$,,,,,ooO' ' ,,o'' -.$o. ,o' $o ..oo' - ''O'''''''''',' $'$. .o' - '$ $ '$,'o' ' - '$ $ .o $ - '$ $ .$$ - '$ $, .o$$ - '$ $. ,o' $ - $. '$. $,oooo''o, - $. $. 'o' '$ - $. $. .,ooo, $ - .'' 'oo...o' $ 'o $ - $ $ '' - $ $ - $ % - ,$ $ - $ $' -[End] -[Start] - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - < :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: > - < :::::::::::: :::::::::::: :::::::::::: > - < ::::::::: :::: ::::::::: > - < ::::::: ******** :: ******** ::::::: > - < ::::: **** **** **** **** ::::: > - < :::: **** **** **** :::: > - < ::: **** ** **** ::: > - < ::: **** **** ::: > - < :::: **** ***** :::: > - < ::::: **** **** ::::: > - < ::::::: **** **** ::::::: > - < ::::::::: **** **** ::::::::: > - < ::::::::::: **** **** ::::::::::: > - < :::::::::::::: **** **** :::::::::::::: > - < ::::::::::::::::: **** **** ::::::::::::::::: > - < :::::::::::::::::::: **** :::::::::::::::::::: > - < ::::::::::::::::::::::: ** ::::::::::::::::::::::: > - < ::::::::::::::::::::::::: ::::::::::::::::::::::::: > - < ::::::::::::::::::::::::::: ::::::::::::::::::::::::::: > - < ::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::: > - < :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: > - ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() -[End] -[Start] - ...::::::::::... - .:^^~~!!!~~~~~~~~~~!!!~~~^:. - .:~!!!~~~^^^::::::::::::^^^~~~!!!~:. - .^!!!~~^^::..... .....::^^~~!!!^. - :!!!~~^::............................::^~~!!!:. - .^!!!~^^:..................................:^^~!7!^. - ^!7!~^::......................................:^^~!77^ - .!7!~~^:.......^7:......................:7^.......:^~~!7!. - :77!~^::::.....!GB~......................~BG!.....::::^~!77: - ^?7!~^::::...:!5BG7........................7GB5!:...::::^~!7?^ - :?7!~^^:::^~7YPGPJ^..........................^JPGPY7~^:::^^~!7?: - .77!!~^:^JY555J7~:::^^::....:::::::::::...::^^:.:~7J555YJ^:^~!!7?. - !?!!~^^^^^^^:::~7??777JYJ7^:.::::::::.:~7??777JYJ7^::::^^^^^^~!!?! - .?7!!~^^^^^^::!557:. .Y#BG5!::::::::!557:. .J##G57::^^^^^^~!!7?. - ~?7!!~^^^^^^^Y#Y. 5@@@&#Y::::::Y#5: Y@@@&#Y^^^^^^^~!!7?~ - !?7!!~~~^^^^7@&^ ^5@@@@@@@J::::!@&! :Y@@@@@@@J^^^~~~~!!7?! - 7?7!!~~~~~~^7@@P!^^~?P&@&&@@@@@Y::::7@@G7^^~75&@&&@@@@@Y^~~~~~~!!7?7 - !?77!!!~~~~~~P@@@@&@@@#7:?&@@@#~:^^:^P@@@@&@@@#7:?&@@@#!^~~~~!!!77?7 - ~J77!!!!!~~~~~5&@@@@@@#Y5#@@@P~:^^^^^^Y&@@@@@@#Y5#@@@G!~~~~!!!!777J~ - :J?777!!!!!~~~~!YG&@@@@@@&B57^^^^^^^^^^!YG&@@@@@@&B57~~~~!!!!!777?J. - !J?777!!!!!~~~~^^~!7??7!~^^^^^^^^^^^^^^^^~!7??77~~^~~~~!!!!!777?J! - .J?7777!!!!!~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^~~~~~!!!!!7777?JJ. - ^J??7777!!!!!~~~~~~~~~^^^^^^^^^^^^^^^^^^^^~~~~~~~~~!!!!!7777?JJ^ - ^JJ?77777!!!!!~~~~~~~~~~~~~^^^^^^^~^~~~~~~~~~~~!!!!!!77777?JJ^ - :JJ??77777!!!!!!!~~~~~~~~~^^^~~^^^~~~~~~~~~!!!!!!!77777??JJ: - .7JJ???777!~~~!!!!!~~~~~!J5GGGG5J!~~~~~!!!!~~~!!777???JY7. - ~?77!~~^^^~!7!!!!!!!!7#&#GPPG#!!!!!!!!!~^^^^~!!7?J~ - :^^^^^^^^~~!77777!!!!!!!??!!!~~!??!!!!!!!!7777!~^^^^^^^^^. - .~~^^^^^^^^^^^^^^^^^^^^^^^^^^~!!~^^^^^^^^^^^^^~~^^^^^^^^^^^~^ - :^^:::~~^^^^^::::::^^^^~~~~~~~~!!!!7777!!!!~~~~~~~~^^^^::::::^^^^^~^.:::^. - :~^^^^^^^^^^::::::::^^^7JJJJ?????????7??????????JJJJ7^^^::::::::^^^^^^^^^~~. - .~^^^^^^::::::::::::::^~~.:~!7?JJJJJJJJJJJJJJJJ?7!~::!~:::::::::::::::^^^^^~^ - .!^^^^^^^^^^^:::::::::^!~ ..::^^^^^^^^::.. !~^::::::::::^^^^^^^^^~~ - !~~~^^^^^^^^^^^^^^^^^~!~ ~!^^^^^^^^^^^^^^^^^^^^!^ - :!~~~~~!!!!~~~~~~~~~~!~ !~~~~~~~~~~~~!!~~~~~!!. - ^!7!777!!777!!!!!!!!!. :!!!!!!!!!777!7777!7!. - .::.. .::^^^^:::. .::^^^^^::. ..:^: -[End] -[Start] - - ..:::^^^^:::... - .:^~!!!!!!!!!!!!!!!!!!~^:. - .^!!7!!~~~^^^^^^^^^^^^^~~~!!!!^. - .~77!~~^^^^^^^^^^^^^^^^:^^^^^^~~!7!^. - .~77!~~~!7?Y5P7^^^^JPP5YJ?77~^^^^^^~!77^ - .77!!~~7GGBGPY7~^^^^~!?J5PGGG7^^^^^^^^~!77: - .77!!!!~~??7~^^^:^^^^^^^^^^~!~^^^^^^^^^^~~!?^ - !?!!!!!77!~~~^^^^^^^~^^^^^^^~~~~~~~^^^^^^~~!?: - .?7!!!7?J7!~^^^^^~~^~!!~^^^^^^^~~!!!~~~^^^~~~7?. - :J7!!!?YJ7!~~^^^^^~~~7!~^^^^^~~~~!777~~~~~~~~!J~ - :J7!!!?5Y??J7~::::^~7?7JJ7~^::^^~!7JJ!~~~~~~~!?7 - .?7!!!7?JJB@@BJ~^^^~??P@@@#J!~^~~!?J7!~~~~~~~!?? - !J!!!!7??YB&&G?7777!7JG#&#Y?77?JJ?!!~~~~~~~~!J7 - .?7!~!!7???JJJJJ?7!!!!77???JJJJ?!!!~~~~~~~~!7Y~ - .^J7!~!!!7??7777!!!~~~~!!!!!!!!!!!~~~~~~~~!7JJ. . - ^^:!J!!~~!!!77!!!~~~~^^^^^^^~~~~~~~~~~~~~~!7J5~:^^: - ^^ .7J?777!!!!!!~~~~^^^^^^^^^^^^^^^^^^~~~~!7JY~J!..~^ - ~^ :?^~7JJ???????7777777777!!!!!!!~~!!777JY?.^?: ^^ - ^~ . ^7 :!YP5YJ?77!!~~~~~~~!!!7??JJJJYY5Y7: .J: . .!: - :^ .!^: ^7 :!JY5PP555555555555555YYYYJ7^. .J. :~~..^. - ^..7: : ^? .:~!?JYY555555YYJJ?7!^: .J... ~! :: - : ^7 ..^^ ...::::... !:. .?..: - ..~^ !^.. - . -[End] -[Start] - __ __ - / \./ \/\_ - __{^\_ _}_ | |/^\ - / /\_/^\._|_/ // / -( (__{(@)}\__|.//_/__A____A_______A________A________A_____A___A___A_____ - \__/{/(_)\_} )\\ \\---v-----V-----V---Y-----v----Y------v-----V-----v-- - ( (__)_)_/ )\ \> - \__/ \__/\/\/ - \__,--' -[End] -[Start] - .. .. - ' L '.` ' ->>--`. U .'-->> - `. V .' - `. .` -[End] -[Start] - .-~~-.--. - : | - .~ ~ -.\ /.- ~~ . - > `. .' < -( .- -. ) - `- -.-~ `- -' ~-.- -' - ( : ) _ _ .-: - ~--. : .--~ .-~ .-~ | - ~-.-^-.-~ \_ .~ .-~ .~ - \ \' \ '_ _ -~ - `.`. // - . - ~ ~-.__`.`-.// - .-~ . - ~ |~ ~ ~-.~-. - .' .-~ .-~ :/~-.~-./: - /_~_ _ . - ~ ~-.~-._ - ~-.< -[End] -[Start] - .-==-. - /{.=-.}\ - | / . \ | - |; : :| - \( : )/ - `._'__.' - |\ || - \ \ || - | | || - | | || /| - \ \|| / / - \ ||| | | - | || | | - \||/ / - ||| / - || | - ||/ - || -^^^^^jgs^^^^^^^^^^^^^^ -[End] -[Start] - .-~~~- - .-~~~_._~~~\ - /~-~~ ~. `._ - / \ \ | ~~-_ - __ | | | | /~\| - _-~~ ~~-..| ______||/__..-~~/ - ~-.___ \ /~\_________.-~~ - \~~--._\ | / - ^-_ ~\ \ /^ - ^~---|~~~~-.___.-~^ - /~^| | | |^~\ - //~^`/ /_/ ^~\\ - / //~|| \ - ~ || - ___ - || __ ___ _ - |\| \ ||_.-~~ /|\- \~-._ - | -\| | ||/ / | |\- | |\ \ - \__-\|______ || | \___\| \_\| - _____ _.-~/|\ \\|| \ | / ~-. - /' --/| / /| \ \|| \ / |\~- - ' ---/| | | |\ | || \__| -| --/| | ; \ /| / -(|| -`./ | / \|/ ||)- - `~^~^ || -[End] -[Start] - ..ooo. - .888888888. - 88"P""T"T888 8o - o8o 8.8"8 88o."8o 8o - 88 . o88o8 8 88."8 88P"o - 88 o8 88 oo.8 888 8 888 88 - 88 88 88o888" 88" o888 88 - 88."8o."T88P.88". 88888 88 - 888."888."88P".o8 8888 888 - "888o"8888oo8888 o888 o8P" - "8888.""888P"P.888".88P - "88888ooo 888P".o888 - ""8P"".oooooo8888P - .oo888ooo. 8888NICK8P8 -o88888"888"88o. "8888"".88 .oo888oo.. - 8888" "88 88888. 88".o88888888"888. - "8888o.""o 88"88o. o8".888"888"88 "88P - T888C.oo. "8."8"8 o8"o888 o88" ".=888" - 88888888o "8 8 8 .8 .8"88 8"".o888o8P - "8888C.o8o 8 8 8" 8 o" ...o"""8888 - "88888888 " 8 .8 8 88888888888" - "8888888o .8o=" o8o..o|8oo88" - "888" 88" 888888888"" - o8P "888""" - ...oo88 - "8oo...oo888"" -[End] -[Start] -_░▒███████ -░██▓▒░░▒▓██ -██▓▒░__░▒▓██___██████ -██▓▒░____░▓███▓__░▒▓██ -██▓▒░___░▓██▓_____░▒▓██ -██▓▒░_______________░▒▓██ -_██▓▒░______________░▒▓██ -__██▓▒░____________░▒▓██ -___██▓▒░__________░▒▓██ -____██▓▒░________░▒▓██ -_____██▓▒░_____░▒▓██ -______██▓▒░__░▒▓██ -_______█▓▒░░▒▓██ -_________░▒▓██ -_______░▒▓██ -_____░▒▓██ -[End] -[Start] -░░░░░░░▄▀▀▀▀█░░░░░░░░░░░░░░░░░░░░ -░░░░░░█▀░░░░█░░░░░░░░░░░░░░░░░░░░ -░░░░░█░░░░░░█▀▀▀▄▄░░░░░░▓░░░░░░░░ -░░░░▄█░░░░░░░░░░░░▀▀▄▄░▓▓▓░░░░░░░ -░░░▄█░░░░░░░░░░░░░░░░░▀▓▓▓▓▀▀▀█░░ -▀▄▄█░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓░░█░░ -▀▄█░▀▄░░░░▄▄░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓ -▄▀█▀▄░░░░███░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓░ -░▀█▀▄░░░░▀▀░░░░░░░░░▄▄░░░▓▓▓▓▓░░░ -░░▀█░░░░░░░░▄▄░░░░░███░░░░▓▓░█░░░ -░░░▀█░░░░░░█░░▀▄░░░▀▀░░░░░▓░█▀░░░ -░░░░▀█░░░░░░▀▄▄▀░░░░░░░░▀▄░█▀░░░░ -░░░░░░▀█▄░░░░░░░░░░░░░▀▄░░██░░░░░ -░░░░░░░░░▀█▄░░░░░░░░▀▄░░██▀░▀░░░░ -░░░░░░░░░░░░▀▀▄▄▄▄▄▄▄█▀█░░▀▄░░░░░ -░░░░░░░░░░░░░░░░░░░░░░░░▀░░░░░░░░ -[End] \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 69bdf04..1a32b82 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -6,11 +6,9 @@ import openai from pyrizz.pickuplines import pickuplines from pyrizz.templates import templates -#from better_profanity import profanity -import random load_dotenv() -PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/" +PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." openai.api_key = os.getenv('OPENAI_API_KEY') def get_lines(category='all'): @@ -68,73 +66,52 @@ def rate_line(pickup_line) -> str: except Exception as err: return str(err) - -def load_ascii_art(filename): - with open(filename, 'r', encoding='utf-8') as file: - content = file.read() - ascii_art_pieces = content.split('[End]') - ascii_art_pieces = [piece.strip()[len('[Start]'):].strip() for piece in ascii_art_pieces if piece.strip()] - return ascii_art_pieces - -def create_line(template_number, words): - if not (0 <= template_number < len(templates)): - return None, "Template number out of range. Please choose between 0 and {}.".format(len(templates) - 1) - - template_to_use = templates[template_number] - placeholders_count = template_to_use.count("{}") - if placeholders_count != len(words): - return None, "Incorrect number of words provided for the placeholders. Expected {}, got {}.".format(placeholders_count, len(words)) +def create_line(): + print("Choose a template number (1-20):") try: - user_line = template_to_use.format(*words) - except IndexError as e: - return None, f"Error in formatting: {str(e)}" - - if is_line_valid(user_line): - ascii_art_pieces = load_ascii_art(PROJECT_ROOT + 'data/ascii_art.txt') - art = random.choice(ascii_art_pieces) - user_line_with_art = f"{art}\n\n{user_line}" - return user_line_with_art - else: - return None, "Your line doesn't pass our checks. Sorry!" - -def get_user_input_for_line(): - print("Choose a template number (0-{}):".format(len(templates))) - template_number = int(input("> ")) - 1 - - if template_number not in range(len(templates)): - print("Invalid template number. Please choose a number between 0 and {}.".format(len(templates) - 1)) - return None, None + template_number = int(input("> ")) - 1 + if not (0 <= template_number < len(templates)): + print("Template number out of range. Please choose between 1 and 20.") + return + + except ValueError: + print("Please enter a valid number.") + return template_to_show = templates[template_number] - placeholders_count = template_to_show.count("{}") - + placeholders_count = template_to_show.count("{}") + placeholder_representation = ['______'] * placeholders_count print("Fill in the blanks for the following template:") - print(template_to_show.format(*(['______'] * placeholders_count))) + print(template_to_show.format(*placeholder_representation)) - print(f"Enter {placeholders_count} word(s) separated by commas to fill into the template:") + print(f"Enter {placeholders_count} word(s) separated by a comma to fill into the template:") words = input("> ").split(',') words = [word.strip() for word in words] - return template_number, words + try: + user_line = templates[template_number].format(*words) + + except IndexError: + print("Not enough words provided for the placeholders.") + return + + except Exception as e: + print(f"An unexpected formatting error occurred: {e}") + return + + if is_line_valid(user_line): + try: + print("\nLooks great! Try it on a human now and meet your match!") + return(user_line) + + except Exception as e: + print(f"An error occurred while inserting the line into the database: {e}") + else: + return("Your pick-up line doesn't pass our checks.") def is_line_valid(user_line): if len(user_line) > 140: - print("Your pick-up line is too long.") return False - - #if is_offensive(user_line): - #return False return True - -#def is_offensive(text): -# if profanity.contains_profanity(text): -# return True -# else: -# return False - -def list_templates(): - for idx, template in enumerate(templates, 1): - print(f"Template {idx}: {template}") - return templates diff --git a/src/pyrizz/templates.py b/src/pyrizz/templates.py index 76e0306..835dc87 100644 --- a/src/pyrizz/templates.py +++ b/src/pyrizz/templates.py @@ -18,25 +18,5 @@ "If I could rearrange the alphabet, I'd put {} and {} together.", "Are you a {}? Because you're so fine you blow my mind.", "Do you have a pencil? Cause I want to erase your past and write our {}.", - "Do you know what my shirt is made of? It's made of boyfriend {}.", - "Are you a {}? Because you just brightened my day with a single smile.", - "I'm not a genie, but I can make your {} come true.", - "If you were a {}, you'd be a sweet one.", - "Was that an earthquake, or did you just rock my {}?", - "Do you have a name, or can I call you {}?", - "If we were at home, cuddling on a rainy Sunday morning, what would we have for {}? Pancakes, bacon, or {}?", - "Excuse me, but I think you dropped something: MY {}.", - "If you were a fruit, you'd be a {}apple.", - "Are you a {}? Because every time I look at you, I feel like I'm on cloud nine.", - "Do you play soccer? Because you're a {} in the field.", - "If you were words on a page, you'd be the {} print.", - "Did we just share an {}? Because I feel like I've known you forever.", - "I'm writing a term paper on the finer things in life. Can I interview you over {}?", - "I'd never play hide and seek with you because someone like you is impossible to {}.", - "Can I take a picture of you, so I can show Santa what I want for {}?", - "Do you have a sunburn, or are you always this {}?", - "If you were a {} in the sea, I'd swim all the oceans to find you.", - "You must be the square root of -1 because you can't be {}.", - "Is it okay if I follow you home? Because my parents always told me to follow my {}.", - "If you were a {}, you'd be an extraordinary one." + "Do you know what my shirt is made of? It's made of boyfriend {}." ] \ No newline at end of file diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index c734a92..079bced 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -98,19 +98,27 @@ def test_rate_line_empty(self): def test_rate_line_format(self): actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") assert re.match(r'\d+/10 - .+', actual) is not None - + + + def test_create_line_invalid_template_number(self, capsys): + with patch('builtins.input', side_effect=["21"]): + pyrizz.create_line() + captured = capsys.readouterr() + assert "Template number out of range. Please choose between 1 and 20." in captured.out + + def test_create_line_invalid_value_input(self, capsys): + with patch('builtins.input', side_effect=["abc"]): + pyrizz.create_line() + captured = capsys.readouterr() + assert "Please enter a valid number." in captured.out + + def test_create_line_not_enough_words(self, capsys): + with patch('builtins.input', side_effect=["17", "test"]): + result = pyrizz.create_line() + captured = capsys.readouterr() + assert "Not enough words provided for the placeholders." in captured.out + # Tests for user input validation def test_is_line_valid_length(self): long_line = "x" * 141 - assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." - - @patch("builtins.input", side_effect=["1", "word1, word2"]) - def test_get_user_input_for_line(self, mock_input): - template_number, words = pyrizz.get_user_input_for_line() - assert template_number == 0 - assert words == ["word1", "word2"] - - def test_create_line_invalid_template_number(self): - _, message = pyrizz.create_line(999, ["word1", "word2"]) - assert message == "Template number out of range. Please choose between 0 and {}.".format(len(pyrizz.templates) - 1) - \ No newline at end of file + assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." \ No newline at end of file From e77fb86205d4b65af13912d18f4c7b9339771b33 Mon Sep 17 00:00:00 2001 From: Baani Pasrija Date: Thu, 9 Nov 2023 00:28:56 -0500 Subject: [PATCH 67/95] test now --- Pipfile | 4 -- Pipfile.lock | 163 +------------------------------------------ tests/test_pyrizz.py | 1 - 3 files changed, 2 insertions(+), 166 deletions(-) diff --git a/Pipfile b/Pipfile index 71a6269..cbedfc9 100644 --- a/Pipfile +++ b/Pipfile @@ -13,10 +13,6 @@ pytest = "==7.4.3" python-dotenv = "==0.16.0" openai = "==0.28.1" pyrizz = {version = "==0.0.666", index = "testpypi"} -build = "*" -twine = "*" -aliased = "*" -to = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index b3df3aa..421fde7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "9da618d6ffb6f837cb5fa53169f3258ca3e9c04b590f56c4803304a63681c91e" + "sha256": "9d584cf34b3a85e08bd790ccc841cf3eb0070006743efe6825942c0ad600751f" }, "pipfile-spec": 6, "requires": { - "python_version": "3.9" + "python_version": "3" }, "sources": [ { @@ -138,15 +138,6 @@ "markers": "python_version >= '3.7'", "version": "==23.1.0" }, - "build": { - "hashes": [ - "sha256:538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b", - "sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==1.0.3" - }, "certifi": { "hashes": [ "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", @@ -251,14 +242,6 @@ "markers": "python_full_version >= '3.7.0'", "version": "==3.3.2" }, - "docutils": { - "hashes": [ - "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6", - "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b" - ], - "markers": "python_version >= '3.7'", - "version": "==0.20.1" - }, "frozenlist": { "hashes": [ "sha256:007df07a6e3eb3e33e9a1fe6a9db7af152bbd8a185f9aaa6ece10a3529e3e1c6", @@ -334,14 +317,6 @@ "markers": "python_version >= '3.5'", "version": "==3.4" }, - "importlib-metadata": { - "hashes": [ - "sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb", - "sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743" - ], - "markers": "python_version >= '3.8'", - "version": "==6.8.0" - }, "iniconfig": { "hashes": [ "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", @@ -350,46 +325,6 @@ "markers": "python_version >= '3.7'", "version": "==2.0.0" }, - "jaraco.classes": { - "hashes": [ - "sha256:10afa92b6743f25c0cf5f37c6bb6e18e2c5bb84a16527ccfc0040ea377e7aaeb", - "sha256:c063dd08e89217cee02c8d5e5ec560f2c8ce6cdc2fcdc2e68f7b2e5547ed3621" - ], - "markers": "python_version >= '3.8'", - "version": "==3.3.0" - }, - "keyring": { - "hashes": [ - "sha256:4901caaf597bfd3bbd78c9a0c7c4c29fcd8310dab2cffefe749e916b6527acd6", - "sha256:ca0746a19ec421219f4d713f848fa297a661a8a8c1504867e55bfb5e09091509" - ], - "markers": "python_version >= '3.8'", - "version": "==24.2.0" - }, - "markdown-it-py": { - "hashes": [ - "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", - "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb" - ], - "markers": "python_version >= '3.8'", - "version": "==3.0.0" - }, - "mdurl": { - "hashes": [ - "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", - "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba" - ], - "markers": "python_version >= '3.7'", - "version": "==0.1.2" - }, - "more-itertools": { - "hashes": [ - "sha256:626c369fa0eb37bac0291bce8259b332fd59ac792fa5497b59837309cd5b114a", - "sha256:64e0735fcfdc6f3464ea133afe8ea4483b1c5fe3a3d69852e6503b43a0b222e6" - ], - "markers": "python_version >= '3.8'", - "version": "==10.1.0" - }, "multidict": { "hashes": [ "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9", @@ -470,27 +405,6 @@ "markers": "python_version >= '3.7'", "version": "==6.0.4" }, - "nh3": { - "hashes": [ - "sha256:116c9515937f94f0057ef50ebcbcc10600860065953ba56f14473ff706371873", - "sha256:18415df36db9b001f71a42a3a5395db79cf23d556996090d293764436e98e8ad", - "sha256:203cac86e313cf6486704d0ec620a992c8bc164c86d3a4fd3d761dd552d839b5", - "sha256:2b0be5c792bd43d0abef8ca39dd8acb3c0611052ce466d0401d51ea0d9aa7525", - "sha256:377aaf6a9e7c63962f367158d808c6a1344e2b4f83d071c43fbd631b75c4f0b2", - "sha256:525846c56c2bcd376f5eaee76063ebf33cf1e620c1498b2a40107f60cfc6054e", - "sha256:5529a3bf99402c34056576d80ae5547123f1078da76aa99e8ed79e44fa67282d", - "sha256:7771d43222b639a4cd9e341f870cee336b9d886de1ad9bec8dddab22fe1de450", - "sha256:88c753efbcdfc2644a5012938c6b9753f1c64a5723a67f0301ca43e7b85dcf0e", - "sha256:93a943cfd3e33bd03f77b97baa11990148687877b74193bf777956b67054dcc6", - "sha256:9be2f68fb9a40d8440cbf34cbf40758aa7f6093160bfc7fb018cce8e424f0c3a", - "sha256:a0c509894fd4dccdff557068e5074999ae3b75f4c5a2d6fb5415e782e25679c4", - "sha256:ac8056e937f264995a82bf0053ca898a1cb1c9efc7cd68fa07fe0060734df7e4", - "sha256:aed56a86daa43966dd790ba86d4b810b219f75b4bb737461b6886ce2bde38fd6", - "sha256:e8986f1dd3221d1e741fda0a12eaa4a273f1d80a35e31a1ffe579e7c621d069e", - "sha256:f99212a81c62b5f22f9e7c3e347aa00491114a5647e1f13bbebd79c3e5f08d75" - ], - "version": "==0.2.14" - }, "openai": { "hashes": [ "sha256:4be1dad329a65b4ce1a660fe6d5431b438f429b5855c883435f0f7fcb6d2dcc8", @@ -508,14 +422,6 @@ "markers": "python_version >= '3.7'", "version": "==23.2" }, - "pkginfo": { - "hashes": [ - "sha256:4b7a555a6d5a22169fcc9cf7bfd78d296b0361adad412a346c1226849af5e546", - "sha256:8fd5896e8718a4372f0ea9cc9d96f6417c9b986e23a4d116dda26b62cc29d046" - ], - "markers": "python_version >= '3.6'", - "version": "==1.9.6" - }, "pluggy": { "hashes": [ "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12", @@ -524,22 +430,6 @@ "markers": "python_version >= '3.8'", "version": "==1.3.0" }, - "pygments": { - "hashes": [ - "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692", - "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29" - ], - "markers": "python_version >= '3.7'", - "version": "==2.16.1" - }, - "pyproject-hooks": { - "hashes": [ - "sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8", - "sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5" - ], - "markers": "python_version >= '3.7'", - "version": "==1.0.0" - }, "pyrizz": { "hashes": [ "sha256:0eea82bdb1f115c58f448fb52cf6a812cc05bf8505eed988658c0513f9d8af9a", @@ -566,14 +456,6 @@ "index": "pypi", "version": "==0.16.0" }, - "readme-renderer": { - "hashes": [ - "sha256:13d039515c1f24de668e2c93f2e877b9dbe6c6c32328b90a40a49d8b2b85f36d", - "sha256:2d55489f83be4992fe4454939d1a051c33edbab778e82761d060c9fc6b308cd1" - ], - "markers": "python_version >= '3.8'", - "version": "==42.0" - }, "requests": { "hashes": [ "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", @@ -582,30 +464,6 @@ "markers": "python_version >= '3.7'", "version": "==2.31.0" }, - "requests-toolbelt": { - "hashes": [ - "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6", - "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.0.0" - }, - "rfc3986": { - "hashes": [ - "sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd", - "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c" - ], - "markers": "python_version >= '3.7'", - "version": "==2.0.0" - }, - "rich": { - "hashes": [ - "sha256:2b38e2fe9ca72c9a00170a1a2d20c63c790d0e10ef1fe35eba76e1e7b1d7d245", - "sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef" - ], - "markers": "python_full_version >= '3.7.0'", - "version": "==13.6.0" - }, "tqdm": { "hashes": [ "sha256:d302b3c5b53d47bce91fea46679d9c3c6508cf6332229aa1e7d8653723793386", @@ -614,15 +472,6 @@ "markers": "python_version >= '3.7'", "version": "==4.66.1" }, - "twine": { - "hashes": [ - "sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8", - "sha256:9e102ef5fdd5a20661eb88fad46338806c3bd32cf1db729603fe3697b1bc83c8" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==4.0.2" - }, "urllib3": { "hashes": [ "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84", @@ -710,14 +559,6 @@ ], "markers": "python_version >= '3.7'", "version": "==1.9.2" - }, - "zipp": { - "hashes": [ - "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31", - "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0" - ], - "markers": "python_version >= '3.8'", - "version": "==3.17.0" } }, "develop": {} diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 079bced..aa56e46 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -82,7 +82,6 @@ def test_get_ai_line_long(self): expected = "Please specify a category that is less than 50 characters." assert actual.strip() == expected.strip() - # Tests if the input for ai line actually results in a string def test_get_ai_line_str(self): actual = pyrizz.get_ai_line("test") From ecc283bbae7cda85759b86c5f18f9575fc5ec8b7 Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 00:58:32 -0500 Subject: [PATCH 68/95] Added ascii art --- README.md | 4 +- src/pyrizz/__main__.py | 13 +- src/pyrizz/data/ascii_art.txt | 415 ++++++++++++++++++++++++++++++++++ src/pyrizz/pyrizz.py | 91 +++++--- src/pyrizz/templates.py | 22 +- tests/test_pyrizz.py | 31 +-- 6 files changed, 516 insertions(+), 60 deletions(-) create mode 100644 src/pyrizz/data/ascii_art.txt diff --git a/README.md b/README.md index 6652e9a..96396f1 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,9 @@ In this function, if you're new to pickup lines, you can create your very own pi ``` from pyrizz import pyrizz -print(pyrizz.create_line()) +print(pyrizz.create_line(template_number, words)) ``` - +Then this function returns your line with some random ASCII art. 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) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 9c0f2a1..3020adf 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -24,7 +24,8 @@ def main(): print("2. Get a category-specific random pick-up line (romantic, clever, geeky, dev)") print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters)") print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") - print("5. Create your very own pickup line!.\n") + print("5. Create your line with one of our templates with randomly selected ASCII art.") + print("6. List available templates for pick-up lines.\n") print("!! Type Q to quit !!\n") print("Enter your choice: ") @@ -63,7 +64,15 @@ def main(): print("\n" + pyrizz.rate_line(pickup_line), end = "\n\n") elif user_input == "5": - pyrizz.create_line() + template_number, words = pyrizz.get_user_input_for_line() + line = pyrizz.create_line(template_number, words) + if line: + print("\nHere's your custom pick-up line:") + print(line) + + elif user_input == "6": + print("Here are the available templates:") + pyrizz.list_templates() elif user_input == "q" or user_input == "Q": break diff --git a/src/pyrizz/data/ascii_art.txt b/src/pyrizz/data/ascii_art.txt new file mode 100644 index 0000000..feffdc8 --- /dev/null +++ b/src/pyrizz/data/ascii_art.txt @@ -0,0 +1,415 @@ +# ascii_art.txt +[Start] +,d88b.d88b, ,d88b.d88b, ,d88b.d88b, ,d88b.d88b, ,d88b.d88b, +88888888888 88888888888 88888888888 88888888888 88888888888 +`Y8888888Y' `Y8888888Y' `Y8888888Y' `Y8888888Y' `Y8888888Y' + `Y888Y' `Y888Y' `Y888Y' `Y888Y' `Y888Y' + `Y' `Y' `Y' `Y' `Y' +[End] +[Start] + _ _ + /` \/ `\_ _ + \ /` \/ `\ + '. .\ / + \/ '. .' + \/ +[End] +[Start] + @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +\\\\ @ @ @ @ @ @ @ @ @ @ @ @ + ------@ ---( @-----@ )---( @-----@ )---( @-----@ )--- @--------> +//// @ @ @ @ @ @ @ @ + @ @ @ @ @ @ @ @ + @ @ @ @ @ @ @ @ + @ @ @ @ @ @ @ @ + @ @ @ @ +[End] +[Start] + ****** ****** + ********** ********** + ************* ************* +***************************** +***************************** +***************************** + *************************** + *********************** + ******************* + *************** + *********** + ******* + *** + * +[End] +[Start] +oo + oo @@@@@@@@: @@@@@@@@! + o@@@@!!!!;;;;@ @@.......:;!@ + 'O@@!!!;;;;;;;;@ @.......: ;!@ + @@@!!!!;;::::::.@@........: ;!@ + @@!!!!;;:::::..............: ;!@ + @@@!!!;::::::..............: ;!@ + @@!!;;::::::.............: ;!@ + @@!;;::::::......oo.....::::!@ + @!!;::::::........oo..:::@ + !!!;:::::..........oo@ + !!;:::::.......@ oo * + ;;::::.....@ oo *** + :::..@ ooo*## + ::. _##ooo### + : **########## +[End] +[Start] + _____ _____ + ,ad8PPPP88b, ,d88PPPP8ba, + d8P" "Y8b, ,d8P" "Y8b +dP' "8a8" `Yd +8( " )8 +I8 8I + Yb, ,dP + "8a, ,a8" + "8a, ,a8" + "Yba adP" + `Y8a a8P' + `88, ,88' + "8b d8" + "8b d8" + `888' + " +[End] +[Start] + .;;;, .;;;, .;;;, .;;;, + .;;;,;;;;;,;;;;;,.;;;, .;;;.,;;;;;,;;;;;,;;;. + ;;;;xXXxXXxXXxXXxXXx;;;. .,. .;;;xXXxXXxXXxXXxXX;;;;; + .,,.`xXX' `xXXx,;;;;;,xXXx' `XXx;;,,. + ;;;;xXX' `xXXx;xXXx' `XXx;;;; + `;;XX' `XXX' `XX;;' +,;;,XX `X' XX,;;, +;;;;XX, ,XX;;;; + ``.;XX, ,XX;,'' + ;;;;XX, ,XX;;;; + ```.;XX, ,XX;,''' + ;;;;XX, ,XX;;;; + ```,;XX, ,XX;,''' + ;;;;XX, ,XX;;;; + ````,;XX, ,XX;, ''' + ;;;;;XX, ,XX;;;; + `````,;XX, ,XX;,'''' + ;;;;;XX, ,XX;;;;; + `````;;XX;;''''' + `;;;;' +[End] +[Start] + | \ \ | |/ / + | |\ `' ' / + | ;'aorta \ / , pulmonary + | ; _, | / / , arteries + superior | | ( `-.;_,-' '-' , +vena cava | `, `-._ _,-'_ + |,-`. `.) ,<_,-'_, pulmonary + ,' `. / ,' `;-' _, veins + ; `./ /`, \-' + | right / | ;\ |\ + | atrium ;_,._|_, `, ' \ + | \ \ ` `, + ` __ ` \ left ;, + \ ,' ` \, ventricle + \_| ;, ;; + | \ `;, ;; + inferior | |`. `;;, ;' +vena cava | | `-. ;;;;,;' + | | |`-.._ ,;;;;;' + | | | | ``';;;' FL + aorta +[End] +[Start] +:::::::8888!!!888888::::::::88888 8888888:::::::::::::::::::::::::::::::::::::: +::::::888!!!!!!!!!!8888:::888!!!! !! !!!8888::::88888888:::::::::8888888888::::: +:::::8!!:!: !!!!!88888!!!! ! !!!!88888!! !!!!88::::::8888! :888888: +::::88!! : ::!!!88!!!!! ! :!!888!!!! !!!!!88:88! ! !!!888 +:::88:! :::!!!:!!: ! !!!!88!!!! !!!!!!888! !! !!!!!!!!8 +:::8::! !! !:!:!!::: : !!!!88:! ::!!:!8! !! !!!! !!!! +::8!:! : !! !!!:::!!!!! !:!!!8: !!!:!!!:!!:: ! !!!!! +::8::!: ! ! !!!!:!:::!:: !:!::!!88! !:!!!::!:!::: !!!!!!!! +$$$$$$$$: !!! !!!::!!!::!! !!:!!:8!! ! !!::!::::::! ! !!:!!!!!! +:$$$$$$$$$ ::::!!!!:!!!!::: !!!!!:!!!8!!: : !!!!!!!!!!!: !!!!$$$::!!! +::$$$$$$$$$$::!!!:!!!!!!:::!!!!::!!!!!!88!:: !!! !!!!!!!!:::! !: :::!$$$$$:!! +:::$$$$$$$$$$$:!!:::::::!!!!!!!!!!!!!:!!88:::::::::::::!!!!!!!!: :!!!!!!!:$$$$$! +$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$8$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ +:::$$$$$$$$$$$:!!!!!!!!!!!!!!::!!!:!:!!!!:8! : ! !!::!:!:::!!!!!::!!!!!!!$$$$$$! +::$$$$$$$$$!: :!! ! !:::!!!!!:!!:!!!!!!!8 : ::! !:!!!!!!!::!:::$$$$!!! +$$$$$$$$$8:!! : :::: ::!:!!!::::::!!!!:!88! !!!! !::!!!!!!!!!$$$$!!!8 +$$$$$$$$$888!! ! !!!! !:::::::!!:!!!!!!!88!8!! !!!::!!!!!!!::!:$$$!!!88: +$$$$$$$::::888 ::: !!!:!!::!!!!!!!!!88:::8!!! ! !!!::!!!!!!!:::!!!888: +::::::::::::88 ! :!!!!!!!!!:!:!!!8!:::::888! !!:!::::!!!!!!888::: +::::::::::::::8 !!:::!!:!:!!!!!8:::::::::88!! !!!!!!!!!!!!!8888:::: +:::::::::::::::888! !! !!!!!!!!!!!!!!88::::::::::::88!!! !:!!!!!!::!8888::::: +:::::::::::::::::88!!! !!::!!!!!!!!88:::::::::::::::888!! !!!!!:!!!88::::::: +:::::::::::::::::::888!!!!!!!!!!!888::::::::::::::::::::888! !!!!!8888:::::::: +::::::::::::::::::::8888!!!!!!8!88:::::::::::::::::::::::!888!!!8!!88::::::::::: +[End] +[Start] + .. + $. ,o$$$o. + $. $$$$$$$o. .. + .$. $' $$$$$$ ,o'' + .$' $ '$$$$$,o'.,' .oo' + .$' $. $$$$' ,, .o'. + .$' '$o. 'O$ ..ooo''',oo' + .$' .o$' '$$'' ,,o' + .%$,,,,,ooO' ' ,,o'' +.$o. ,o' $o ..oo' + ''O'''''''''',' $'$. .o' + '$ $ '$,'o' ' + '$ $ .o $ + '$ $ .$$ + '$ $, .o$$ + '$ $. ,o' $ + $. '$. $,oooo''o, + $. $. 'o' '$ + $. $. .,ooo, $ + .'' 'oo...o' $ 'o $ + $ $ '' + $ $ + $ % + ,$ $ + $ $' +[End] +[Start] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + < :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: > + < :::::::::::: :::::::::::: :::::::::::: > + < ::::::::: :::: ::::::::: > + < ::::::: ******** :: ******** ::::::: > + < ::::: **** **** **** **** ::::: > + < :::: **** **** **** :::: > + < ::: **** ** **** ::: > + < ::: **** **** ::: > + < :::: **** ***** :::: > + < ::::: **** **** ::::: > + < ::::::: **** **** ::::::: > + < ::::::::: **** **** ::::::::: > + < ::::::::::: **** **** ::::::::::: > + < :::::::::::::: **** **** :::::::::::::: > + < ::::::::::::::::: **** **** ::::::::::::::::: > + < :::::::::::::::::::: **** :::::::::::::::::::: > + < ::::::::::::::::::::::: ** ::::::::::::::::::::::: > + < ::::::::::::::::::::::::: ::::::::::::::::::::::::: > + < ::::::::::::::::::::::::::: ::::::::::::::::::::::::::: > + < ::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::: > + < :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: > + ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()() +[End] +[Start] + ...::::::::::... + .:^^~~!!!~~~~~~~~~~!!!~~~^:. + .:~!!!~~~^^^::::::::::::^^^~~~!!!~:. + .^!!!~~^^::..... .....::^^~~!!!^. + :!!!~~^::............................::^~~!!!:. + .^!!!~^^:..................................:^^~!7!^. + ^!7!~^::......................................:^^~!77^ + .!7!~~^:.......^7:......................:7^.......:^~~!7!. + :77!~^::::.....!GB~......................~BG!.....::::^~!77: + ^?7!~^::::...:!5BG7........................7GB5!:...::::^~!7?^ + :?7!~^^:::^~7YPGPJ^..........................^JPGPY7~^:::^^~!7?: + .77!!~^:^JY555J7~:::^^::....:::::::::::...::^^:.:~7J555YJ^:^~!!7?. + !?!!~^^^^^^^:::~7??777JYJ7^:.::::::::.:~7??777JYJ7^::::^^^^^^~!!?! + .?7!!~^^^^^^::!557:. .Y#BG5!::::::::!557:. .J##G57::^^^^^^~!!7?. + ~?7!!~^^^^^^^Y#Y. 5@@@&#Y::::::Y#5: Y@@@&#Y^^^^^^^~!!7?~ + !?7!!~~~^^^^7@&^ ^5@@@@@@@J::::!@&! :Y@@@@@@@J^^^~~~~!!7?! + 7?7!!~~~~~~^7@@P!^^~?P&@&&@@@@@Y::::7@@G7^^~75&@&&@@@@@Y^~~~~~~!!7?7 + !?77!!!~~~~~~P@@@@&@@@#7:?&@@@#~:^^:^P@@@@&@@@#7:?&@@@#!^~~~~!!!77?7 + ~J77!!!!!~~~~~5&@@@@@@#Y5#@@@P~:^^^^^^Y&@@@@@@#Y5#@@@G!~~~~!!!!777J~ + :J?777!!!!!~~~~!YG&@@@@@@&B57^^^^^^^^^^!YG&@@@@@@&B57~~~~!!!!!777?J. + !J?777!!!!!~~~~^^~!7??7!~^^^^^^^^^^^^^^^^~!7??77~~^~~~~!!!!!777?J! + .J?7777!!!!!~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^~~~~~!!!!!7777?JJ. + ^J??7777!!!!!~~~~~~~~~^^^^^^^^^^^^^^^^^^^^~~~~~~~~~!!!!!7777?JJ^ + ^JJ?77777!!!!!~~~~~~~~~~~~~^^^^^^^~^~~~~~~~~~~~!!!!!!77777?JJ^ + :JJ??77777!!!!!!!~~~~~~~~~^^^~~^^^~~~~~~~~~!!!!!!!77777??JJ: + .7JJ???777!~~~!!!!!~~~~~!J5GGGG5J!~~~~~!!!!~~~!!777???JY7. + ~?77!~~^^^~!7!!!!!!!!7#&#GPPG#!!!!!!!!!~^^^^~!!7?J~ + :^^^^^^^^~~!77777!!!!!!!??!!!~~!??!!!!!!!!7777!~^^^^^^^^^. + .~~^^^^^^^^^^^^^^^^^^^^^^^^^^~!!~^^^^^^^^^^^^^~~^^^^^^^^^^^~^ + :^^:::~~^^^^^::::::^^^^~~~~~~~~!!!!7777!!!!~~~~~~~~^^^^::::::^^^^^~^.:::^. + :~^^^^^^^^^^::::::::^^^7JJJJ?????????7??????????JJJJ7^^^::::::::^^^^^^^^^~~. + .~^^^^^^::::::::::::::^~~.:~!7?JJJJJJJJJJJJJJJJ?7!~::!~:::::::::::::::^^^^^~^ + .!^^^^^^^^^^^:::::::::^!~ ..::^^^^^^^^::.. !~^::::::::::^^^^^^^^^~~ + !~~~^^^^^^^^^^^^^^^^^~!~ ~!^^^^^^^^^^^^^^^^^^^^!^ + :!~~~~~!!!!~~~~~~~~~~!~ !~~~~~~~~~~~~!!~~~~~!!. + ^!7!777!!777!!!!!!!!!. :!!!!!!!!!777!7777!7!. + .::.. .::^^^^:::. .::^^^^^::. ..:^: +[End] +[Start] + + ..:::^^^^:::... + .:^~!!!!!!!!!!!!!!!!!!~^:. + .^!!7!!~~~^^^^^^^^^^^^^~~~!!!!^. + .~77!~~^^^^^^^^^^^^^^^^:^^^^^^~~!7!^. + .~77!~~~!7?Y5P7^^^^JPP5YJ?77~^^^^^^~!77^ + .77!!~~7GGBGPY7~^^^^~!?J5PGGG7^^^^^^^^~!77: + .77!!!!~~??7~^^^:^^^^^^^^^^~!~^^^^^^^^^^~~!?^ + !?!!!!!77!~~~^^^^^^^~^^^^^^^~~~~~~~^^^^^^~~!?: + .?7!!!7?J7!~^^^^^~~^~!!~^^^^^^^~~!!!~~~^^^~~~7?. + :J7!!!?YJ7!~~^^^^^~~~7!~^^^^^~~~~!777~~~~~~~~!J~ + :J7!!!?5Y??J7~::::^~7?7JJ7~^::^^~!7JJ!~~~~~~~!?7 + .?7!!!7?JJB@@BJ~^^^~??P@@@#J!~^~~!?J7!~~~~~~~!?? + !J!!!!7??YB&&G?7777!7JG#&#Y?77?JJ?!!~~~~~~~~!J7 + .?7!~!!7???JJJJJ?7!!!!77???JJJJ?!!!~~~~~~~~!7Y~ + .^J7!~!!!7??7777!!!~~~~!!!!!!!!!!!~~~~~~~~!7JJ. . + ^^:!J!!~~!!!77!!!~~~~^^^^^^^~~~~~~~~~~~~~~!7J5~:^^: + ^^ .7J?777!!!!!!~~~~^^^^^^^^^^^^^^^^^^~~~~!7JY~J!..~^ + ~^ :?^~7JJ???????7777777777!!!!!!!~~!!777JY?.^?: ^^ + ^~ . ^7 :!YP5YJ?77!!~~~~~~~!!!7??JJJJYY5Y7: .J: . .!: + :^ .!^: ^7 :!JY5PP555555555555555YYYYJ7^. .J. :~~..^. + ^..7: : ^? .:~!?JYY555555YYJJ?7!^: .J... ~! :: + : ^7 ..^^ ...::::... !:. .?..: + ..~^ !^.. + . +[End] +[Start] + __ __ + / \./ \/\_ + __{^\_ _}_ | |/^\ + / /\_/^\._|_/ // / +( (__{(@)}\__|.//_/__A____A_______A________A________A_____A___A___A_____ + \__/{/(_)\_} )\\ \\---v-----V-----V---Y-----v----Y------v-----V-----v-- + ( (__)_)_/ )\ \> + \__/ \__/\/\/ + \__,--' +[End] +[Start] + .. .. + ' L '.` ' +>>--`. U .'-->> + `. V .' + `. .` +[End] +[Start] + .-~~-.--. + : | + .~ ~ -.\ /.- ~~ . + > `. .' < +( .- -. ) + `- -.-~ `- -' ~-.- -' + ( : ) _ _ .-: + ~--. : .--~ .-~ .-~ | + ~-.-^-.-~ \_ .~ .-~ .~ + \ \' \ '_ _ -~ + `.`. // + . - ~ ~-.__`.`-.// + .-~ . - ~ |~ ~ ~-.~-. + .' .-~ .-~ :/~-.~-./: + /_~_ _ . - ~ ~-.~-._ + ~-.< +[End] +[Start] + .-==-. + /{.=-.}\ + | / . \ | + |; : :| + \( : )/ + `._'__.' + |\ || + \ \ || + | | || + | | || /| + \ \|| / / + \ ||| | | + | || | | + \||/ / + ||| / + || | + ||/ + || +^^^^^jgs^^^^^^^^^^^^^^ +[End] +[Start] + .-~~~- + .-~~~_._~~~\ + /~-~~ ~. `._ + / \ \ | ~~-_ + __ | | | | /~\| + _-~~ ~~-..| ______||/__..-~~/ + ~-.___ \ /~\_________.-~~ + \~~--._\ | / + ^-_ ~\ \ /^ + ^~---|~~~~-.___.-~^ + /~^| | | |^~\ + //~^`/ /_/ ^~\\ + / //~|| \ + ~ || + ___ - || __ ___ _ + |\| \ ||_.-~~ /|\- \~-._ + | -\| | ||/ / | |\- | |\ \ + \__-\|______ || | \___\| \_\| + _____ _.-~/|\ \\|| \ | / ~-. + /' --/| / /| \ \|| \ / |\~- + ' ---/| | | |\ | || \__| +| --/| | ; \ /| / -(|| +`./ | / \|/ ||)- + `~^~^ || +[End] +[Start] + ..ooo. + .888888888. + 88"P""T"T888 8o + o8o 8.8"8 88o."8o 8o + 88 . o88o8 8 88."8 88P"o + 88 o8 88 oo.8 888 8 888 88 + 88 88 88o888" 88" o888 88 + 88."8o."T88P.88". 88888 88 + 888."888."88P".o8 8888 888 + "888o"8888oo8888 o888 o8P" + "8888.""888P"P.888".88P + "88888ooo 888P".o888 + ""8P"".oooooo8888P + .oo888ooo. 8888NICK8P8 +o88888"888"88o. "8888"".88 .oo888oo.. + 8888" "88 88888. 88".o88888888"888. + "8888o.""o 88"88o. o8".888"888"88 "88P + T888C.oo. "8."8"8 o8"o888 o88" ".=888" + 88888888o "8 8 8 .8 .8"88 8"".o888o8P + "8888C.o8o 8 8 8" 8 o" ...o"""8888 + "88888888 " 8 .8 8 88888888888" + "8888888o .8o=" o8o..o|8oo88" + "888" 88" 888888888"" + o8P "888""" + ...oo88 + "8oo...oo888"" +[End] +[Start] +_░▒███████ +░██▓▒░░▒▓██ +██▓▒░__░▒▓██___██████ +██▓▒░____░▓███▓__░▒▓██ +██▓▒░___░▓██▓_____░▒▓██ +██▓▒░_______________░▒▓██ +_██▓▒░______________░▒▓██ +__██▓▒░____________░▒▓██ +___██▓▒░__________░▒▓██ +____██▓▒░________░▒▓██ +_____██▓▒░_____░▒▓██ +______██▓▒░__░▒▓██ +_______█▓▒░░▒▓██ +_________░▒▓██ +_______░▒▓██ +_____░▒▓██ +[End] +[Start] +░░░░░░░▄▀▀▀▀█░░░░░░░░░░░░░░░░░░░░ +░░░░░░█▀░░░░█░░░░░░░░░░░░░░░░░░░░ +░░░░░█░░░░░░█▀▀▀▄▄░░░░░░▓░░░░░░░░ +░░░░▄█░░░░░░░░░░░░▀▀▄▄░▓▓▓░░░░░░░ +░░░▄█░░░░░░░░░░░░░░░░░▀▓▓▓▓▀▀▀█░░ +▀▄▄█░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓░░█░░ +▀▄█░▀▄░░░░▄▄░░░░░░▓▓▓▓▓▓▓░░▓▓▓▓▓▓ +▄▀█▀▄░░░░███░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓░ +░▀█▀▄░░░░▀▀░░░░░░░░░▄▄░░░▓▓▓▓▓░░░ +░░▀█░░░░░░░░▄▄░░░░░███░░░░▓▓░█░░░ +░░░▀█░░░░░░█░░▀▄░░░▀▀░░░░░▓░█▀░░░ +░░░░▀█░░░░░░▀▄▄▀░░░░░░░░▀▄░█▀░░░░ +░░░░░░▀█▄░░░░░░░░░░░░░▀▄░░██░░░░░ +░░░░░░░░░▀█▄░░░░░░░░▀▄░░██▀░▀░░░░ +░░░░░░░░░░░░▀▀▄▄▄▄▄▄▄█▀█░░▀▄░░░░░ +░░░░░░░░░░░░░░░░░░░░░░░░▀░░░░░░░░ +[End] \ No newline at end of file diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 1a32b82..e1096be 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -8,7 +8,7 @@ from pyrizz.templates import templates load_dotenv() -PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." +PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/" openai.api_key = os.getenv('OPENAI_API_KEY') def get_lines(category='all'): @@ -67,51 +67,72 @@ def rate_line(pickup_line) -> str: except Exception as err: return str(err) -def create_line(): - print("Choose a template number (1-20):") +def load_ascii_art(filename): + with open(filename, 'r', encoding='utf-8') as file: + content = file.read() + ascii_art_pieces = content.split('[End]') + ascii_art_pieces = [piece.strip()[len('[Start]'):].strip() for piece in ascii_art_pieces if piece.strip()] + return ascii_art_pieces + +def create_line(template_number, words): + if not (0 <= template_number < len(templates)): + return None, "Template number out of range. Please choose between 0 and {}.".format(len(templates) - 1) + + template_to_use = templates[template_number] + placeholders_count = template_to_use.count("{}") + if placeholders_count != len(words): + return None, "Incorrect number of words provided for the placeholders. Expected {}, got {}.".format(placeholders_count, len(words)) + try: - template_number = int(input("> ")) - 1 - if not (0 <= template_number < len(templates)): - print("Template number out of range. Please choose between 1 and 20.") - return - - except ValueError: - print("Please enter a valid number.") - return + user_line = template_to_use.format(*words) + except IndexError as e: + return None, f"Error in formatting: {str(e)}" + + if is_line_valid(user_line): + ascii_art_pieces = load_ascii_art(PROJECT_ROOT + 'data/ascii_art.txt') + art = random.choice(ascii_art_pieces) + user_line_with_art = f"{art}\n\n{user_line}" + return user_line_with_art + else: + return None, "Your line doesn't pass our checks. Sorry!" + +def get_user_input_for_line(): + print("Choose a template number (0-{}):".format(len(templates))) + template_number = int(input("> ")) - 1 + + if template_number not in range(len(templates)): + print("Invalid template number. Please choose a number between 0 and {}.".format(len(templates) - 1)) + return None, None template_to_show = templates[template_number] - placeholders_count = template_to_show.count("{}") - placeholder_representation = ['______'] * placeholders_count + placeholders_count = template_to_show.count("{}") + print("Fill in the blanks for the following template:") - print(template_to_show.format(*placeholder_representation)) + print(template_to_show.format(*(['______'] * placeholders_count))) - print(f"Enter {placeholders_count} word(s) separated by a comma to fill into the template:") + print(f"Enter {placeholders_count} word(s) separated by commas to fill into the template:") words = input("> ").split(',') words = [word.strip() for word in words] - try: - user_line = templates[template_number].format(*words) - - except IndexError: - print("Not enough words provided for the placeholders.") - return - - except Exception as e: - print(f"An unexpected formatting error occurred: {e}") - return - - if is_line_valid(user_line): - try: - print("\nLooks great! Try it on a human now and meet your match!") - return(user_line) - - except Exception as e: - print(f"An error occurred while inserting the line into the database: {e}") - else: - return("Your pick-up line doesn't pass our checks.") + return template_number, words def is_line_valid(user_line): if len(user_line) > 140: + print("Your pick-up line is too long.") return False + + #if is_offensive(user_line): + #return False return True + +#def is_offensive(text): +# if profanity.contains_profanity(text): +# return True +# else: +# return False + +def list_templates(): + for idx, template in enumerate(templates, 1): + print(f"Template {idx}: {template}") + return templates diff --git a/src/pyrizz/templates.py b/src/pyrizz/templates.py index 835dc87..187e418 100644 --- a/src/pyrizz/templates.py +++ b/src/pyrizz/templates.py @@ -18,5 +18,25 @@ "If I could rearrange the alphabet, I'd put {} and {} together.", "Are you a {}? Because you're so fine you blow my mind.", "Do you have a pencil? Cause I want to erase your past and write our {}.", - "Do you know what my shirt is made of? It's made of boyfriend {}." + "Do you know what my shirt is made of? It's made of boyfriend {}.", + "Are you a {}? Because you just brightened my day with a single smile.", + "I'm not a genie, but I can make your {} come true.", + "If you were a {}, you'd be a sweet one.", + "Was that an earthquake, or did you just rock my {}?", + "Do you have a name, or can I call you {}?", + "If we were at home, cuddling on a rainy Sunday morning, what would we have for {}? Pancakes, bacon, or {}?", + "Excuse me, but I think you dropped something: MY {}.", + "If you were a fruit, you'd be a {}apple.", + "Are you a {}? Because every time I look at you, I feel like I'm on cloud nine.", + "Do you play soccer? Because you're a {} in the field.", + "If you were words on a page, you'd be the {} print.", + "Did we just share an {}? Because I feel like I've known you forever.", + "I'm writing a term paper on the finer things in life. Can I interview you over {}?", + "I'd never play hide and seek with you because someone like you is impossible to {}.", + "Can I take a picture of you, so I can show Santa what I want for {}?", + "Do you have a sunburn, or are you always this {}?", + "If you were a {} in the sea, I'd swim all the oceans to find you.", + "You must be the square root of -1 because you can't be {}.", + "Is it okay if I follow you home? Because my parents always told me to follow my {}.", + "If you were a {}, you'd be an extraordinary one." ] \ No newline at end of file diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 079bced..02dfb02 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -98,27 +98,18 @@ def test_rate_line_empty(self): def test_rate_line_format(self): actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") assert re.match(r'\d+/10 - .+', actual) is not None - - - def test_create_line_invalid_template_number(self, capsys): - with patch('builtins.input', side_effect=["21"]): - pyrizz.create_line() - captured = capsys.readouterr() - assert "Template number out of range. Please choose between 1 and 20." in captured.out - - def test_create_line_invalid_value_input(self, capsys): - with patch('builtins.input', side_effect=["abc"]): - pyrizz.create_line() - captured = capsys.readouterr() - assert "Please enter a valid number." in captured.out - - def test_create_line_not_enough_words(self, capsys): - with patch('builtins.input', side_effect=["17", "test"]): - result = pyrizz.create_line() - captured = capsys.readouterr() - assert "Not enough words provided for the placeholders." in captured.out # Tests for user input validation def test_is_line_valid_length(self): long_line = "x" * 141 - assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." \ No newline at end of file + assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." + + @patch("builtins.input", side_effect=["1", "word1, word2"]) + def test_get_user_input_for_line(self, mock_input): + template_number, words = pyrizz.get_user_input_for_line() + assert template_number == 0 + assert words == ["word1", "word2"] + + def test_create_line_invalid_template_number(self): + _, message = pyrizz.create_line(999, ["word1", "word2"]) + assert message == "Template number out of range. Please choose between 0 and {}.".format(len(pyrizz.templates) - 1) \ No newline at end of file From 7f5ac6b4e8866162c19ca0a589faf32a9e395173 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Thu, 9 Nov 2023 02:02:40 -0500 Subject: [PATCH 69/95] Update README.md --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96396f1..3ba5a07 100644 --- a/README.md +++ b/README.md @@ -60,15 +60,23 @@ from pyrizz import pyrizz print(pyrizz.rate_line('Are you from Tennesse? Cause you're the only 10 I see.')) ``` -### create_line() +### 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: `print(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! +- **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 -print(pyrizz.create_line(template_number, words)) +words_to_use = ["sun"] +output = pyrizz.create_line(1, words_to_use) +print(output) ``` -Then this function returns your line with some random ASCII art. + +### 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) From 4205c31e45565bc3aeee63306000a4fb31eb9a44 Mon Sep 17 00:00:00 2001 From: Baani Pasrija Date: Thu, 9 Nov 2023 03:14:33 -0500 Subject: [PATCH 70/95] testing, 19/20 seem to pass --- Pipfile | 1 - Pipfile.lock | 11 +------- src/pyrizz/__main__.py | 2 +- src/pyrizz/pyrizz.py | 2 +- tests/test_pyrizz.py | 57 ++++++++++++++++++++++++++++++++++++------ 5 files changed, 52 insertions(+), 21 deletions(-) diff --git a/Pipfile b/Pipfile index cbedfc9..e4580c4 100644 --- a/Pipfile +++ b/Pipfile @@ -12,7 +12,6 @@ name = "testpypi" pytest = "==7.4.3" python-dotenv = "==0.16.0" openai = "==0.28.1" -pyrizz = {version = "==0.0.666", index = "testpypi"} [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 421fde7..4df476d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "9d584cf34b3a85e08bd790ccc841cf3eb0070006743efe6825942c0ad600751f" + "sha256": "cbdb3a064157622f509856f95f7393a42182c58a9de5477f544df95cc579e719" }, "pipfile-spec": 6, "requires": { @@ -430,15 +430,6 @@ "markers": "python_version >= '3.8'", "version": "==1.3.0" }, - "pyrizz": { - "hashes": [ - "sha256:0eea82bdb1f115c58f448fb52cf6a812cc05bf8505eed988658c0513f9d8af9a", - "sha256:eed764cd70ae2016430dc32fc869aeada3bd45bbe6b6a262973f7cc74b48953c" - ], - "index": "testpypi", - "markers": "python_version >= '3.7'", - "version": "==0.0.666" - }, "pytest": { "hashes": [ "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac", diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index e2b2c47..ed68a3f 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -28,7 +28,7 @@ def main(): print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") print("5. Create your very own pickup line!.\n") - print("6. Enter your API key to use AI functionality.\n") + print("6. Enter your API key to use AI function.\n") print("!! Type Q to quit !!\n") diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 3eea975..83c6227 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -5,6 +5,7 @@ from pyrizz.pickuplines import pickuplines from pyrizz.templates import templates + PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/../.." def get_lines(category='all'): @@ -52,7 +53,6 @@ def rate_line(pickup_line, client) -> str: messages = [{"role": "user", "content": f"Rate this pickup line out of 10 (whole numbers only): {pickup_line} In your response, STRICTLY follow the format of (nothing else): rating/10 - snazzy comment."},] ) - message = response.choices[0]['message'] ai_rating_response = "{}".format(message['content']) return ai_rating_response diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index aa56e46..e8d48bc 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -2,9 +2,11 @@ import pathlib import sys import re +import unittest from unittest.mock import Mock, patch from unittest.mock import patch, MagicMock, mock_open import openai +from openai import openai_object sys.path.append(f"{pathlib.Path(__file__).parent.resolve()}/../src") from pyrizz import pyrizz @@ -69,35 +71,57 @@ def test_get_random_category_line_longenough(self): assert isinstance(actual, str) assert len(actual) > 0 - # Tests if the input for ai line is empty def test_get_ai_line_empty(self): - actual = pyrizz.get_ai_line("") + helper = Helper + mock_client = helper.create_openai_mock() + + actual = pyrizz.get_ai_line("", mock_client) expected = "Please specify a category." assert actual.strip() == expected.strip() # Tests if the input is way too long def test_get_ai_line_long(self): - actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.") + helper = Helper + mock_client = helper.create_openai_mock() + + actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.", mock_client) expected = "Please specify a category that is less than 50 characters." assert actual.strip() == expected.strip() + # Tests if the input for ai line actually results in a string def test_get_ai_line_str(self): - actual = pyrizz.get_ai_line("test") - assert isinstance(actual, str) + # Create a dictionary resembling the expected OpenAI response + helper = Helper + mock_client = helper.create_openai_mock() + actual = pyrizz.get_ai_line("test", mock_client) + assert isinstance(actual, str) # Tests if the rate line is empty def test_rate_line_empty(self): - actual = pyrizz.rate_line("") + helper = Helper + mock_client = helper.create_openai_mock() + + actual = pyrizz.rate_line("", mock_client) assert actual == "No pickup line? You gotta use our other features before you come here buddy." # Tests if the rate line function follows a specific format def test_rate_line_format(self): - actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.") + helper = Helper + mock_client = helper.create_openai_mock() + + actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.", mock_client) assert re.match(r'\d+/10 - .+', actual) is not None + #Tests if the rate line function returns + def test_rate_line_gibberish(self): + helper = Helper + mock_client = helper.create_openai_mock() + + actual = pyrizz.rate_line("jwrkf", mock_client) + assert re.match(r'.+', actual) is not None def test_create_line_invalid_template_number(self, capsys): with patch('builtins.input', side_effect=["21"]): @@ -120,4 +144,21 @@ def test_create_line_not_enough_words(self, capsys): # Tests for user input validation def test_is_line_valid_length(self): long_line = "x" * 141 - assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." \ No newline at end of file + assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." + +class Helper: + def create_openai_mock(): + mock_client = MagicMock() + + mock_response = { + "choices": [ + { + "message": { + "content": "Test content" + } + } + ] + } + mock_client.ChatCompletion.create.return_value = MagicMock(**mock_response) + + return mock_client \ No newline at end of file From 0b025a9953bc6c937555f75d1e9e3f92901c848c Mon Sep 17 00:00:00 2001 From: Baani Pasrija Date: Thu, 9 Nov 2023 03:23:08 -0500 Subject: [PATCH 71/95] gon pr after this commit --- tests/test_pyrizz.py | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index e8d48bc..d7a602c 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -74,53 +74,57 @@ def test_get_random_category_line_longenough(self): # Tests if the input for ai line is empty def test_get_ai_line_empty(self): helper = Helper - mock_client = helper.create_openai_mock() + mock_client = helper.create_get_mock() actual = pyrizz.get_ai_line("", mock_client) + print(actual) expected = "Please specify a category." assert actual.strip() == expected.strip() # Tests if the input is way too long def test_get_ai_line_long(self): helper = Helper - mock_client = helper.create_openai_mock() + mock_client = helper.create_get_mock() actual = pyrizz.get_ai_line("This is a very long category that is definitely more than 50 characters long.", mock_client) + print(actual) expected = "Please specify a category that is less than 50 characters." assert actual.strip() == expected.strip() - # Tests if the input for ai line actually results in a string def test_get_ai_line_str(self): - # Create a dictionary resembling the expected OpenAI response helper = Helper - mock_client = helper.create_openai_mock() + mock_client = helper.create_get_mock() actual = pyrizz.get_ai_line("test", mock_client) + print(actual) assert isinstance(actual, str) # Tests if the rate line is empty def test_rate_line_empty(self): helper = Helper - mock_client = helper.create_openai_mock() + mock_client = helper.create_rate_mock() actual = pyrizz.rate_line("", mock_client) + print(actual) assert actual == "No pickup line? You gotta use our other features before you come here buddy." # Tests if the rate line function follows a specific format def test_rate_line_format(self): helper = Helper - mock_client = helper.create_openai_mock() + mock_client = helper.create_rate_mock() actual = pyrizz.rate_line("Do you come with Wi-Fi? Because I'm really feeling a connection.", mock_client) + print(actual) assert re.match(r'\d+/10 - .+', actual) is not None #Tests if the rate line function returns def test_rate_line_gibberish(self): helper = Helper - mock_client = helper.create_openai_mock() + mock_client = helper.create_rate_mock() actual = pyrizz.rate_line("jwrkf", mock_client) + print(actual) assert re.match(r'.+', actual) is not None def test_create_line_invalid_template_number(self, capsys): @@ -147,7 +151,7 @@ def test_is_line_valid_length(self): assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." class Helper: - def create_openai_mock(): + def create_get_mock(): mock_client = MagicMock() mock_response = { @@ -161,4 +165,20 @@ def create_openai_mock(): } mock_client.ChatCompletion.create.return_value = MagicMock(**mock_response) - return mock_client \ No newline at end of file + return mock_client + + def create_rate_mock(): + mock_client = MagicMock() + + mock_response = { + "choices": [ + { + "message": { + "content": "10/10 - Short, sweet, and guaranteed to make anyone blush!" + } + } + ] + } + mock_client.ChatCompletion.create.return_value = MagicMock(**mock_response) + + return mock_client From d35c12b2801eb8d25f10f6dba79c4b52bdd99c0a Mon Sep 17 00:00:00 2001 From: Baani Pasrija Date: Thu, 9 Nov 2023 03:34:07 -0500 Subject: [PATCH 72/95] trying testing fighting --- src/pyrizz/__main__.py | 2 +- tests/test_pyrizz.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index ed68a3f..e2b2c47 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -28,7 +28,7 @@ def main(): print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") print("5. Create your very own pickup line!.\n") - print("6. Enter your API key to use AI function.\n") + print("6. Enter your API key to use AI functionality.\n") print("!! Type Q to quit !!\n") diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index d7a602c..6fc5a0e 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -6,7 +6,6 @@ from unittest.mock import Mock, patch from unittest.mock import patch, MagicMock, mock_open import openai -from openai import openai_object sys.path.append(f"{pathlib.Path(__file__).parent.resolve()}/../src") from pyrizz import pyrizz From 256d2a7f963d1a50c8ea7cbabd689676f75f96af Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 13:50:29 -0500 Subject: [PATCH 73/95] fixes --- src/pyrizz/__main__.py | 6 ++++-- src/pyrizz/pyrizz.py | 39 ++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index a9947f8..fb45570 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,4 @@ -import pyrizz as pyrizz +import pyrizz.pyrizz as pyrizz import openai """Main function for PyRizz.""" @@ -77,7 +77,9 @@ def main(): elif user_input == "6": print("Here are the available templates:") - pyrizz.list_templates() + templates = pyrizz.list_templates() + for idx, template in enumerate(templates, 1): + print(f"Template {idx}: {template}") elif user_input == "7": print("Please enter your API key.") diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 0134e46..f94666c 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -1,7 +1,6 @@ import os import random import pathlib -import json from pyrizz.pickuplines import pickuplines from pyrizz.templates import templates @@ -66,8 +65,13 @@ def load_ascii_art(filename): with open(filename, 'r', encoding='utf-8') as file: content = file.read() ascii_art_pieces = content.split('[End]') - ascii_art_pieces = [piece.strip()[len('[Start]'):].strip() for piece in ascii_art_pieces if piece.strip()] - return ascii_art_pieces + cleaned_ascii_art_pieces = [] + for piece in ascii_art_pieces: + if '[Start]' in piece: + start_index = piece.find('[Start]') + len('[Start]') + art_piece = piece[start_index:] + cleaned_ascii_art_pieces.append(art_piece) + return cleaned_ascii_art_pieces def create_line(template_number, words): if not (0 <= template_number < len(templates)): @@ -92,12 +96,16 @@ def create_line(template_number, words): return None, "Your line doesn't pass our checks. Sorry!" def get_user_input_for_line(): - print("Choose a template number (0-{}):".format(len(templates))) - template_number = int(input("> ")) - 1 + print("Choose a template number (0-{}):".format(len(templates) - 1)) + try: + template_number = int(input("> ")) + except ValueError: + print("Invalid input. Please enter an integer value.") + return None, None if template_number not in range(len(templates)): print("Invalid template number. Please choose a number between 0 and {}.".format(len(templates) - 1)) - return None, None + return None, None template_to_show = templates[template_number] placeholders_count = template_to_show.count("{}") @@ -106,8 +114,12 @@ def get_user_input_for_line(): print(template_to_show.format(*(['______'] * placeholders_count))) print(f"Enter {placeholders_count} word(s) separated by commas to fill into the template:") - words = input("> ").split(',') - words = [word.strip() for word in words] + words_input = input("> ") + words = [word.strip() for word in words_input.split(',')] + + if len(words) != placeholders_count: + print(f"Incorrect number of words. You need to provide exactly {placeholders_count} word(s).") + return None, None return template_number, words @@ -115,19 +127,8 @@ def is_line_valid(user_line): if len(user_line) > 140: print("Your pick-up line is too long.") return False - - #if is_offensive(user_line): - #return False return True -#def is_offensive(text): -# if profanity.contains_profanity(text): -# return True -# else: -# return False - def list_templates(): - for idx, template in enumerate(templates, 1): - print(f"Template {idx}: {template}") return templates From 233b0e0b32c31f46a2dcdd8a13270f2f1fe360fe Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 13:52:01 -0500 Subject: [PATCH 74/95] f --- tests/test_pyrizz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 3e658bc..0632d4b 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -119,7 +119,7 @@ def test_is_line_valid_length(self): long_line = "x" * 141 assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." - @patch("builtins.input", side_effect=["1", "word1, word2"]) + @patch("builtins.input", side_effect=["0", "word1, word2"]) def test_get_user_input_for_line(self, mock_input): template_number, words = pyrizz.get_user_input_for_line() assert template_number == 0 From 566a3cc6fa853d861ed2a900634ef7d0db27da87 Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 13:53:24 -0500 Subject: [PATCH 75/95] ff --- tests/test_pyrizz.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index 0632d4b..f73d43d 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -119,12 +119,6 @@ def test_is_line_valid_length(self): long_line = "x" * 141 assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." - @patch("builtins.input", side_effect=["0", "word1, word2"]) - def test_get_user_input_for_line(self, mock_input): - template_number, words = pyrizz.get_user_input_for_line() - assert template_number == 0 - assert words == ["word1", "word2"] - def test_create_line_invalid_template_number(self): _, message = pyrizz.create_line(999, ["word1", "word2"]) assert message == "Template number out of range. Please choose between 0 and {}.".format(len(pyrizz.templates) - 1) From ce3a368c7d1f78309d36732e6a3115b208cfb302 Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 14:23:25 -0500 Subject: [PATCH 76/95] add to readme --- MANIFEST.in | 1 + README.md | 23 ++++++++++++++++------- pyproject.toml | 5 ++++- 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..a2a22ad --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include src/pyrizz/data * \ No newline at end of file diff --git a/README.md b/README.md index 3ba5a07..720b7db 100644 --- a/README.md +++ b/README.md @@ -40,30 +40,39 @@ print(pyrizz.get_random_categoryy_line('geeky')) print(pyrizz.get_random_categoryy_line('dev')) ``` -### get_ai_line(keyword) +### get_ai_line(keyword, your_openai_key) -In this function, you can retreive a generated pickup line using openai based on any keyword that you suggest. In this example, it would output a Shakespearean pickup line: +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 -print(pyrizz.get_ai_line('shakespeare')) +openai.api_key = "..." +print(pyrizz.get_ai_line("Shakespeare", openai)) ``` -### rate_line(pickup_line) +### rate_line(pickup_line, your_openai_key) -In this function, you can rate your very own pickup line out of 10 using openai. Simply type your pickup line and a rating will output: +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 -print(pyrizz.rate_line('Are you from Tennesse? Cause you're the only 10 I see.')) +openai.api_key = "..." +print(pyrizz.rate_line('Are you from Tennesse? Cause you're the only 10 I see.', openai)) ``` +Note: Please make sure you are using `openai==0.28.1`. ### 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: `print(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! +- **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! diff --git a/pyproject.toml b/pyproject.toml index 4510a48..08f7dd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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 = "0.0.91" +version = "1.0.5" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, @@ -33,3 +33,6 @@ dev = ["pytest"] [project.scripts] pyrizz = "pyrizz.__main__:main" + +[tool.setuptools.package-data] +"pyrizz" = ["data/*"] \ No newline at end of file From 5bf8e0f3f93868b3e93d67770fc5115cbb86249f Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 14:29:03 -0500 Subject: [PATCH 77/95] fix typo in readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 720b7db..92c47c8 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,10 @@ In this function, you can retreive any random pickup line from a specific catego ``` from pyrizz import pyrizz -print(pyrizz.get_random_categoryy_line('romantic')) -print(pyrizz.get_random_categoryy_line('clever')) -print(pyrizz.get_random_categoryy_line('geeky')) -print(pyrizz.get_random_categoryy_line('dev')) +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')) ``` ### get_ai_line(keyword, your_openai_key) From 594e924a2d683442ea6a46fbc43f637cc6282820 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Thu, 9 Nov 2023 16:03:42 -0500 Subject: [PATCH 78/95] Update README.md --- README.md | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 92c47c8..d639c72 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,30 @@ print(pyrizz.get_random_category_line('geeky')) print(pyrizz.get_random_category_line('dev')) ``` +### 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: @@ -65,25 +89,7 @@ print(pyrizz.rate_line('Are you from Tennesse? Cause you're the only 10 I see.', ``` Note: Please make sure you are using `openai==0.28.1`. -### 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) -``` ### Accessing an Example: You can access our example file which utilizes all of these functions with an awesome user interface: From 9f49ebc888fd28368f38e66de3810b3a3ffd14bf Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 16:12:27 -0500 Subject: [PATCH 79/95] menu fix --- src/pyrizz/__main__.py | 14 +++++++------- src/pyrizz/pyrizz.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index fb45570..aabaf87 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,4 @@ -import pyrizz.pyrizz as pyrizz +import pyrizz as pyrizz import openai """Main function for PyRizz.""" @@ -24,12 +24,12 @@ def main(): print("What would you like to do today?\n") print("1. Get a random pick-up line") print("2. Get a category-specific random pick-up line (romantic, clever, geeky, dev)") - print("3. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters)") - print("4. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;)") - print("5. Create your line with one of our templates with randomly selected ASCII art.") - print("6. List available templates for pick-up lines.\n") - - print("7. Enter your API key to use AI functionality.\n") + print("3. Create your line with one of our templates with randomly selected ASCII art.") + print("4. List available templates for pick-up lines.\n") + print("Use AI for your pickup lines: ") + print("5. Enter your API key to use AI functionality.") + print("6. Have AI generate a pick-up line in your chosen category / language (no more than 50 characters)") + print("7. Have AI rate your pick-up line out of 10. Test it on AI before trying it on a human! ;) \n") print("!! Type Q to quit !!\n") diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index f94666c..5b5ef9b 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -1,8 +1,8 @@ import os import random import pathlib -from pyrizz.pickuplines import pickuplines -from pyrizz.templates import templates +from pickuplines import pickuplines +from templates import templates PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/" From 6566ae4487943afd30d4c327ed04189419b9b8c0 Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 16:14:28 -0500 Subject: [PATCH 80/95] menu fix --- src/pyrizz/__main__.py | 2 +- src/pyrizz/pyrizz.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index aabaf87..b43af90 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,4 +1,4 @@ -import pyrizz as pyrizz +import pyrizz.pyrizz as pyrizz import openai """Main function for PyRizz.""" diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index 5b5ef9b..f94666c 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -1,8 +1,8 @@ import os import random import pathlib -from pickuplines import pickuplines -from templates import templates +from pyrizz.pickuplines import pickuplines +from pyrizz.templates import templates PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/" From ff79f567963b3210ff9aea5787cbdb33611788e2 Mon Sep 17 00:00:00 2001 From: Baani Pasrija Date: Thu, 9 Nov 2023 19:41:22 -0500 Subject: [PATCH 81/95] init func for api client + minor menu changes --- src/pyrizz/__main__.py | 76 ++++++++++++++++++++++-------------------- src/pyrizz/pyrizz.py | 11 ++++++ tests/test_pyrizz.py | 3 +- 3 files changed, 53 insertions(+), 37 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index b43af90..820e188 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,5 +1,4 @@ import pyrizz.pyrizz as pyrizz -import openai """Main function for PyRizz.""" @@ -17,11 +16,11 @@ print("\n") def main(): - openai_client = openai - print("Welcome to PyRizz! Your journey to getting a date begins here...\n") + openai_client = None + print("Welcome to PyRizz! Your journey to getting a date begins here...") - while True: - print("What would you like to do today?\n") + while True: + print("\nWhat would you like to do today?\n") print("1. Get a random pick-up line") print("2. Get a category-specific random pick-up line (romantic, clever, geeky, dev)") print("3. Create your line with one of our templates with randomly selected ASCII art.") @@ -46,51 +45,56 @@ def main(): print("3 - Geeky") print("4 - Developer Lines") category_index = input("> ") - category_index = int(category_index) - if category_index in range(1, 4): - if(category_index == 1): - category_val = "romantic" - elif(category_index == 2): - category_val = "clever" - elif(category_index == 3): - category_val = "geeky" - elif(category_index == 4): - category_val = "dev" - print("\n" + pyrizz.get_random_category_line(category_val), end = "\n\n") - - elif user_input == "3": - print("Enter a category / language: ") - category = input("> ") - print("\n" + pyrizz.get_ai_line(category, openai_client), end = "\n\n") - - elif user_input == "4": - print("Type your pickup line: ") - pickup_line = input("> ") - print("\n" + pyrizz.rate_line(pickup_line, openai_client), end = "\n\n") + if (category_index.isdigit()): + category_index = int(category_index) + if(category_index in range(1, 5)): + if(category_index == 1): + category_val = "romantic" + elif(category_index == 2): + category_val = "clever" + elif(category_index == 3): + category_val = "geeky" + elif(category_index == 4): + category_val = "dev" + print("\n" + pyrizz.get_random_category_line(category_val), end = "\n\n") + else: + print("Please make sure it is a number from 1-4. \n") + else: + print("Not a valid input! \n") - elif user_input == "5": + elif user_input == "3": template_number, words = pyrizz.get_user_input_for_line() line = pyrizz.create_line(template_number, words) if line: print("\nHere's your custom pick-up line:") print(line) - elif user_input == "6": + elif user_input == "4": print("Here are the available templates:") templates = pyrizz.list_templates() for idx, template in enumerate(templates, 1): print(f"Template {idx}: {template}") - elif user_input == "7": + elif user_input == "5": print("Please enter your API key.") user_api_key = input("> ") - try: - openai_client.api_key = user_api_key - openai_client.Model.list() - print("Successful. You can use AI functionality now!\n") - except openai_client.error.AuthenticationError as err: - print(err) - print() + openai_client = pyrizz.init_openai(user_api_key) + + elif user_input == "6": + if openai_client: + print("Enter a category / language: ") + category = input("> ") + print("\n" + pyrizz.get_ai_line(category, openai_client), end = "\n\n") + else: + print("\nYou need to enter an API key first. Select 5!\n") + + elif user_input == "7": + if openai_client: + print("Type your pickup line: ") + pickup_line = input("> ") + print("\n" + pyrizz.rate_line(pickup_line, openai_client), end = "\n\n") + else: + print("\nYou need to enter an API key first. Select 5!\n") elif user_input == "q" or user_input == "Q": break diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index f94666c..c5f4c5e 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -1,6 +1,7 @@ import os import random import pathlib +import openai from pyrizz.pickuplines import pickuplines from pyrizz.templates import templates @@ -21,6 +22,16 @@ def get_random_category_line(category='all'): category_pickupline = get_lines(category) return random.choice(category_pickupline) +def init_openai(key): + try: + openai.api_key = key + openai.Model.list() + print("\nSuccessful. You can use AI functionality now.\n") + return openai + except openai.error.AuthenticationError as err: + print("\nAuthentication failed. Try entering a different API key or call on pyrizz.init_openai(your_key).\n") + return err + def get_ai_line(category, client) -> str: try: if (category != "" and len(category) <= 50): diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index f73d43d..ae95614 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -69,7 +69,8 @@ def test_get_random_category_line_longenough(self): actual = pyrizz.get_random_category_line("romantic") assert isinstance(actual, str) assert len(actual) > 0 - + + # Note: Not testing init_openai(key) because there is not any logic; just working on openai API functionality, authentication, and connection.""" # Tests if the input for ai line is empty def test_get_ai_line_empty(self): helper = Helper From d4018dc5f5389fc249bbb8537090a73237a5e0aa Mon Sep 17 00:00:00 2001 From: Baani Pasrija Date: Thu, 9 Nov 2023 20:10:05 -0500 Subject: [PATCH 82/95] init api key func + minor menu changes --- Pipfile | 2 +- Pipfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index e4580c4..474eb0f 100644 --- a/Pipfile +++ b/Pipfile @@ -9,9 +9,9 @@ verify_ssl = true name = "testpypi" [packages] -pytest = "==7.4.3" python-dotenv = "==0.16.0" openai = "==0.28.1" +pytest = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 4df476d..6b71146 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "cbdb3a064157622f509856f95f7393a42182c58a9de5477f544df95cc579e719" + "sha256": "050309065a9507a9ae46f8044c43a0f19902c3b52800063e69822130da2a8968" }, "pipfile-spec": 6, "requires": { From 2afbb5d8dbe6bf0cecdef3dfc8b48b6562303468 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Thu, 9 Nov 2023 20:33:22 -0500 Subject: [PATCH 83/95] Made pickup lines and menu interface consistent --- src/pyrizz/__main__.py | 10 +- src/pyrizz/pickuplines.py | 188 +++++++++++++++++++------------------- src/pyrizz/pyrizz.py | 6 ++ 3 files changed, 107 insertions(+), 97 deletions(-) diff --git a/src/pyrizz/__main__.py b/src/pyrizz/__main__.py index 820e188..01cca39 100644 --- a/src/pyrizz/__main__.py +++ b/src/pyrizz/__main__.py @@ -1,5 +1,9 @@ +# 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 + """Main function for PyRizz.""" #ASCII art @@ -36,7 +40,7 @@ def main(): user_input = input("> ") if user_input == "1": - print("\n" + pyrizz.get_random_line(), end = "\n\n") + print("\n" + pyrizz.get_random_line(), end = "\n") elif user_input == "2": print("Select a category: ") @@ -56,7 +60,7 @@ def main(): category_val = "geeky" elif(category_index == 4): category_val = "dev" - print("\n" + pyrizz.get_random_category_line(category_val), end = "\n\n") + print("\n" + pyrizz.get_random_category_line(category_val), end = "\n") else: print("Please make sure it is a number from 1-4. \n") else: @@ -67,7 +71,7 @@ def main(): line = pyrizz.create_line(template_number, words) if line: print("\nHere's your custom pick-up line:") - print(line) + print(line + "\n") elif user_input == "4": print("Here are the available templates:") diff --git a/src/pyrizz/pickuplines.py b/src/pyrizz/pickuplines.py index 52c5cbf..9c359eb 100644 --- a/src/pyrizz/pickuplines.py +++ b/src/pyrizz/pickuplines.py @@ -101,109 +101,109 @@ "You must be an algorithm, because you have my heart running in O(1) time.\n", "Are you a piece of code? Because you're turning my software into hardware!\n", "Are you a compressed file? Because when I see you, my heart wants to unzip.\n", - "I'm the RizzLord." + "I'm the RizzLord.\n" ] romantic_lines = [ - "Is it okay if I walk you home? My heart seems to follow wherever you go.", - "If beauty were a moment, you'd be an eternity.", - "Every time I see you, it feels like I've discovered a new shade of color", - "If stars would shine every time I thought of you, the night sky would glisten.", - "Do you believe in love at first sight, or should I walk by again?", - "Your voice is my favorite sound, and your name is my favorite noun.", - "If I were to rewrite the alphabet, I'd put U and I together.", - "I wouldn't need a camera to savor this moment; I just need you.", - "Every song I hear reminds me of you, even the ones I haven't heard yet…", - "I never believed in magic until I saw you.", - "Your beauty could inspire poets and artists for generations.", - "Do you believe in destiny? Because I think ours just intertwined.", - "Your presence makes my heart race, but it's a marathon I never want to…", - "If beauty were a crime, you'd be serving a life sentence.", - "Every time I look at you, I believe in fairy tales.", - "Thought happiness started with an H, but mine starts with U.", - "Are you Wi-fi? Because I'm feeling a connection.", - "Do you have a Band-Aid? I just scraped my knee falling for you.", - "Is there a rainbow today? Because I've just found my pot of gold in you", - "If you were a star, you'd outshine the entire galaxy.", - "If kisses were snowflakes, I'd send you a blizzard.", - "Your smile must be a black hole because it's irresistibly attractive.", - "If you were words on a page, you'd be the fine print.", - "Can I follow you? Because my mom told me to follow my dreams.", - "Is your name Google? Because you have everything I've been searching for you", - "Do you have a name, or can I call you mine?", - "Are you a library book? Because I can't help but check you out.", - "Do you have a pencil? Because I want to erase your past and write our future", - "Is your dad a baker? Because you're a cutie pie.", - "Are you a candle? Because you light up my world.", - "Are you a string? Because I can't stop finding myself attached to you.", - "If you were a function, I'd call you every day.", - "Are you a loop? Because I can't stop thinking about you again and again", + "Is it okay if I walk you home? My heart seems to follow wherever you go.\n", + "If beauty were a moment, you'd be an eternity.\n", + "Every time I see you, it feels like I've discovered a new shade of color.\n", + "If stars would shine every time I thought of you, the night sky would glisten.\n", + "Do you believe in love at first sight, or should I walk by again?\n", + "Your voice is my favorite sound, and your name is my favorite noun.\n", + "If I were to rewrite the alphabet, I'd put U and I together.\n", + "I wouldn't need a camera to savor this moment; I just need you.\n", + "Every song I hear reminds me of you, even the ones I haven't heard yet.\n", + "I never believed in magic until I saw you.\n", + "Your beauty could inspire poets and artists for generations.\n", + "Do you believe in destiny? Because I think ours just intertwined.\n", + "Your presence makes my heart race, but it's a marathon I never want to finish.\n", + "If beauty were a crime, you'd be serving a life sentence.\n", + "Every time I look at you, I believe in fairy tales.\n", + "Thought happiness started with an H, but mine starts with U.\n", + "Are you Wi-fi? Because I'm feeling a connection.\n", + "Do you have a Band-Aid? I just scraped my knee falling for you.\n", + "Is there a rainbow today? Because I've just found my pot of gold in you\n", + "If you were a star, you'd outshine the entire galaxy.\n", + "If kisses were snowflakes, I'd send you a blizzard.\n", + "Your smile must be a black hole because it's irresistibly attractive.\n", + "If you were words on a page, you'd be the fine print.\n", + "Can I follow you? Because my mom told me to follow my dreams.\n", + "Is your name Google? Because you have everything I've been searching for you.\n", + "Do you have a name, or can I call you mine?\n", + "Are you a library book? Because I can't help but check you out.\n", + "Do you have a pencil? Because I want to erase your past and write our future.\n", + "Is your dad a baker? Because you're a cutie pie.\n", + "Are you a candle? Because you light up my world.\n", + "Are you a string? Because I can't stop finding myself attached to you.\n", + "If you were a function, I'd call you every day.\n", + "Are you a loop? Because I can't stop thinking about you again and again.\n" ] clever_lines = [ - "Did we just share an elevator? Because I believe we have some serious …", - "I must be a snowflake because I've fallen for you." - "I tried finding the perfect line to make you smile, but then I realize…", - "If you were a vegetable, you'd be a 'cute-cumber.'", - "If life was a song, your smile would be the melody that gets stuck in …", - "Is it hot in here, or is it just the aura of warmth you radiate?", - "I've been trying to tie my shoes, but I can't stop tripping over my th…", - "Do you have a map? I keep getting lost in your eyes.", - "Did it hurt? When you fell from the stars and landed in my world?", - "I'm not a genie, but I can make your dreams come true.", - "Are you made of copper and tellurium? Because you're Cu-Te.", - "Are you a magician? Every time I look at you, everyone else disappears…", - "Do you like basketball? Because when I saw you, my heart did a slam du…", - "If you were a vegetable, you'd be a cutecumber.", - "Do you have a sunburn, or are you always this hot?", - "Is your dad a boxer? Because you're a knockout.", - "Are you a loan from a bank? Because you have my interest.", - "Are you a campfire? Because you're hot and I want s'more.", - "Are you a parking ticket? Because you've got 'FINE' written all over y…", - "Are you a snowstorm? Because you make my heart race.", - "Are you a time traveler? Because I can see you in my future.", + "Did we just share an elevator? Because I believe we have some serious uplifted chemistry.\n", + "I must be a snowflake because I've fallen for you.\n", + "I tried finding the perfect line to make you smile, but then I realized you are the line.\n", + "If you were a vegetable, you'd be a 'cute-cumber.\n", + "If life was a song, your smile would be the melody that gets stuck in my head.\n", + "Is it hot in here, or is it just the aura of warmth you radiate?\n", + "I've been trying to tie my shoes, but I can't stop tripping over my thoughts of you.\n", + "Do you have a map? I keep getting lost in your eyes.\n", + "Did it hurt? When you fell from the stars and landed in my world?\n", + "I'm not a genie, but I can make your dreams come true.\n", + "Are you made of copper and tellurium? Because you're Cu-Te.\n", + "Are you a magician? Every time I look at you, everyone else disappears.\n", + "Do you like basketball? Because when I saw you, my heart did a slam dunk.\n", + "If you were a vegetable, you'd be a cutecumber.\n", + "Do you have a sunburn, or are you always this hot?\n", + "Is your dad a boxer? Because you're a knockout.\n", + "Are you a loan from a bank? Because you have my interest.\n", + "Are you a campfire? Because you're hot and I want s'more.\n", + "Are you a parking ticket? Because you've got 'FINE' written all over you.\n", + "Are you a snowstorm? Because you make my heart race.\n", + "Are you a time traveler? Because I can see you in my future.\n" ] geeky_lines = [ - "You're the 'key' to my 'value'.", - "If beauty were data, you'd be an overflow error.", - "Are you a variable? Because I feel the need to declare my intentions.", - "I think you've just incremented my heart's counter.", - "You're the API to my application.", - "If relationships were algorithms, ours would be a perfect match.", - "Your presence makes my system run at optimal efficiency.", - "If you were an exception, I'd catch you.", - "You must be a compiler because every time I see you, my code becomes r…", - "I'm not a photographer, but I can picture us in an endless loop togeth…", - "In the world of binary, you are the one for me.", - "I've got a lot of lines of code, but none as intriguing as the story o…", - "Forget the cloud, you've taken up all the storage in my heart.", - "I don't need version control to know you're my final commit.", - "Let's merge our branches and build a beautiful codebase together.", - "Do you believe in parallel universes? Because in every one I've imagin…", - "You must be a packet because I can't help but sniff you out in a crowd…", - "Are you an algorithm? Because every part of me wants to solve you.", - "Do you know JavaScript? Because you make my heart race asynchronously.", - "If I were to traverse the nodes of my heart, every path would lead to …", - "In the Git of life, I'd never want to revert our commit.", - "Are you a CSS file? Because without you, my life would be unstyled.", - "You must be a bug, because I just can't shake you off my mind.", - "If hearts had firewalls, you'd have bypassed mine ages ago.", - "Are you a Boolean? Because true or false, my heart points to you.", - "In the world of objects, you are my favorite instance.", - "If attraction were a programming language, ours would be high-level.", - "Are you a kernel? Because my heart feels an urge to dive deeper into y…", - "Do you like Java? Because you've Objectified my affections.", - "I'd never put our relationship in a try-catch block, because I never w…", - "You're not just a semicolon; you're the statement that completes me.", - "In the IDE of life, you've just become my favorite extension.", - "If I were a coder, I'd refactor my life to include more of you.", - "You're like the most elegant code I've ever seen; concise, beautiful, …", - "You have stolen the ASCII to my heart.", - "You must be an exception, because I can't handle you properly.", - "You must be an algorithm, because you have my heart running in O(1) ti…", - "Are you a piece of code? Because you're turning my software into hardw…", - "Are you a compressed file? Because when I see you, my heart wants to u…" + "You're the 'key' to my 'value'.\n", + "If beauty were data, you'd be an overflow error.\n", + "Are you a variable? Because I feel the need to declare my intentions.\n", + "I think you've just incremented my heart's counter.\n", + "You're the API to my application.\n", + "If relationships were algorithms, ours would be a perfect match.\n", + "Your presence makes my system run at optimal efficiency.\n", + "If you were an exception, I'd catch you.\n", + "You must be a compiler because every time I see you, my code becomes runnable.\n", + "I'm not a photographer, but I can picture us in an endless loop together.\n", + "In the world of binary, you are the one for me.\n", + "I've got a lot of lines of code, but none as intriguing as the story of us.\n", + "Forget the cloud, you've taken up all the storage in my heart.\n", + "I don't need version control to know you're my final commit.\n", + "Let's merge our branches and build a beautiful codebase together.\n", + "Do you believe in parallel universes? Because in every one I've imagined, it's always been you and me.\n", + "You must be a packet because I can't help but sniff you out in a crowd.\n", + "Are you an algorithm? Because every part of me wants to solve you.\n", + "Do you know JavaScript? Because you make my heart race asynchronously.\n", + "If I were to traverse the nodes of my heart, every path would lead to you.\n", + "In the Git of life, I'd never want to revert our commit.\n", + "Are you a CSS file? Because without you, my life would be unstyled.\n", + "You must be a bug, because I just can't shake you off my mind.\n", + "If hearts had firewalls, you'd have bypassed mine ages ago.\n", + "Are you a Boolean? Because true or false, my heart points to you.\n", + "In the world of objects, you are my favorite instance.\n", + "If attraction were a programming language, ours would be high-level.\n", + "Are you a kernel? Because my heart feels an urge to dive deeper into you.\n", + "Do you like Java? Because you've Objectified my affections.\n", + "I'd never put our relationship in a try-catch block, because I never want to handle an exception with us.\n", + "You're not just a semicolon; you're the statement that completes me.\n", + "In the IDE of life, you've just become my favorite extension.\n", + "If I were a coder, I'd refactor my life to include more of you.\n", + "You're like the most elegant code I've ever seen; concise, beautiful, and effective.\n", + "You have stolen the ASCII to my heart.\n", + "You must be an exception, because I can't handle you properly.\n", + "You must be an algorithm, because you have my heart running in O(1) time.\n", + "Are you a piece of code? Because you're turning my software into hardware!\n", + "Are you a compressed file? Because when I see you, my heart wants to unzip.\n" ] templates = [ diff --git a/src/pyrizz/pyrizz.py b/src/pyrizz/pyrizz.py index c5f4c5e..d9fe040 100644 --- a/src/pyrizz/pyrizz.py +++ b/src/pyrizz/pyrizz.py @@ -2,9 +2,15 @@ import random import pathlib import openai + +# 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 + PROJECT_ROOT = f"{pathlib.Path(__file__).parent.resolve()}/" def get_lines(category='all'): From 0696b6b20b6e7a4f65affcca6515a591bc455c2b Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 22:13:00 -0500 Subject: [PATCH 84/95] Added tests --- tests/test_pyrizz.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/tests/test_pyrizz.py b/tests/test_pyrizz.py index ae95614..934995f 100644 --- a/tests/test_pyrizz.py +++ b/tests/test_pyrizz.py @@ -119,10 +119,42 @@ def test_rate_line_gibberish(self): def test_is_line_valid_length(self): long_line = "x" * 141 assert not pyrizz.is_line_valid(long_line), "Expected the line to be flagged as too long." - + + # Test for invalid tempalte number def test_create_line_invalid_template_number(self): _, message = pyrizz.create_line(999, ["word1", "word2"]) assert message == "Template number out of range. Please choose between 0 and {}.".format(len(pyrizz.templates) - 1) + + # Test for incorrect word count + def test_create_line_incorrect_word_count(self): + templates = ["Template with one placeholder: {}"] + with patch('pyrizz.templates', new=templates): + _, message = pyrizz.create_line(0, ["word1", "word2"]) + expected_message = "Incorrect number of words provided for the placeholders. Expected 1, got 2." + assert message == expected_message + + # Test for non-integer template number + @patch('builtins.input', side_effect=["not_an_integer"]) + def test_get_user_input_for_line_noninteger(self, mock_input): + with patch('pyrizz.templates', new=["Some template"]): + template_number, words = pyrizz.get_user_input_for_line() + assert template_number is None and words is None + + # Test for out of range template numebr + @patch('builtins.input', side_effect=["99", "word1, word2"]) + def test_get_user_input_for_line_out_of_range(self, mock_input): + templates = ["Template 0"] + with patch('pyrizz.templates', new=templates): + template_number, words = pyrizz.get_user_input_for_line() + assert template_number is None and words is None + + # Test for incorrect number of words provided + @patch('builtins.input', side_effect=["0", "word1, word2, word3"]) + def test_get_user_input_for_line_incorrect_word_count(self, mock_input): + templates = ["Template with two placeholders: {}, {}"] + with patch('pyrizz.templates', new=templates): + template_number, words = pyrizz.get_user_input_for_line() + assert template_number is None and words is None class Helper: From 04a5d8ca347175dffabbf54e6ebe6862ab2b2174 Mon Sep 17 00:00:00 2001 From: annsts Date: Thu, 9 Nov 2023 22:23:56 -0500 Subject: [PATCH 85/95] remove lines --- src/pyrizz/pickuplines.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/pyrizz/pickuplines.py b/src/pyrizz/pickuplines.py index 9c359eb..ec76eae 100644 --- a/src/pyrizz/pickuplines.py +++ b/src/pyrizz/pickuplines.py @@ -206,29 +206,6 @@ "Are you a compressed file? Because when I see you, my heart wants to unzip.\n" ] -templates = [ - "Do you have a {}? Because whenever I look at you, everyone else disappears.", - "Are you a {}? Because every time I think of you, I smile.", - "Do you have a map? I keep getting lost in your {}.", - "If beauty were time, you'd be an {}.", - "I'm not a photographer, but I can picture us together in a {}.", - "Can I follow you home? Cause my parents always told me to follow my {}.", - "Is your name Google? Because you have everything I've been searching for in the {}.", - "Are you made of copper and tellurium? Because you're {}.", - "Do you like Star Wars? Because Yoda only one for me in the {}.", - "If you were a {} on a McDonald's menu, you'd be a McGorgeous.", - "Do you have a Band-Aid? Because I just scraped my knee falling for {}.", - "Is it hot in here or is it just the {} we have together?", - "If you were a vegetable, you'd be a {}.", - "I must be a {} because I am attracted to your magnetic field.", - "Is there an airport nearby or is that just my heart taking {}?", - "You must be a magician because whenever I look at you, everyone else {}.", - "If I could rearrange the alphabet, I'd put {} and {} together.", - "Are you a {}? Because you're so fine you blow my mind.", - "Do you have a pencil? Cause I want to erase your past and write our {}.", - "Do you know what my shirt is made of? It's made of boyfriend {}." -] - pickuplines = { 'dev': dev_lines, 'romantic': romantic_lines, From 597a3d2a242334608d24b85aafd9b7454284a569 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Thu, 9 Nov 2023 22:43:10 -0500 Subject: [PATCH 86/95] Update README.md --- README.md | 52 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d639c72..7323f00 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ ![Workflow Status](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/actions/workflows/python.yml/badge.svg) # PyRizz: Your Source for Playful Pickup Lines + +[PyRizz PyPi Link](https://test.pypi.org/project/pyrizz/) + +[PyRizz GitHub Link](https://github.com/software-students-fall2023/3-python-package-exercise-experientia) + +``` +pip install -i https://test.pypi.org/simple/ 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 @@ -30,6 +39,7 @@ In this function, you can retreive any random pickup line from a specific catego - '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 @@ -38,6 +48,7 @@ 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) @@ -70,10 +81,10 @@ In this function, you can retreive a generated pickup line using openai gpt-3.5 ``` from pyrizz import pyrizz -import openai +import openai -openai.api_key = "..." -print(pyrizz.get_ai_line("Shakespeare", openai)) +client = pyrizz.init_openai("your_api_key") +print(pyrizz.get_ai_line("shakespeare", client)) ``` ### rate_line(pickup_line, your_openai_key) @@ -82,9 +93,9 @@ In this function, you can rate your very own pickup line out of 10 using openai ``` from pyrizz import pyrizz -import openai +import openai -openai.api_key = "..." +client = pyrizz.init_openai("your_api_key") print(pyrizz.rate_line('Are you from Tennesse? Cause you're the only 10 I see.', openai)) ``` @@ -159,9 +170,36 @@ We love contributions from everyone. By participating in this project, you agree 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 https://github.com/yourusername/pyrizz/issues. +Report bugs at [Issues](https://github.com/software-students-fall2023/3-python-package-exercise-experientia/issues). If you are reporting a bug, please include: @@ -173,7 +211,7 @@ If you are reporting a bug, please include: If you're proposing enhancements or new features: -* Open a new issue at https://github.com/yourusername/pyrizz/issues, describing the enhancement. +* 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! From 59707cf4831de789d4bc05b6d71166874878c94e Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Thu, 9 Nov 2023 23:01:50 -0500 Subject: [PATCH 87/95] Edited pyproject.toml, updated the version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 08f7dd2..5cd8632 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.0.5" +version = "1.0.8" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, From 7115c3514d9f51d215bf8fcb8fcfa55a4cf781c4 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Thu, 9 Nov 2023 23:08:44 -0500 Subject: [PATCH 88/95] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7323f00..18cfaa2 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ # PyRizz: Your Source for Playful Pickup Lines -[PyRizz PyPi Link](https://test.pypi.org/project/pyrizz/) +[PyRizz PyPi Link](https://pypi.org/project/pyrizz/) [PyRizz GitHub Link](https://github.com/software-students-fall2023/3-python-package-exercise-experientia) ``` -pip install -i https://test.pypi.org/simple/ pyrizz +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. From 5beb68b9bf800b2ddffa7d64920dbf11832ac575 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Thu, 9 Nov 2023 23:10:37 -0500 Subject: [PATCH 89/95] Updated version on pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5cd8632..f8b7e25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.0.8" +version = "1.0.9" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, From e997fdb3fbd0c64d500d2d7a61b4e39a5743a7fa Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Thu, 9 Nov 2023 23:17:48 -0500 Subject: [PATCH 90/95] Added pypi badge to the readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 18cfaa2..28a1b9f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ![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) # PyRizz: Your Source for Playful Pickup Lines From 6dd0ee224f171fffe9023c68f3b9297661cfb62b Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Thu, 9 Nov 2023 23:19:39 -0500 Subject: [PATCH 91/95] Updated version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f8b7e25..7c47889 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.0.9" +version = "1.1.0" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, From 95c57f0a6b67fe1f0d9bc57d3589f19e364799f5 Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Fri, 10 Nov 2023 01:06:56 -0500 Subject: [PATCH 92/95] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 28a1b9f..cc9ea1f 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Note: Please make sure you are using `openai==0.28.1`. 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 access it simply run: `pipenv run python -m pyrizz` on the directory of the repository when cloned. +To run our main file simply run: `python3 -m pyrizz` on the terminal. # Contributing From f90267e9a0421421aa90a64f0fbebf979c35c985 Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Fri, 10 Nov 2023 01:08:46 -0500 Subject: [PATCH 93/95] Updated version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7c47889..e807c8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.0" +version = "1.1.1" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" }, From 1b7ca3b31fc42ac1246f2319784e50e0f972741e Mon Sep 17 00:00:00 2001 From: Aditya Pandhare Date: Fri, 10 Nov 2023 13:41:58 -0500 Subject: [PATCH 94/95] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc9ea1f..9d5bef7 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ 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.', openai)) +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`. From b13bceb81ca6e597ffc08fc7b2ab4f373d5d962c Mon Sep 17 00:00:00 2001 From: awesomeadi00 Date: Fri, 10 Nov 2023 13:42:51 -0500 Subject: [PATCH 95/95] Updated version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e807c8c..e12fe7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ 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.1" +version = "1.1.2" authors = [ { name="Aditya Pandhare", email="adityapandhare44@gmail.com" }, { name="Anzhelika Nastashchuk", email="anzhelika.nastashchuk@gmail.com" },