Skip to main content

A package with fun functions for anagrams, pallidromes, and words with missing letters.

Project description

Python build & test

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:
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.
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 word1 and word2 are anagrams, and false if not.
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 words that are palindromic.
from anagram_package import anagram

# Returns ["aaa", "aba", "abba"]
anagram.filter_palindromes(["aaa", "aba", "abba", "abab"])

Program Usage Example

Example Program

Contributions

Please preform the following steps if you wish to make a contribution to the project:

  1. Fork this repository:
    • git clone https://github.com/software-students-spring2025/3-python-package-fedex-package-delivery-services.git
  2. Enter the directory:
    • cd 3-python-package-fedex-package-delivery-services
  3. Create a new branch for your changes.
  4. Set up a virtual enviroment and install dependencies:
    • pipenv install
      pipenv shell
  5. Write your changes!
  6. Build the package:
    • pipenv run python -m build
  7. 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/
  8. Submit a pull request on github so we can review your changes!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anagram_package-1.0.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anagram_package-1.0.0-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

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

Hashes for anagram_package-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0511d0ce75502eb2e1ab8f86483ccee0e58de11828df8fff2c7dcca0585407a9
MD5 6cb84e68397600e7a0f6aded690d4de2
BLAKE2b-256 e0022176f3be02221d845fea86e8676d3b7139928d459fb43584f83a3c60871b

See more details on using hashes here.

File details

Details for the file anagram_package-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for anagram_package-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49f2c1fa3c99a7581da9f2d3156ab3d3cd338f12e92bb6093a7507e5af5942a3
MD5 953612f406b8b951be30b385ff222f38
BLAKE2b-256 d51d5d4e2f7de7391253132d8d598dce34740b049aaf3df770a3195afdf08f77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page