A package for extracting and analyzing sentiment from EV motorcycle feedback provided by customers and employees.
The full source code for this project is available on GitHub.
This subpackage analyses WhatsApp related messages for sentiment.
import by using
from evmotosentiment.wsentiment import wsentiment_score
wsentiment_score takes only string inputs.
- example
wsentiment_score('kofi has lights out')
>> -2
This subpackage changes WhatsApp text export file (.txt) into a dataframe
import using
from evmotosentiment.wsentiment import wdataframe
- example
# Suppose you have a text file with data
test_file = "sample.txt"
# Read the text file into a Pandas DataFrame
df = wdataframe(test_file)
# Display the DataFrame
print(df)
datetime sender message
0 2023-09-29 07:49:00 John Doe ok
1 2023-09-29 08:15:00 Jane Doe swapped battery
To run tests in your current Python environment:
pytestThis project uses Tox to automate testing across multiple Python versions.
The tox.ini is configured to run tests with:
- Python 3.9
- Python 3.10
- Python 3.11
Each environment installs:
pytest(for running tests)pandas(project dependency)
- Python 3.9, 3.10, and 3.11 installed on your system
- uv for faster installs (optional but recommended)
- Install tox with uv:
uv pip install tox tox-uv