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:
Metadata
Release files for pytoslang 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytoslang-1.0.1.tar.gz | 53.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytoslang-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 95.0 kB
Release files / pytoslang-1.0.1.tar.gz
| Download URL | pytoslang-1.0.1.tar.gz |
|---|---|
| Size | 53.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3818e851b0130349b4dd2be1d1a35bc6cbeff5be5c72b83b5f6e940a3838c40
|
|
BLAKE2b-256 checksum How to use checksums |
3919022f350a137f329d69ada1bb7f1dce62481b7d8fd7fe2a143fc94097cb42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.7
|
Release files / pytoslang-1.0.1-py3-none-any.whl
| Download URL | pytoslang-1.0.1-py3-none-any.whl |
|---|---|
| Size | 41.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e87d1a444b18cfc55883ab5d8b36d40b5aa789d5d01fb88b70a744060f019e49
|
|
BLAKE2b-256 checksum How to use checksums |
95fe5e9804ef1155cd0dbb8f77439179825e4babc2048529abecac11899789d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.7
|