A Python package that translates slang and text abbreviations into standard English, making informal messages more understandable. Developed with pipenv, built using setuptools, tested with pytest, and uploaded to PyPI using twine.
Project description
PyToSlang Translator
PyToSlang is a Python package that translates text abbreviations into their full meanings and back. It also changes slang words to emojis. Instructions/requirments for the creation of this package were referenced from the class course instructions.
Features
- Convert full sentences to text abbreviations (e.g., "I don't know" → "idk").
- Translate slang words into emojis (e.g., "goat" → "🐐").
- Convert slang back into full words (e.g., "nm" → "nothing much").
- Supports case-insensitive translations.
Pipy Package Link:
Installation:
pip install [package name]
Usage:
Here is how you can use PyToSlang in your Python code:
Translate Full Sentences to Slang:
from PyToSlang import full_to_slang
text = "I don't know what to do"
translated_text = full_to_slang(text)
print(translated_text) # Output: "idk what to do"
Translate Slang to Full Words:
from PyToSlang import slang_to_full
text = "nm"
translated_text = slang_to_full(text)
print(translated_text) # Output: "nothing much"
Translate Slang to Emoji:
from PyToSlang import slang_to_emoji
text = "goat"
translated_text = slang_to_emoji(text)
print(translated_text) # Output: "🐐"
Remove Slang from Sentence:
from PyToSlang import remove_slang
text = "brb im going to get food"
cleaned_text = remove_slang(text)
print(cleaned_text) # Ouput: "im going to get food"
Running PyToSlang in a Virtual Environment:
- Create a pipenv-managed virtual environment and install the package:
pipenv install PyToSlang
- Activate the virtual environment:
pipenv shell
- Create a Python program file (e.g., my_program.py) and import PyToSlang:
from PyToSlang import full_to_slang
text = "I don't know what to do"
translated_text = full_to_slang(text)
print(translated_text) # Output: "idk what to do"
- Run your program:
python3 my_porgram.py
- Exit the virtual environement when done:
exit
Example Program:
You can find a complete example program demonstrating all functions of this package in the repository: Insert Link Here
Contributing:
Want to contribute? Follow these steps!
- Fork the repository.
- Clone your fork: git clone https://github.com/software-students-spring2025/3-python-package-pypacks.git
- Create a new branch:
git checkout -b feature-name - Install dependencies with
pipenv install. - Run tests using
pytest. - Push to your branch and create a pull request.
Team:
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 pytoslang-1.0.1.tar.gz.
File metadata
- Download URL: pytoslang-1.0.1.tar.gz
- Upload date:
- Size: 53.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3818e851b0130349b4dd2be1d1a35bc6cbeff5be5c72b83b5f6e940a3838c40
|
|
| MD5 |
5872d5c2f3b699ad6ba70cea701bf8cb
|
|
| BLAKE2b-256 |
3919022f350a137f329d69ada1bb7f1dce62481b7d8fd7fe2a143fc94097cb42
|
File details
Details for the file pytoslang-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pytoslang-1.0.1-py3-none-any.whl
- Upload date:
- Size: 41.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e87d1a444b18cfc55883ab5d8b36d40b5aa789d5d01fb88b70a744060f019e49
|
|
| MD5 |
dcde9183fc7a433a21a2a5da73b4c3ec
|
|
| BLAKE2b-256 |
95fe5e9804ef1155cd0dbb8f77439179825e4babc2048529abecac11899789d9
|