A simple trainable chatbot using OOP in Python
Project description
DecoderBot 🤖
A lightweight Python chatbot that responds to messages using exact or close matches with
difflib.
💡 What is DecoderBot?
DecoderBot is a simple Python class that lets you build a chatbot that replies to input messages based on:
- Exact matches (like
"hello") - Closest matches (like
"helo"→"hello"), ifdifflibis available
No extra libraries. No nonsense. Just logic.
🚀 Features
- 🧠 Exact and fuzzy response matching
- 🛠️ Add or update responses easily
- 📦 Zero external dependencies
- 🔥 Lightweight and fast
🛠️ How to Use
1. Clone or download the chatbot.py file.
2. Import and use it in your project:
from DecoderBot import ChatBot
bot = ChatBot("Your Bot Name")
# Add a custom response
bot.train_for("yo", "What's up?")
# Get exact match response
print(bot.get_response("yo")) # Output: What's up?
# Get a close match response (e.g. "helo" → "hello")
try:
print(bot.get_closest_response("helo"))
except Exception as e:
print(e)
OR
You can install it using the command pip install DecoderBot!
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
decoderbot-1.1.1.tar.gz
(4.1 kB
view details)
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 decoderbot-1.1.1.tar.gz.
File metadata
- Download URL: decoderbot-1.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a87c54c9412ed35e86164e8e1f4c73638f53e5c97c944391d4212d69c2b82eb3
|
|
| MD5 |
9fa272b80b0199d0ad8fc2ed2db10150
|
|
| BLAKE2b-256 |
f44ab472e75470829a3077698f29a5ad798b068e18f0e1bde681afffc31cf547
|
File details
Details for the file decoderbot-1.1.1-py3-none-any.whl.
File metadata
- Download URL: decoderbot-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d7dc502ce835d302d81e8e3de1e149fb8a4b14342a6eb8d425cd5b68623182
|
|
| MD5 |
e9ad711f79b4fc20c9bff2922ab3c4c0
|
|
| BLAKE2b-256 |
b906b90abb24e2f59bf0b7b72ec56ca3ed37c140bdda61eece5f892d2d390832
|