Skip to main content

A cozy Python server and module for brewing coffee virtually

Project description

☕ CoffeePot

CoffeePot is a fun, quirky Python module and server that lets you brew coffee (and other drinks) via HTTP, CLI, or directly in Python code. Inspired by the HTCPCP “Hyper Text Coffee Pot Control Protocol,” CoffeePot is perfect for programmers who want a cozy, playful local server.


Features

  • Start a local CoffeeServer with a cozy default HTML page.
  • BREW endpoint simulating different types of drinks:
    • coffee, espresso, latte, mocha, tea, hot chocolate.
  • Each drink type can have unique effects (strength, aroma, mood).
  • Flexible routing using HTTP methods:
    • GET /brew → pull a coffee safely
    • BREW /brew → full HTCPCP brew
    • POST /latte, PUT /mocha, PATCH /tea, BREW /hot-chocolate
  • Fully programmatic API: use brew() and run() in Python scripts.
  • Fun ASCII art and cozy startup messages in the terminal.

Installation

git clone https://github.com/DevHollo/CoffeePot.git
cd CoffeePot
pip install -e .

This installs CoffeePot in editable mode so you can modify it while developing.

Via pip:

pip install coffeepot-http


CLI Usage

Start the server:

python -m coffeepot.cli serve --port 2615
  • Opens http://127.0.0.1:2615/ with the default cozy homepage.
  • Try:
curl -X BREW http://127.0.0.1:2615/brew
curl http://127.0.0.1:2615/brew?type=espresso

Brew a coffee from CLI:

python -m coffeepot.cli brew --type latte

Programmatic Usage

from CoffeePot import brew, run

# Brew an espresso programmatically
coffee = brew("espresso")
print(coffee)

# Start CoffeeServer programmatically
run(port=2615)

Sample output from brew("latte"):

{
  "status": "ready",
  "message": "Your latte is brewed!",
  "strength": 4,
  "aroma": "milky"
}

Custom HTML

You can provide a custom HTML page for the server:

python -m CoffeePot.cli serve --html mypage.html
  • / and /index.html will serve your custom page.
  • All brew routes continue to work normally.

Extend CoffeePot

  • Add new drink types with unique effects in brew.py.
  • Register new routes with @CoffeeServer.route("/drink", method="POST").
  • Customize HTML, ASCII art, or responses to make your CoffeePot truly yours.

Fun Facts

  • Default server port is (U+2615, decimal 9749).
  • Full HTCPCP-inspired methods make your API feel like a real coffee machine.
  • Cozy ASCII art makes even a 404 error a bit more charming.

License

MIT License. Feel free to brew, share, and fork!

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

coffeepot_http-0.0.1a1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

coffeepot_http-0.0.1a1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file coffeepot_http-0.0.1a1.tar.gz.

File metadata

  • Download URL: coffeepot_http-0.0.1a1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for coffeepot_http-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 345104da99c46da0a4323b067875f0139ebaaa98de1175f3ac57280e1df11843
MD5 7efc9d146de8d1da30c3651628fcaf2b
BLAKE2b-256 6e2a66c97c3ce47bb6d3fa545792a14d536b3594df4e4864325bad10b7c71288

See more details on using hashes here.

File details

Details for the file coffeepot_http-0.0.1a1-py3-none-any.whl.

File metadata

File hashes

Hashes for coffeepot_http-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d4cfa75fa4d0943148864172232448e3a99adb6f3e0f2607aa9d802ac4a23c6
MD5 a86bbe3d2607c4d30175c6861413cbd1
BLAKE2b-256 16e2047c5da5eb5ea42182731029a461ad8d183fec26113b04e2b54217131970

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