A fun Python package to generate random songs, select random singers, and find singers by name.
Project description
🎵 Song Singer Generator
Song Singer Generator is a Python package that allows you to create and manage song collections by genre and artist. It enables developers to:
- Add new artists and songs
- Search for specific names
- Generate random songs and singers
📦 Package on PyPI
🚀 Installation
You can install the package directly from PyPI:
pip install songsingergenerator
💡 How to Use
Here's how you can import and use the package in your Python project:
➡️ Importing the package:
from songsingergenerator import generator
➡️ Example Code:
Example for adding a new singer and song:
from songsingergenerator.generator import addSinger, randomSong, randomSinger, findSinger
# Add a singer and their songs
addSinger("Adele", "pop", ["Hello", "Someone Like You", "Rolling in the Deep"])
# Get a random song from the 'pop' genre
print(randomSong("pop"))
# Get a random singer from the 'pop' genre
print(randomSinger("pop"))
# Find a singer containing the word 'Adele'
print(findSinger("Adele"))
🛠️ Available Functions
| Function | Description | Example |
|---|---|---|
addSinger(singer, genre, songs) |
Adds a new singer and their songs to the collection. | addSinger("Adele", "pop", ["Hello"]) |
randomSong(genre=None) |
Returns a random song from a specific genre (or any genre if none is specified). | randomSong("pop") |
randomSinger(genre=None) |
Returns a random singer from a specific genre. | randomSinger("pop") |
findSinger(inWord) |
Searches for singers whose names contain the specified substring. | findSinger("Adele") |
🏗️ Contributing
We welcome contributions! Here’s how to get started:
1. Clone the repository:
git clone https://github.com/software-students-spring2025/3-python-package-solapis.git
2. Set up the virtual environment:
We use Pipenv for managing dependencies:
- Install Pipenv:
pip install pipenv
- Install dependencies:
pipenv install --dev
3. Activate the environment:
Activate the Pipenv virtual environment:
pipenv shell
4. Build the package:
Use build to create package artifacts:
pipenv run python -m build
5. Run tests:
Use pytest to run tests:
pipenv run pytest tests/
👥 Team
| Name | GitHub Profile |
|---|---|
| Yang Hu | @younghu312 |
| Ziqi Huang | @RyanH0417 |
| Zirui Han | @ZiruiHan |
| Zichao Jin | @ZichaoJin |
🌐 Running the Project
To run the project locally:
- Clone the repository.
- Set up the virtual environment with Pipenv.
- Run the test suite to make sure everything is working:
pipenv run pytest tests/
- Import the package and use it as described in the How to Use section.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file songsingergenerator-0.1.1.tar.gz.
File metadata
- Download URL: songsingergenerator-0.1.1.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2678e2ae268655dd65b2b938bc31019620e1cdfdad7740d2cd6927d869a74594
|
|
| MD5 |
430cf387d7838341aa8bde730450956c
|
|
| BLAKE2b-256 |
01cdec78effc6af85d8d6d0cfb4b328f3653e965bf2b2883c98fd4e3bac852a9
|
File details
Details for the file songsingergenerator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: songsingergenerator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe8f3b26ca0ba578694f1b4e9e40746490365a81f7c2f917d9fca55dcdb91bc9
|
|
| MD5 |
f9b589242abb2b326e7a1ae1fc8eb086
|
|
| BLAKE2b-256 |
a3372b0f43959d1a55f68474935e19c61d0b3b88cf9bb6695cab610ade819e4a
|