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.0.tar.gz
(4.2 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.0.tar.gz.
File metadata
- Download URL: decoderbot-1.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1221d7f9c2881e16b85afb99f8b579cb30a2371e913bad2549fb4067756b0bd
|
|
| MD5 |
4577df61b93bbb698e695edb30541bf4
|
|
| BLAKE2b-256 |
79a0cf7cafd8a18cb38f09203e67df9d3c9727d9fb24292a4d3f2a01fc97725f
|
File details
Details for the file decoderbot-1.1.0-py3-none-any.whl.
File metadata
- Download URL: decoderbot-1.1.0-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 |
69f262649651112f21847279f7e0126d7524d6533f775213ff6a2e99d985d50f
|
|
| MD5 |
af4a7964f5d8495b8af333dfabb6a20c
|
|
| BLAKE2b-256 |
e895bc2485e6be101eee5840ecbaa6c539693d2b3be032dd7b28451132524acb
|