A simple trainable chatbot using OOP in Python
Reason this release was yanked:
broken setup - import not working
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 chatbot import ChatBot
bot = ChatBot("DecoderBot")
# Add a custom response
bot.add_response("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)
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
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.0.0.tar.gz.
File metadata
- Download URL: decoderbot-1.0.0.tar.gz
- Upload date:
- Size: 3.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 |
aaf8796e6d953f4685459277898051dc3e068684295c1e0420603909765f00bf
|
|
| MD5 |
339afc1baf1770678c2964960afc749d
|
|
| BLAKE2b-256 |
c2bb7457d4ccdf30f7f798dcf48c53392fb2ac8dae4eec06c95a179041012fc3
|
File details
Details for the file decoderbot-1.0.0-py3-none-any.whl.
File metadata
- Download URL: decoderbot-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.4 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 |
2f6c5934fb2a87f15207e0a1d8214fc240f5d7b400f9dd161b58686e2a7d4af8
|
|
| MD5 |
01fdecffe3b0afb818f40ed39fce0ca2
|
|
| BLAKE2b-256 |
faac6fb6772f3ec9a9e6e0232b7e19ce80707971b649b87ea0426f68f9eb8b3e
|