Skip to main content

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.

License: MIT Made with ❤️ by Unknown Decoder


💡 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"), if difflib is 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


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.0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

decoderbot-1.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file decoderbot-1.0.1.tar.gz.

File metadata

  • Download URL: decoderbot-1.0.1.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

Hashes for decoderbot-1.0.1.tar.gz
Algorithm Hash digest
SHA256 55078900831059680f99ac299dcb7a15ded10637860331aa37c11195c6b42690
MD5 65db33b480f8cdbbe6228180aa297db6
BLAKE2b-256 52c85706f54919975680d50715ad0ed82436d270bef5c4f596e967b6d78dc68e

See more details on using hashes here.

File details

Details for the file decoderbot-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: decoderbot-1.0.1-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

Hashes for decoderbot-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 950032ab6aa5eb60bc667ecfea1361d0da8f7fc816067dcf35b73b2b7b7f0d3d
MD5 61d3ebd83e522266b57dcfe3d002684d
BLAKE2b-256 d1ff26fb1c6d2e8b85c2d3fdae48988cff8c860d3a36af495e3e7f635baf7ab2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page