A package with fun functions for anagrams, pallidromes, and words with missing letters.
Project description
Anagram Package
A package that contains a collection of playful word based functions, allowing you generate and check anagrams, as well as solve missing letter puzzles and find palindromes!
PyPI link
Authors:
Installation
Install this package using pip:
pip install --upgrade anagram-package
Running the Package
Option 1: Use the command-line interface
Type the following in your terminal to launch the interactive menu:
anagram_package
Option 2: Run as a Python module
You can also run the package as a Python module:
python -m anagram_package
Option 3: Import into your Python code
from anagram_package.anagram import fill_word, create_anagram, check_anagram, filter_palindromes
Functions
This Program currently contains four functions:
- fill_word(pattern): This takes a String containing one word with any number of letters replaced with an underscore '_', and returns all words that could fill the gap. eg. "Pyt_on" would return "Python".
- Parameters:
pattern: Required. A String containing only one word (no spaces), with any amount of letters replaced with an underscore ('_').
- Return: Returns a list of strings, respresenting all words that could fill the missing spaces in the word given in
pattern. - Example:
- Parameters:
from anagram_package import anagram
# Returns ["article"]
anagram.fill_word("art__le")
- create_anagram(word): This takes a String containing one word, and returns a list of strings containing every anagram of that word.
- Parameters:
word: Required. A String containing only one word (no spaces).
- Return: Returns a list of strings, respresenting anagrams of the word entered in
word.
- Parameters:
from anagram_package import anagram
# Returns ["pulper", "repulp"]
anagram.create_anagram("purple")
- check_anagram(word1,word2): This takes two strings, each containing one word (no spaces), and checks if they are anagrams of each other. It will return a boolean of the result of the comparision.
- Parameters:
word1: Required. A String containing only one word (no spaces).word2: Required. A String containing only one word (no spaces).
- Return: Returns a boolean, which is true if
word1andword2are anagrams, and false if not.
- Parameters:
from anagram_package import anagram
# Returns True
anagram.check_anagram("asdf", "fads")
# Returns False
anagram.check_anagram("asdf", "purple")
- filter_palindromes(words): Takes a list of Strings each containing only one word (no spaces), and returns a list of the words that are palindromes.
- Parameters:
words: Required. A List of Strings each containing only one word (no spaces).
- Return: Retursn a list of Strings containing all the Strings from
wordsthat are palindromic.
- Parameters:
from anagram_package import anagram
# Returns ["aaa", "aba", "abba"]
anagram.filter_palindromes(["aaa", "aba", "abba", "abab"])
Program Usage Example
Contributions
Please preform the following steps if you wish to make a contribution to the project:
- Fork this repository:
git clone https://github.com/software-students-spring2025/3-python-package-fedex-package-delivery-services.git
- Enter the directory:
cd 3-python-package-fedex-package-delivery-services
- Create a new branch for your changes.
- Set up a virtual enviroment and install dependencies:
pipenv install
pipenv shell
- Write your changes!
- Build the package:
pipenv run python -m build
- After you have built your changes, run the unit tests included within the project (please include new unit tests for any new or changed functions):
pipenv run python -m pytest tests/
- Submit a pull request on github so we can review your changes!
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 anagram_package-1.0.0.tar.gz.
File metadata
- Download URL: anagram_package-1.0.0.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0511d0ce75502eb2e1ab8f86483ccee0e58de11828df8fff2c7dcca0585407a9
|
|
| MD5 |
6cb84e68397600e7a0f6aded690d4de2
|
|
| BLAKE2b-256 |
e0022176f3be02221d845fea86e8676d3b7139928d459fb43584f83a3c60871b
|
File details
Details for the file anagram_package-1.0.0-py3-none-any.whl.
File metadata
- Download URL: anagram_package-1.0.0-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49f2c1fa3c99a7581da9f2d3156ab3d3cd338f12e92bb6093a7507e5af5942a3
|
|
| MD5 |
953612f406b8b951be30b385ff222f38
|
|
| BLAKE2b-256 |
d51d5d4e2f7de7391253132d8d598dce34740b049aaf3df770a3195afdf08f77
|