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 music
➡️ Example Code:
Example for adding a new singer and song:
from songsingergenerator.music import add_singer, random_song, random_singer, find_singer
# Add a singer and their songs
add_singer("Adele", "pop", ["Hello", "Someone Like You", "Rolling in the Deep"])
# Get a random song from the 'pop' genre
print(random_song("pop"))
# Get a random singer from the 'pop' genre
print(random_singer("pop"))
# Find a singer containing the word 'Adele'
print(find_singer("Adele"))
🛠️ Available Functions
| Function | Description | Example |
|---|---|---|
add_singer(singer, genre, songs=None) |
Adds a new singer and their songs to the collection. | add_singer("Adele", "pop", ["Hello"]) |
random_song(genre=None) |
Returns a random song from a specific genre (or any genre if none is specified). | random_song("pop") |
random_singer(genre=None) |
Returns a random singer from a specific genre. | random_singer("pop") |
find_singer(keyword) |
Searches for singers whose names contain the specified substring. | find_singer("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
cd 3-python-package-solapis
2. Set up the virtual environment
We use Pipenv for managing dependencies.
-
Install Pipenv:
pip install pipenv
-
Install dependencies (including build):
pipenv install --dev build
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. Prepare and run tests
Before running tests, install the package in editable mode. Then, run tests using pytest:
pipenv run pip install -e .
pipenv run pytest test/
👥 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 test/
- 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.2.tar.gz.
File metadata
- Download URL: songsingergenerator-0.1.2.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5b93555c418821d740ea1d525034f2c5ef598ee87b93a985602989711bcb3d1
|
|
| MD5 |
abb82862b7f201b29f4dfef30a686004
|
|
| BLAKE2b-256 |
cbdab65d7ba57a291b3e5347e9744344a091e2d4b267257150ad16762a5f7242
|
File details
Details for the file songsingergenerator-0.1.2-py3-none-any.whl.
File metadata
- Download URL: songsingergenerator-0.1.2-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 |
162d6075f39edb4f697fb567874a33c2d07233e9208a13a79316c374f01fdc56
|
|
| MD5 |
20582ef16385a4430a8d74586220a05e
|
|
| BLAKE2b-256 |
64210aef1aba5b70e6fbbd7953b354c804d53c506b93a0d268d49833678786bb
|