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.2.1.tar.gz
(5.4 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.2.1.tar.gz.
File metadata
- Download URL: decoderbot-1.2.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ba574ac2ffddc08f4f3b50ea1326fe7985221264e34bc065c34a9beb545673
|
|
| MD5 |
98e525e83d6ea7420d991ef7292d01c1
|
|
| BLAKE2b-256 |
70087f50b033ba18000524d5efb8f1d3c9b4c178610ca5f52bbf9bb17d2826f8
|
File details
Details for the file decoderbot-1.2.1-py3-none-any.whl.
File metadata
- Download URL: decoderbot-1.2.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f688457b58c85ac33b2afcde77bfd2a4c6014bf6f5ed6a29ba27afb29ea2216d
|
|
| MD5 |
fdf2085345d14b3e698939f49efaad21
|
|
| BLAKE2b-256 |
19f2860a3ba3062a3c705e0f2a337f2692f289f8cff8998917b52ce1889f496e
|