Skip to main content

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

Python build & test

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:

PyToSlang 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:

  1. Create a pipenv-managed virtual environment and install the package:
pipenv install PyToSlang
  1. Activate the virtual environment:
pipenv shell
  1. 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"
  1. Run your program:
python3 my_porgram.py
  1. 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!

  1. Fork the repository.
  2. Clone your fork: git clone https://github.com/software-students-spring2025/3-python-package-pypacks.git
  3. Create a new branch: git checkout -b feature-name
  4. Install dependencies with pipenv install.
  5. Run tests using pytest.
  6. Push to your branch and create a pull request.

Team:

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

pytoslang-1.0.1.tar.gz (53.6 kB view details)

Uploaded Source

Built Distribution

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

pytoslang-1.0.1-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

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

Hashes for pytoslang-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e3818e851b0130349b4dd2be1d1a35bc6cbeff5be5c72b83b5f6e940a3838c40
MD5 5872d5c2f3b699ad6ba70cea701bf8cb
BLAKE2b-256 3919022f350a137f329d69ada1bb7f1dce62481b7d8fd7fe2a143fc94097cb42

See more details on using hashes here.

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

Hashes for pytoslang-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e87d1a444b18cfc55883ab5d8b36d40b5aa789d5d01fb88b70a744060f019e49
MD5 dcde9183fc7a433a21a2a5da73b4c3ec
BLAKE2b-256 95fe5e9804ef1155cd0dbb8f77439179825e4babc2048529abecac11899789d9

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