Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b47d3c2
initialize the repo and add two functions
HelenZhutt Nov 3, 2025
2e48b36
Set up project dirs and wrote compliment function
Nov 3, 2025
9766d4a
Merge pull request #1 from swe-students-fall2025/Adding-line-function
danielleesignup Nov 3, 2025
db5772a
Merge branch 'pipfile-experiment' into compliment-function
Nov 3, 2025
3d15746
Integrated compliment function to existing file structure
Nov 3, 2025
95332c6
Merge pull request #2 from swe-students-fall2025/compliment-function
danielleesignup Nov 3, 2025
7f2178c
added search function and test
mlv8821-beep Nov 3, 2025
d06baa8
Units tests + rater
SamMurshed Nov 4, 2025
d5a19af
update ci.yml
SamMurshed Nov 4, 2025
f024794
Try 3
SamMurshed Nov 4, 2025
dddccaa
Update api.py
jjl9930 Nov 5, 2025
4ce8d09
Delete pyflirt directory
jjl9930 Nov 5, 2025
c144822
Update __init__.py
jjl9930 Nov 5, 2025
87fffc6
Update test_pyflirt.py
jjl9930 Nov 5, 2025
c15ec59
Update ci.yml
jjl9930 Nov 5, 2025
b5341f9
Add more functions, tests and the demo to run all the functions
HelenZhutt Nov 5, 2025
c293267
Merge pull request #10 from swe-students-fall2025/Add-Readme
HelenZhutt Nov 5, 2025
9bbde50
Merge branch 'pipfile-experiment' into Samm-Try2
HelenZhutt Nov 5, 2025
cd7a697
Merge pull request #7 from swe-students-fall2025/Samm-Try2
HelenZhutt Nov 5, 2025
111b6d0
Merge branch 'pipfile-experiment' into pipfile-experiment
HelenZhutt Nov 5, 2025
25005cf
Merge pull request #9 from jjl9930/pipfile-experiment
HelenZhutt Nov 5, 2025
3820438
Merge branch 'pipfile-experiment' into add_search
HelenZhutt Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
test-and-build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pipenv
run: python -m pip install --upgrade pip pipenv
- name: Sync dependencies
run: pipenv sync --dev
python-version: ["3.10", "3.11"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Clean pipenv environment if exists
run: pipenv --rm || true

- name: Upgrade pip and install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build pytest pipenv

- name: Install dependencies with Pipenv
run: |
pipenv --python $(which python) install --dev --ignore-pipfile
pipenv run pip install -e .

- name: Install package editable
run: pipenv run pip install -e .

- name: Run tests
run: pipenv run pytest -q
- name: Build (sdist & wheel)
run: pipenv run python -m build
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: pyflirt-dist-${{ matrix.python-version }}
path: dist/*
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

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

[requires]
python_version = "3.12"
python_full_version = "3.12.4"
392 changes: 392 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

129 changes: 127 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,128 @@
# Python Package Exercise
# pyflirt

An exercise to create a Python package, build it, test it, distribute it, and use it. See [instructions](./instructions.md) for details.
A Python package that gives you developer-themed pickup lines and compliments. Because coding should be fun.

## What is this?

This package has a collection of cheesy (but configurable) pickup lines and compliments for developers, designers, managers, and data scientists. You can get random lines, filter by category, adjust the cheesiness level, and customize compliments.

## Installation

```bash
pip install pyflirt
```

## Quick Start

```python
from pyflirt import line, lines, compliment, categories

# Get one random pickup line
print(line())

# Get a line in a specific category
print(line(category="nerdy"))

# Get multiple lines
print(lines(n=5, category="cs"))

# Get a compliment
print(compliment(role="developer", mood="sweet"))
```

## Functions

### `line(category="nerdy", name=None, cheese=2, seed=None)`

Returns one random pickup line.

- `category`: Pick a category like "nerdy", "cs", "math", "poetic", or "classic". Default is "nerdy".
- `name`: If the line supports it, this name will be inserted.
- `cheese`: How cheesy should it be? 1 (least cheesy) to 5 (very cheesy). Default is 2.
- `seed`: Optional number for reproducible results.

Example:
```python
line(category="cs", name="Alex", cheese=2)
```

### `lines(n=5, category=None, name=None, cheese=2, seed=None)`

Returns a list of pickup lines.

- `n`: How many lines you want.
- Other parameters work the same as `line()`.

Example:
```python
lines(n=3, category="math", cheese=3)
```

### `compliment(role="developer", mood="sweet", name=None, emojis=0, seed=None)`

Returns a compliment for a specific role.

- `role`: Choose from "developer", "designer", "manager", or "data".
- `mood`: "sweet", "cheeky", or "nerdy".
- `name`: Optional name to include in the compliment.
- `emojis`: Number of heart emojis to add (0-5).
- `seed`: Optional number for reproducible results.

Example:
```python
compliment(role="designer", mood="cheeky", name="Sam", emojis=2)
```

### `categories()`

Returns a list of all available pickup line categories.

Example:
```python
print(categories())
# ['classic', 'cs', 'math', 'nerdy', 'poetic']
```

## Development Setup

If you want to work on this package:

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

2. Install pipenv (if you don't have it):
```bash
pip install pipenv
```

3. Install dependencies:
```bash
pipenv install --dev
```

4. Activate the virtual environment:
```bash
pipenv shell
```

5. Run tests:
```bash
pytest
```

6. Build the package:
```bash
python -m build
```

## Links

- [PyPI Package](https://pypi.org/project/pyflirt/)
- [GitHub Repository](https://github.com/swe-students-fall2025/3-python-package-team_quartz)

## Contributors

See the [contributors page](https://github.com/swe-students-fall2025/3-python-package-team_quartz/graphs/contributors) for a list of everyone who worked on this project.
32 changes: 32 additions & 0 deletions examples/demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from pyflirt import line, lines, categories, compliment, search, stats

def main():
print("== categories() ==")
cats = categories()
print(cats)

cat = "nerdy" if "nerdy" in cats else (cats[0] if cats else None)

print("\n== line() ==")
print(line(category=cat or "nerdy", name="Alex", cheese=3, seed=1))

print("\n== lines() ==")
for s in lines(n=3, category=cat, name="Sam", cheese=3, seed=2):
print("-", s)

print("\n== compliment() ==")
print(compliment(role="developer", mood="sweet", name="Jamie", emojis=2, seed=3))

print("\n== search() ==")

for h in search(query="you", limit=5, seed=4):
print("-", h)

print("\n== stats() ==")
st = stats()
print("total:", st["total"])
print("by_category:", st["by_category"])
print("cheese_hist:", st["cheese_hist"])

if __name__ == "__main__":
main()
41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "pyflirt"
description = "A lighthearted Python package for developer-themed pickup lines."
version = "0.1.0"
authors = [
{ name = "Daniel", email = "dl4458@nyu.edu" },
]
license = { file = "LICENSE" }
readme = "README.md"
keywords = ["fun", "pickup lines", "developer humor"]
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

dependencies = []

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

[project.urls]
"Homepage" = "https://github.com/swe-students-fall2025/3-python-package-team_quartz"
"Repository" = "https://github.com/swe-students-fall2025/3-python-package-team_quartz.git"
"Bug Tracker" = "https://github.com/swe-students-fall2025/3-python-package-team_quartz/issues"

[tool.setuptools]
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
where = ["src"]

[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
27 changes: 27 additions & 0 deletions src/pyflirt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# src/pyflirt/__init__.py
"""
pyflirt 💘
Public API:
- categories()
- line(category, name, cheese, seed)
- lines(n, category, name, cheese, seed)
- compliment(role, mood, name, emojis, seed)
"""

from .api import line, lines, categories, compliment, search, stats

__all__ = ["line", "lines", "categories", "compliment", "search", "stats", "rate_line"]


__all__ = ["categories", "line", "lines", "compliment"]
__version__ = "0.1.0"

# Provide a convenient module reference for test usage like `pyflirt.search(...)`
# even when tests only do `from pyflirt import ...`.
try:
import sys
import builtins
builtins.pyflirt = sys.modules[__name__]
except Exception:
# If this fails, normal imports still work.
pass
Loading